File: //proc/self/root/lib/python3/dist-packages/twisted/conch/ssh/__pycache__/factory.cpython-38.pyc
U
W[� � @ sn d Z ddlmZmZ ddlmZ ddlmZ ddlm Z ddl
mZmZm
Z
mZ ddlZG dd � d ej�ZdS )
z�
A Factory for SSH servers.
See also L{twisted.conch.openssh_compat.factory} for OpenSSH compatibility.
Maintainer: Paul Swartz
� )�division�absolute_import)�protocol)�log)�error)�_kex� transport�userauth�
connectionNc @ s\ e Zd ZdZejZeje j
d�Zdd� Zdd� Z
dd� Zd d
� Zdd� Zd
d� Zdd� ZdS )�
SSHFactoryz$
A Factory for SSH servers.
)� ssh-userauths ssh-connectionc C sV t | d�s| �� | _t | d�s(| �� | _| jr4| js>t�d��t | d�sR| �� | _dS )z4
Check for public and private keys.
�
publicKeys�privateKeyszno host keys, failing�primesN) �hasattr�
getPublicKeysr
�getPrivateKeysr r Z
ConchError� getPrimesr ��self� r �;/usr/lib/python3/dist-packages/twisted/conch/ssh/factory.py�startFactory! s
zSSHFactory.startFactoryc C s@ t j�| |�}| j�� |_| js<t�d� dd� |j D �|_ |S )a=
Create an instance of the server side of the SSH protocol.
@type addr: L{twisted.internet.interfaces.IAddress} provider
@param addr: The address at which the server will listen.
@rtype: L{twisted.conch.ssh.transport.SSHServerTransport}
@return: The built transport.
zTdisabling non-fixed-group key exchange algorithms because we cannot find moduli filec S s$ g | ]}t �|�st �|�r|�qS r )r ZisFixedGroupZisEllipticCurve)�.0ZkexAlgorithmr r r �
<listcomp>>