ó
    Ö›‘hôO  ã                  óè  • S r SSKJr  SSKrSSKrSSKJrJrJ	r	  SSK
Jr  SSKJr  SSKJrJrJrJr  SSKJr  SS	KJrJrJr  SS
KJr  SSKJrJrJr  SSKJ r   SSK!J"r"  SSK#J$r$  SSK%J&r&  SSK'J(r(  SSK)J*r*  SSK+J,r,  \$" 5       r-S"S jr.S#S jr/ " S S5      r0\" \5       " S S\05      5       r1\" \5       " S S5      5       r2S$S jr3\" \5       " S S\0\,5      5       r4 " S S5      r5 " S  S!5      r6g)%zE
An implementation of the OpenSSH known_hosts database.

@since: 8.2
é    )ÚannotationsN)ÚErrorÚ
a2b_base64Ú
b2a_base64)Úclosing)Úsha1)ÚIOÚCallableÚIterableÚLiteral)Úimplementer)ÚHostKeyChangedÚInvalidEntryÚUserRejectedKey)ÚIKnownHostEntry)ÚBadKeyErrorÚFingerprintFormatsÚKey)Údefer)ÚDeferred)ÚLogger)ÚnativeString)ÚFilePath)ÚsecureRandom)ÚFancyEqMixinc                ó4   • [        U 5      R                  5       $ )z‚
Encode a binary string as base64 with no trailing newline.

@param s: The string to encode.

@return: The base64-encoded string.
)r   Ústrip)Úss    ÚcC:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\twisted/conch/client/knownhosts.pyÚ
_b64encoder    $   s   € ô �a‹=×ÑÓ Ð ó    c                ó$  • U R                  SS5      n[        U5      S:w  a
  [        5       eUu  p#nUR                  SS5      n[        U5      S:X  a  Uu  pgUR                  S5      nOUS   nSn[        R
                  " [        U5      5      nX#X‡4$ )ai  
Extract common elements of base64 keys from an entry in a hosts file.

@param string: A known hosts file entry (a single line).

@return: a 4-tuple of hostname data (L{bytes}), ssh key type (L{bytes}), key
    (L{Key}), and comment (L{bytes} or L{None}).  The hostname data is
    simply the beginning of the line up to the first occurrence of
    whitespace.
Né   é   é   ó   
r   )ÚsplitÚlenr   Úrstripr   Ú
fromStringr   )	ÚstringÚelementsÚ	hostnamesÚkeyTypeÚkeyAndCommentÚsplitkeyÚ	keyStringÚcommentÚkeys	            r   Ú_extractCommonr4   /   s’   € ð �|‰|˜D !Ó$€HÜ
ˆ8ƒ}˜ÓÜ‹nÐØ(0Ñ%€I˜Ø×"Ñ" 4¨Ó+€HÜ
ˆ8ƒ}˜ÓØ%Ñˆ	Ø—.‘. Ó'‰à˜Q‘Kˆ	ØˆÜ
�.Š.œ IÓ.Ó
/€CØ˜sÐ+Ð+r!   c                  ó,   • \ rS rSrSrSS jrSS jrSrg)	Ú
_BaseEntryéI   a‘  
Abstract base of both hashed and non-hashed entry objects, since they
represent keys and key types the same way.

@ivar keyType: The type of the key; either ssh-dss or ssh-rsa.
@type keyType: L{bytes}

@ivar publicKey: The server public key indicated by this line.
@type publicKey: L{twisted.conch.ssh.keys.Key}

@ivar comment: Trailing garbage after the key line.
@type comment: L{bytes} or C{None}
c                ó(   • Xl         X l        X0l        g ©N)r.   Ú	publicKeyr2   )Úselfr.   r:   r2   s       r   Ú__init__Ú_BaseEntry.__init__X   s   € ØŒØ"ŒØ�r!   c                ó$   • U R                   U:H  nU$ )z½
Check to see if this entry matches a given key object.

@param keyObject: A public key object to check.

@return: C{True} if this entry's key matches C{keyObject}, C{False}
    otherwise.
)r:   )r;   Ú	keyObjectÚresults      r   Ú
matchesKeyÚ_BaseEntry.matchesKey]   s   € ð —‘ 9Ñ,ˆØˆr!   )r2   r.   r:   N)r.   Úbytesr:   r   r2   úbytes | NoneÚreturnÚNone)r?   r   rE   Úbool)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r<   rA   Ú__static_attributes__© r!   r   r6   r6   I   s   † ñô÷

r!   r6   c                  óh   ^ • \ rS rSrSr        SU 4S jjr\S	S j5       rS
S jrSS jr	Sr
U =r$ )Ú
PlainEntryéj   zœ
A L{PlainEntry} is a representation of a plain-text entry in a known_hosts
file.

@ivar _hostnames: the list of all host-names associated with this entry.
c                ó2   >• Xl         [        TU ]	  X#U5        g r9   )Ú
_hostnamesÚsuperr<   )r;   r-   r.   r:   r2   Ú	__class__s        €r   r<   ÚPlainEntry.__init__s   s   ø€ ð (1ŒÜ‰Ñ˜¨WÕ5r!   c                óT   • [        U5      u  p#pEU " UR                  S5      X4U5      nU$ )a>  
Parse a plain-text entry in a known_hosts file, and return a
corresponding L{PlainEntry}.

@param string: a space-separated string formatted like "hostname
    key-type base64-key-data comment".

@raise DecodeError: if the key is not valid encoded as valid base64.

@raise InvalidEntry: if the entry does not have the right number of
    elements and is therefore invalid.

@raise BadKeyError: if the key, once decoded from base64, is not
    actually an SSH key.

@return: an IKnownHostEntry representing the hostname and key in the
    input line.

@rtype: L{PlainEntry}
ó   ,)r4   r'   )Úclsr+   r-   r.   r3   r2   r;   s          r   r*   ÚPlainEntry.fromString}   s/   € ô, ,:¸&Ó+AÑ(ˆ	˜CÙ�9—?‘? 4Ó(¨'¸Ó@ˆØˆr!   c                ój   • [        U[        5      (       a  UR                  S5      nXR                  ;   $ )zë
Check to see if this entry matches a given hostname.

@param hostname: A hostname or IP address literal to check against this
    entry.

@return: C{True} if this entry is for the given hostname or IP address,
    C{False} otherwise.
úutf-8)Ú
isinstanceÚstrÚencoderS   ©r;   Úhostnames     r   ÚmatchesHostÚPlainEntry.matchesHost—   s,   € ô �h¤×$Ñ$Ø—‘ wÓ/ˆHØŸ?™?Ñ*Ð*r!   c                ó  • SR                  U R                  5      U R                  [        U R                  R                  5       5      /nU R                  b  UR                  U R                  5        SR                  U5      $ )zÑ
Implement L{IKnownHostEntry.toString} by recording the comma-separated
hostnames, key type, and base-64 encoded key.

@return: The string representation of this entry, with unhashed hostname
    information.
rX   ó    )ÚjoinrS   r.   r    r:   Úblobr2   Úappend©r;   Úfieldss     r   ÚtoStringÚPlainEntry.toString¥   sb   € ð �I‰I�d—o‘oÓ&Ø�L‰LÜ�t—~‘~×*Ñ*Ó,Ó-ð
ˆð
 �<‰<Ñ#Ø�M‰M˜$Ÿ,™,Ô'Ø�y‰y˜Ó Ð r!   )rS   )r-   zlist[bytes]r.   rC   r:   r   r2   rD   )r+   rC   rE   rP   )ra   úbytes | strrE   rG   ©rE   rC   )rH   rI   rJ   rK   rL   r<   Úclassmethodr*   rb   rk   rM   Ú__classcell__©rU   s   @r   rP   rP   j   sV   ø† ñð6àð6ð ð6ð ð	6ð
 ÷6ð óó ðô2+÷!ò !r!   rP   c                  óP   • \ rS rSr% SrSrS\S'   SS jrSS jrSS jr	SS	 jr
S
rg)ÚUnparsedEntryé·   z€
L{UnparsedEntry} is an entry in a L{KnownHostsFile} which can't actually be
parsed; therefore it matches no keys and no hosts.
NrF   r.   c                ó   • Xl         g)z^
Create an unparsed entry from a line in a known_hosts file which cannot
otherwise be parsed.
N©Ú_string)r;   r+   s     r   r<   ÚUnparsedEntry.__init__À   s	   € ð
 �r!   c                ó   • g©z
Always returns False.
FrN   r`   s     r   rb   ÚUnparsedEntry.matchesHostÇ   ó   € ð r!   c                ó   • grz   rN   )r;   r3   s     r   rA   ÚUnparsedEntry.matchesKeyÍ   r|   r!   c                ó8   • U R                   R                  S5      $ )zÛ
Returns the input line, without its newline if one was given.

@return: The string representation of this entry, almost exactly as was
    used to initialize this entry but without a trailing newline.
@rtype: L{bytes}
r&   )rw   r)   ©r;   s    r   rk   ÚUnparsedEntry.toStringÓ   s   € ð �|‰|×"Ñ" 5Ó)Ð)r!   rv   )r+   rC   rE   rF   ©ra   rC   rE   rG   )r3   r   rE   rG   rn   )rH   rI   rJ   rK   rL   r.   Ú__annotations__r<   rb   rA   rk   rM   rN   r!   r   rs   rs   ·   s'   ‡ ñð
 €GˆTÓôôô÷*r!   rs   c                óÂ   • [         R                  " U [        S9n[        U[        5      (       a  UR                  S5      nUR                  U5        UR                  5       $ )z�
Return the SHA-1 HMAC hash of the given key and string.

@param key: The HMAC key.

@param string: The string to be hashed.

@return: The keyed hash value.
)Ú	digestmodr\   )ÚhmacÚHMACr   r]   r^   r_   ÚupdateÚdigest)r3   r+   Úhashs      r   Ú_hmacedStringr‹   Þ   sG   € ô �9Š9�S¤DÑ)€DÜ�&œ#×ÑØ—‘˜wÓ'ˆØ‡K�K�ÔØ�;‰;‹=Ðr!   c                  óx   ^ • \ rS rSrSrSrSr            S
U 4S jjr\SS j5       r	SS jr
SS jrS	rU =r$ )ÚHashedEntryéï   aq  
A L{HashedEntry} is a representation of an entry in a known_hosts file
where the hostname has been hashed and salted.

@ivar _hostSalt: the salt to combine with a hostname for hashing.

@ivar _hostHash: the hashed representation of the hostname.

@cvar MAGIC: the 'hash magic' string used to identify a hashed line in a
known_hosts file as opposed to a plaintext one.
s   |1|)Ú	_hostSaltÚ	_hostHashr.   r:   r2   c                ó>   >• Xl         X l        [        TU ]  X4U5        g r9   )r�   r�   rT   r<   )r;   ÚhostSaltÚhostHashr.   r:   r2   rU   s         €r   r<   ÚHashedEntry.__init__  s   ø€ ð "ŒØ!ŒÜ‰Ñ˜¨WÕ5r!   c                óä   • [        U5      u  p#pEU[        U R                  5      S R                  S5      n[        U5      S:w  a
  [	        5       eUu  pxU " [        U5      [        U5      X4U5      n	U	$ )a”  
Load a hashed entry from a string representing a line in a known_hosts
file.

@param string: A complete single line from a I{known_hosts} file,
    formatted as defined by OpenSSH.

@raise DecodeError: if the key, the hostname, or the is not valid
    encoded as valid base64

@raise InvalidEntry: if the entry does not have the right number of
    elements and is therefore invalid, or the host/hash portion
    contains more items than just the host and hash.

@raise BadKeyError: if the key, once decoded from base64, is not
    actually an SSH key.

@return: The newly created L{HashedEntry} instance, initialized with
    the information from C{string}.
Nó   |r#   )r4   r(   ÚMAGICr'   r   r   )
rY   r+   Ústuffr.   r3   r2   ÚsaltAndHashr’   r“   r;   s
             r   r*   ÚHashedEntry.fromString  so   € ô, (6°fÓ'=Ñ$ˆ˜ØœC §	¡	›NÐ,Ð-×3Ñ3°DÓ9ˆÜˆ{Ó˜qÓ Ü“.Ð Ø(ÑˆÙ”:˜hÓ'¬°HÓ)=¸wÈWÓUˆØˆr!   c                ól   • [         R                  " [        U R                  U5      U R                  5      $ )a=  
Implement L{IKnownHostEntry.matchesHost} to compare the hash of the
input to the stored hash.

@param hostname: A hostname or IP address literal to check against this
    entry.
@type hostname: L{bytes}

@return: C{True} if this entry is for the given hostname or IP address,
    C{False} otherwise.
@rtype: L{bool}
)r†   Úcompare_digestr‹   r�   r�   r`   s     r   rb   ÚHashedEntry.matchesHost+  s+   € ô ×"Ò"Ü˜$Ÿ.™.¨(Ó3°T·^±^ó
ð 	
r!   c                ó\  • U R                   SR                  [        U R                  5      [        U R                  5      /5      -   U R
                  [        U R                  R                  5       5      /nU R                  b  UR                  U R                  5        SR                  U5      $ )z¿
Implement L{IKnownHostEntry.toString} by base64-encoding the salt, host
hash, and key.

@return: The string representation of this entry, with the hostname part
    hashed.
@rtype: L{bytes}
r–   re   )
r—   rf   r    r�   r�   r.   r:   rg   r2   rh   ri   s     r   rk   ÚHashedEntry.toString<  s‚   € ð �J‰JØ�i‰iœ D§N¡NÓ3´ZÀÇÁÓ5OÐPÓQñRà�L‰LÜ�t—~‘~×*Ñ*Ó,Ó-ð	
ˆð �<‰<Ñ#Ø�M‰M˜$Ÿ,™,Ô'Ø�y‰y˜Ó Ð r!   )r�   r�   )r’   rC   r“   rC   r.   rC   r:   r   r2   rD   rE   rF   )r+   rC   rE   r�   r‚   rn   )rH   rI   rJ   rK   rL   r—   ÚcompareAttributesr<   ro   r*   rb   rk   rM   rp   rq   s   @r   r�   r�   ï   sw   ø† ñ
ð €EàUÐð
6àð
6ð ð
6ð ð	
6ð
 ð
6ð ð
6ð 
÷
6ð óó ðô:
÷"!ò !r!   r�   c                  ó�   • \ rS rSrSrSS jr\SS j5       rSS jrSS jr	          SS jr
SS jrSS	 jr\SS
 j5       rSrg)ÚKnownHostsFileiP  aN  
A structured representation of an OpenSSH-format ~/.ssh/known_hosts file.

@ivar _added: A list of L{IKnownHostEntry} providers which have been added
    to this instance in memory but not yet saved.

@ivar _clobber: A flag indicating whether the current contents of the save
    path will be disregarded and potentially overwritten or not.  If
    C{True}, this will be done.  If C{False}, entries in the save path will
    be read and new entries will be saved by appending rather than
    overwriting.
@type _clobber: L{bool}

@ivar _savePath: See C{savePath} parameter of L{__init__}.
c                ó,   • / U l         Xl        SU l        g)zô
Create a new, empty KnownHostsFile.

Unless you want to erase the current contents of C{savePath}, you want
to use L{KnownHostsFile.fromPath} instead.

@param savePath: The L{FilePath} to which to save new entries.
@type savePath: L{FilePath}
TN)Ú_addedÚ	_savePathÚ_clobber)r;   ÚsavePaths     r   r<   ÚKnownHostsFile.__init__a  s   € ð .0ˆŒØ!ŒØˆ�r!   c                ó   • U R                   $ )z,
@see: C{savePath} parameter of L{__init__}
)r¥   r€   s    r   r§   ÚKnownHostsFile.savePatho  s   € ð
 �~‰~Ðr!   c              #  óô  #   • U R                    H  nUv •  M	     U R                  (       a  g U R                  R                  5       nU   U HX  n UR                  [        R                  5      (       a  [        R                  U5      nO[        R                  U5      n Uv •  MZ     SSS5        g! [         a     gf = f! [        [        [        4 a    [        U5      n NCf = f! , (       d  f       g= f7f)a  
Iterate over the host entries in this file.

@return: An iterable the elements of which provide L{IKnownHostEntry}.
    There is an element for each entry in the file as well as an element
    for each added but not yet saved entry.
@rtype: iterable of L{IKnownHostEntry} providers
N)r¤   r¦   r¥   ÚopenÚOSErrorÚ
startswithr�   r—   r*   rP   ÚDecodeErrorr   r   rs   )r;   ÚentryÚfpÚlines       r   ÚiterentriesÚKnownHostsFile.iterentriesv  sÐ   é € ð —[”[ˆEØŒKñ !ð �=�=Øð	Ø—‘×$Ñ$Ó&ˆBò Û�ð0Ø—‘¤{×'8Ñ'8×9Ñ9Ü +× 6Ñ 6°tÓ <™ä *× 5Ñ 5°dÓ ;™ð ”ñ ÷ ˆRøô ó 	Ùð	ûô $¤\´;Ð?ó 0Ü)¨$Ó/’Eð0ú÷ �Rüsp   ‚*C8­B1 ÁC8Á	C'Á9CÂ	C'Â
CÂ	C'Â(	C8Â1
B>Â;C8Â=B>Â>C8Ã C$Ã!C'Ã#C$Ã$C'Ã'
C5Ã1C8c                ó^  • [        U R                  5       [        U R                  5      * 5       H{  u  p4UR                  UR                  5       :X  d  M%  UR                  U5      (       d  M=  UR                  U5      (       a    gUS:  a  SnSnOUS-   nU R                  n[        XFU5      e   g)an  
Check for an entry with matching hostname and key.

@param hostname: A hostname or IP address literal to check for.

@param key: The public key to check for.

@return: C{True} if the given hostname and key are present in this
    file, C{False} if they are not.

@raise HostKeyChanged: if the host key found for the given hostname
    does not match the given key.
Tr   Nr%   F)
Ú	enumerater³   r(   r¤   r.   ÚsshTyperb   rA   r¥   r   )r;   ra   r3   Úlineidxr°   r²   Úpaths          r   Ú
hasHostKeyÚKnownHostsFile.hasHostKey•  sš   € ô (¨×(8Ñ(8Ó(:¼SÀÇÁÓ=MÐ<MÖN‰NˆGØ�}‰} §¡£Õ-°%×2CÑ2CÀH×2MÓ2MØ×#Ñ# C×(Ñ(Ùð  “{Ø#˜Ø#™à&¨™{˜Ø#Ÿ~™~˜Ü(¨°dÓ;Ð;ñ Oð r!   c                óŠ   ^ ^^^^• [         R                  " T R                  TT5      nSUUUU U4S jjnUR                  U5      $ )aQ  
Verify the given host key for the given IP and host, asking for
confirmation from, and notifying, the given UI about changes to this
file.

@param ui: The user interface to request an IP address from.

@param hostname: The hostname that the user requested to connect to.

@param ip: The string representation of the IP address that is actually
being connected to.

@param key: The public key of the server.

@return: a L{Deferred} that fires with True when the key has been
    verified, or fires with an errback when the key either cannot be
    verified or has changed.
@rtype: L{Deferred}
c                ó`  >• U (       a€  T	R                  TT5      (       dg  STR                  5        STR                  5        S3nT
R                  UR	                  S5      5        T	R                  TT5        T	R                  5         U $ SUUUU	4S jjnTR                  5       nUS:X  a  SnS[        T5      < S	[        T5      < S
U< STR                  [        R                  S9< S3	nT
R                  UR	                  [        R                  " 5       5      5      nUR                  U5      $ )NzWarning: Permanently added the z host key for IP address 'z' to the list of known hosts.
r\   c                ó’   >• U (       a6  TR                  TT5        TR                  TT5        TR                  5         U $ [        5       er9   )Ú
addHostKeyÚsaver   )Úresponsera   Úipr3   r;   s    €€€€r   ÚpromptResponseÚGKnownHostsFile.verifyHostKey.<locals>.gotHasKey.<locals>.promptResponseÙ  s9   ø€ ÞØŸ™¨°#Ô6ØŸ™¨¨CÔ0ØŸ	™	œØ'˜ä-Ó/Ð/r!   ÚECÚECDSAzThe authenticity of host 'z (z)' can't be established.
z key fingerprint is SHA256:)Úformatz9.
Are you sure you want to continue connecting (yes/no)? )rÁ   rG   rE   rG   )rº   ÚtypeÚdecodeÚwarnr_   r¿   rÀ   r   Úfingerprintr   ÚSHA256_BASE64ÚpromptÚsysÚgetdefaultencodingÚaddCallback)r@   Ú
addMessagerÃ   ÚkeytyperÍ   Úproceedra   rÂ   r3   r;   Úuis         €€€€€r   Ú	gotHasKeyÚ/KnownHostsFile.verifyHostKey.<locals>.gotHasKeyË  s  ø€ ÞØ—‘ r¨3×/Ñ/à9¸#¿(¹(»*¸ð F,Ø,.¯I©I«K¨=ð 9$ð$ð ð
 —G‘G˜J×-Ñ-¨gÓ6Ô7Ø—O‘O B¨Ô,Ø—I‘I”KØ�÷0ò 0ð  #Ÿx™x›z�à˜d“?Ø%�Gøô % XÖ.Ü$ RÖ(ÛØŸ™Ô/A×/OÑ/O˜ÓPð	ð ð Ÿ)™) F§M¡M´#×2HÒ2HÓ2JÓ$KÓL�Ø×*Ñ*¨>Ó:Ð:r!   )r@   rG   rE   zbool | Deferred[bool])r   Úexecuterº   rÐ   )r;   rÔ   ra   rÂ   r3   ÚhhkrÕ   s   `````  r   ÚverifyHostKeyÚKnownHostsFile.verifyHostKey³  s7   ü€ ô, �mŠm˜DŸO™O¨X°sÓ;ˆ÷)	;ó )	;ðV �‰˜yÓ)Ð)r!   c                ó    • [        S5      nUR                  5       n[        U[        X15      XBS5      nU R                  R                  U5        U$ )a—  
Add a new L{HashedEntry} to the key database.

Note that you still need to call L{KnownHostsFile.save} if you wish
these changes to be persisted.

@param hostname: A hostname or IP address literal to associate with the
    new entry.
@type hostname: L{bytes}

@param key: The public key to associate with the new entry.
@type key: L{Key}

@return: The L{HashedEntry} that was added.
@rtype: L{HashedEntry}
é   N)r   r·   r�   r‹   r¤   rh   )r;   ra   r3   Úsaltr.   r°   s         r   r¿   ÚKnownHostsFile.addHostKeyø  sE   € ô" ˜BÓˆØ—+‘+“-ˆÜ˜D¤-°Ó"?ÀÈtÓTˆØ�‰×Ñ˜5Ô!Øˆr!   c           
     óô  • U R                   R                  5       nUR                  5       (       d  UR                  5         U R                  (       a  SOSnU R                   R                  U5       nU R                  (       aR  UR                  SR                  U R                   Vs/ s H  oDR                  5       PM     sn5      S-   5        / U l        SSS5        SU l        gs  snf ! , (       d  f       N= f)z=
Save this L{KnownHostsFile} to the path it was loaded from.
ÚwÚar&   NF)
r¥   ÚparentÚisdirÚmakedirsr¦   r¬   r¤   Úwriterf   rk   )r;   ÚpÚmodeÚhostsFileObjr°   s        r   rÀ   ÚKnownHostsFile.save  s¯   € ð �N‰N×!Ñ!Ó#ˆØ�w‰w�y‰yØ�J‰JŒLà)-¯¯¡#¸CˆØ�^‰^× Ñ  Ô&¨,Ø�{�{Ø×"Ñ"Ø—J‘J¸d¿kºkÓJºk°U§¡Ö 0¹kÑJÓKÈeÑSôð !�”÷ 'ð ˆ�ùò  K÷ 'Õ&ús   Á06C)Â&C$Â?C)Ã$C)Ã)
C7c                ó$   • U " U5      nSUl         U$ )au  
Create a new L{KnownHostsFile}, potentially reading existing known
hosts information from the given file.

@param path: A path object to use for both reading contents from and
    later saving to.  If no file exists at this path, it is not an
    error; a L{KnownHostsFile} with no entries is returned.

@return: A L{KnownHostsFile} initialized with entries from C{path}.
F)r¦   )rY   r¹   Ú
knownHostss      r   ÚfromPathÚKnownHostsFile.fromPath   s   € ñ ˜“Yˆ
Ø#ˆ
ÔØÐr!   )r¤   r¦   r¥   N)r§   úFilePath[str]rE   rF   )rE   rî   )rE   zIterable[IKnownHostEntry])ra   rC   r3   r   rE   rG   )
rÔ   Ú	ConsoleUIra   rC   rÂ   rC   r3   r   rE   úDeferred[bool])ra   rC   r3   r   rE   r�   )rE   rF   )r¹   rî   rE   r¢   )rH   rI   rJ   rK   rL   r<   Úpropertyr§   r³   rº   rÙ   r¿   rÀ   ro   rì   rM   rN   r!   r   r¢   r¢   P  s|   † ñô ð óó ðôô>ð<C*ØðC*Ø',ðC*Ø27ðC*Ø>AðC*à	ôC*ôJô.ð" óó ór!   r¢   c                  ó6   • \ rS rSrSrSS jrS	S jrS
S jrSrg)rï   i1  zz
A UI object that can ask true/false questions and post notifications on the
console, to be used during key verification.
c                ó   • Xl         g)a  
@param opener: A no-argument callable which should open a console
    binary-mode file-like object to be used for reading and writing.
    This initializes the C{opener} attribute.
@type opener: callable taking no arguments and returning a read/write
    file-like object
N©Úopener)r;   rõ   s     r   r<   ÚConsoleUI.__init__7  s	   € ð �r!   c                ób   ^ ^• [         R                  " S5      nU U4S jnUR                  U5      $ )aw  
Write the given text as a prompt to the console output, then read a
result from the console input.

@param text: Something to present to a user to solicit a yes or no
    response.
@type text: L{bytes}

@return: a L{Deferred} which fires with L{True} when the user answers
    'yes' and L{False} when the user answers 'no'.  It may errback if
    there were any I/O errors.
Nc                ó<  >• [        TR                  5       5       nUR                  T5         UR                  5       R	                  5       R                  5       nUS:X  a
   S S S 5        gUS;   a
   S S S 5        gUR                  S5        M_  ! , (       d  f       g = f)NTs   yes>   r!   ó   noFs   Please type 'yes' or 'no': )r   rõ   rå   Úreadliner   Úlower)ÚignoredÚfÚanswerr;   Útexts      €€r   ÚbodyÚConsoleUI.prompt.<locals>.bodyP  sƒ   ø€ Ü˜Ÿ™›Ô'¨1Ø—‘˜”ØØŸZ™Z›\×/Ñ/Ó1×7Ñ7Ó9�FØ Ó'Ø#÷ (Ð'ð   <Ó/Ø$÷ (Ð'ð Ÿ™Ð >Ô?ñ ÷ (Õ'ús   ›ABÁ*BÁ:BÂ
B)r   ÚsucceedrÐ   )r;   rÿ   Údr   s   ``  r   rÍ   ÚConsoleUI.promptA  s*   ù€ ô �MŠM˜$Óˆö
	@ð �}‰}˜TÓ"Ð"r!   c                óØ   •  [        U R                  5       5       nUR                  U5        SSS5        g! , (       d  f       g= f! [         a    [        R                  S5         gf = f)z™
Notify the user (non-interactively) of the provided text, by writing it
to the console.

@param text: Some information the user is to be made aware of.
NzFailed to write to console)r   rõ   rå   Ú	ExceptionÚlogÚfailure)r;   rÿ   rý   s      r   rÊ   ÚConsoleUI.warn^  sI   € ð	6Ü˜Ÿ™›Ô'¨1Ø—‘˜”÷ (×'Ö'ûäó 	6Ü�K‰KÐ4Ö5ð	6ús+   ‚A ›6­A ¶
AÁ A ÁA ÁA)Á(A)rô   N)rõ   zCallable[[], IO[bytes]]rE   rF   )rÿ   rC   rE   rð   )rÿ   rC   rE   rF   )	rH   rI   rJ   rK   rL   r<   rÍ   rÊ   rM   rN   r!   r   rï   rï   1  s   † ñô
ô#÷:6r!   rï   )r   rC   rE   rC   )r+   rC   rE   z&tuple[bytes, bytes, Key, bytes | None])r3   rC   r+   rm   rE   rC   )7rL   Ú
__future__r   r†   rÎ   Úbinasciir   r¯   r   r   Ú
contextlibr   Úhashlibr   Útypingr	   r
   r   r   Úzope.interfacer   Útwisted.conch.errorr   r   r   Útwisted.conch.interfacesr   Útwisted.conch.ssh.keysr   r   r   Útwisted.internetr   Útwisted.internet.deferr   Útwisted.loggerr   Útwisted.python.compatr   Útwisted.python.filepathr   Útwisted.python.randbytesr   Útwisted.python.utilr   r  r    r4   r6   rP   rs   r‹   r�   r¢   rï   rN   r!   r   Ú<module>r     sï   ðñ
õ #ã Û 
ß AÑ AÝ Ý ß 2Ó 2å &ç MÑ MÝ 4ß GÑ GÝ "Ý +Ý !Ý .Ý ,Ý 1Ý ,áƒh€ô!ô,÷4ñ ñB ˆ_ÓôI!�ó I!ó ðI!ñX ˆ_Ó÷#*ð #*ó ð#*ôLñ" ˆ_Óô]!�*˜ló ]!ó ð]!÷@^ñ ^÷B86ò 86r!   