+
    Dfj                         R t ^ RIt^ RIHt ^ RIHtHtHtHt ^ RI	H
t
 ^ RIHtHtHtHt ^ RIHt ^ RIHt  ! R R	]P(                  4      tR# )
z
A Factory for SSH servers.

See also L{twisted.conch.openssh_compat.factory} for OpenSSH compatibility.

Maintainer: Paul Swartz
N)chain)DictListOptionalTuple)error)_kex
connection	transportuserauth)protocol)Loggerc                      a  ] tR t^t o Rt]! 4       t]P                  t	R]
P                  R]P                  /tV 3R lR ltR tR tR tV 3R	 lR
 ltV 3R lR ltR tV 3R ltRtV tR# )
SSHFactoryz
A Factory for SSH servers.
   ssh-userauths   ssh-connectionc                   < V ^8  d   QhRR/# )   returnN )format__classdict__s   ";/usr/lib/python3/dist-packages/twisted/conch/ssh/factory.py__annotate__SSHFactory.__annotate__&   s     + +d +    c                h   \        V R4      '       g   V P                  4       V n        \        V R4      '       g   V P                  4       V n        V P                  '       d   V P                  '       g   \
        P                  ! R4      h\        V R4      '       g   V P                  4       V n        R# R# )z$
Check for public and private keys.

publicKeysprivateKeyszno host keys, failingprimesN)	hasattrgetPublicKeysr   getPrivateKeysr   r   
ConchError	getPrimesr   selfs   &r   startFactorySSHFactory.startFactory&   s     t\**"002DOt]++#224Dd&6&6&6""#:;;tX&&..*DK 'r   c                   \         P                  P                  W4      p\        \        P
                  ! R V P                  P                  4        4       4      4      Vn        V P                  '       gw   V P                  P                  R4       VP                   Uu. uF?  p\        P                  ! V4      '       g   \        P                  ! V4      '       g   K=  VNKA  	  upVn        V# u upi )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.
c              3   @   "   T F  qP                  4       x  K  	  R # 5iN)supportedSignatureAlgorithms).0keys   & r   	<genexpr>+SSHFactory.buildProtocol.<locals>.<genexpr>?   s       >Ws0022>Ws   zTdisabling non-fixed-group key exchange algorithms because we cannot find moduli file)r   FactorybuildProtocollistr   from_iterabler   valuessupportedPublicKeysr   _loginfosupportedKeyExchangesr   isFixedGroupisEllipticCurve)r%   addrtkexAlgorithms   &&  r   r1   SSHFactory.buildProtocol3   s     **46 $  >B>N>N>U>U>W  !

 {{{IINN5 %&$;$;'$;L$$\22d6J6J<6X $;'A#
 's    C-?C-C-c                    \        R4      h)z
Called when the factory is started to get the public portions of the
servers host keys.  Returns a dictionary mapping SSH key types to
public key strings.

@rtype: L{dict}
zgetPublicKeys unimplementedNotImplementedErrorr$   s   &r   r    SSHFactory.getPublicKeysO   s     ""?@@r   c                    \        R4      h)z
Called when the factory is started to get the  private portions of the
servers host keys.  Returns a dictionary mapping SSH key types to
L{twisted.conch.ssh.keys.Key} objects.

@rtype: L{dict}
zgetPrivateKeys unimplementedr@   r$   s   &r   r!   SSHFactory.getPrivateKeysY   s     ""@AAr   c                l   < V ^8  d   QhRS[ S[S[S[S[S[S[3,          ,          3,          ,          /# )r   r   r   r   intr   r   )r   r   s   "r   r   r   c   s0      8Dd5c?.C)C$DE r   c                    R# )z
Called when the factory is started to get Diffie-Hellman generators and
primes to use.  Returns a dictionary mapping number of bits to lists of
tuple of (generator, prime).
Nr   r$   s   &r   r#   SSHFactory.getPrimesc   s    r   c                <   < V ^8  d   QhRS[ RS[S[ S[ 3,          /# )r   bitsr   )rG   r   )r   r   s   "r   r   r   j   s#     4 4s 4uS#X 4r   c                   a R V3R llpV P                   f   Q R4       h\        V P                   P                  4       VR7      pV^ ,          p\        P                  ! V P                   V,          4      # )zj
Return a tuple of (g, p) for a Diffe-Hellman process, with p being as
close to C{bits} bits as possible.
c                0    V ^8  d   QhR\         R\         /# )r   ir   )rG   )r   s   "r   r   +SSHFactory.getDHPrime.<locals>.__annotate__p   s     	! 	!s 	!s 	!r   c                 (   < \        V S,
          4      # r*   )abs)rN   rK   s   &r   keyfunc&SSHFactory.getDHPrime.<locals>.keyfuncp   s    q4x= r   z(Factory should have been started by now.)r-   )r   sortedkeysrandomchoice)r%   rK   rR   
primesKeysrealBitss   &f   r   
getDHPrimeSSHFactory.getDHPrimej   s_    	! 	! {{&R(RR&DKK,,.G<
a=}}T[[233r   c                ^    VR8X  g   \        VR4      '       d   V P                  V,          # R# )z
Return a class to use as a service for the given transport.

@type transport:    L{transport.SSHServerTransport}
@type service:      L{bytes}
@rtype:             subclass of L{service.SSHService}
r   avatarN)r   services)r%   r
   services   &&&r   
getServiceSSHFactory.getServicex   s-     o%H)E)E==)) *Fr   c                r   < V ^8  d   Qh/ S[ S[S[S[S[S[S[3,          ,          3,          ,          ;R&   # )r   r   rF   )r   r   s   "r   r   r      s.     
 T#tE#s(O44566 r   )r   r   r   N)__name__
__module____qualname____firstlineno____doc__r   r6   r
   SSHServerTransportr   r   SSHUserAuthServerr	   SSHConnectionr^   r&   r1   r    r!   r#   rZ   r`   __annotate_func____static_attributes____classdictcell__)r   s   @r   r   r      sy      8D++H 	33:33H
+ +8AB 4 4	*C  r   r   )rg   rV   	itertoolsr   typingr   r   r   r   twisted.conchr   twisted.conch.sshr   r	   r
   r   twisted.internetr   twisted.loggerr   r0   r   r   r   r   <module>rt      s;      . .  C C % !j*!! j*r   