+
    üÐ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Ó2ˆDŒOÜ�t˜]×+Ò+Ø#×2Ñ2Ó4ˆDÔØ��ˆ d×&6×&6Ð&6Ü×"Ò"Ð#:Ó;Ð;Ü�t˜X×&Ò&ØŸ.™.Ó*ˆDŽKñ '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   é € ð  Ù>W°s×0Ñ0×2Ð2Ó>Wùs   ‚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ó ó ó!
ˆÔð
 �{�{ˆ{Ø�I‰I�N‰Nð5ôð %&×$;Ò$;ó'á$;�LÜ×$Ò$ \×2Ò2´d×6JÒ6JÈ<×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   ø€ ÷ ñ ™8¡D©©d±5¹¹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ñ 4™sð 4¡u©S±#¨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   ø€ Ü�q˜4•x“=Ð 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Ð&Ü˜DŸK™K×,Ñ,Ó.°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™#™t¡E©#©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   ø‡ € ññ ‹8€DØ×+Ñ+€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   