o
    Ņó·ifk  ć                   @  sų   d Z ddlmZ ddlZddlZddlZddlZddlmZ ddl	m
Z
 ddlmZ ddlmZmZmZmZmZ ddlmZ dd	lmZ dd
lmZ edrkddlmZmZmZmZmZmZ ddl m!Z!m"Z"m#Z#m$Z$ ndZ%dddZ&G dd deZ'dS )z-
Tests for L{twisted.conch.scripts.ckeygen}.
é    )ŚannotationsN)ŚStringIO)ŚCallable)ŚNoReturn)ŚprivateECDSA_opensshŚprivateEd25519_openssh_newŚprivateRSA_opensshŚprivateRSA_openssh_encryptedŚpublicRSA_openssh)ŚFilePath)ŚrequireModule)ŚTestCaseZcryptography)Ś_getKeyOrDefaultŚ_saveKeyŚchangePassPhraseŚdisplayPublicKeyŚenumrepresentationŚprintFingerprint)ŚBadFingerPrintFormatŚBadKeyErrorŚFingerprintFormatsŚKeyz7cryptography required for twisted.conch.scripts.ckeygenŚpassphrasesŚstrŚreturnśCallable[[object], str]c                    s   t |  d fdd}|S )	a@  
    Return a callable to patch C{getpass.getpass}.  Yields a passphrase each
    time called. Use case is to provide an old, then new passphrase(s) as if
    requested interactively.

    @param passphrases: The list of passphrases returned, one per each call.

    @return: A callable to patch C{getpass.getpass}.
    Ś_Śobjectr   r   c                   s   t  S ©N)Śnext©r   ©ZpassphrasesIter© śeC:\Users\psant\Downloads\PAF backend\school\venv\Lib\site-packages\twisted/conch/test/test_ckeygen.pyŚfakeGetpass<   ó   z makeGetpass.<locals>.fakeGetpassN)r   r   r   r   )Śiter)r   r$   r"   r!   r#   ŚmakeGetpass0   s   
r'   c                   @  s¦  e Zd ZdZdZddZ		d[d\ddZdZddZdZddZdZddZdZddZ	dZddZ
dZddZdZddZdZddZdZddZdZd d!ZdZd"d#ZdZd$d%ZdZd&d'ZdZd(d)ZdZd*d+ZdZd,d-ZdZd.d/ZdZd0d1ZdZd2d3ZdZd4d5ZdZd6d7ZdZd8d9ZdZd:d;ZdZd<d=ZdZd>d?ZdZd@dAZdZdBdCZ dZdDdEZ!dZdFdGZ"dZdHdIZ#dZdJdKZ$dZdLdMZ%dZdNdOZ&dZdPdQZ'dZdRdSZ(dZdTdUZ)dZdVdWZ*dZdXdYZ+dS )]ŚKeyGenTestszN
    Tests for various functions used to implement the I{ckeygen} script.
    r   ŚNonec                 C  s   t  | _|  td| j” dS )zX
        Patch C{sys.stdout} so tests can make assertions about what's printed.
        ŚstdoutN)r   r*   ŚpatchŚsys©Śselfr"   r"   r#   ŚsetUpG   s   zKeyGenTests.setUpNŚkeyTyper   ŚkeySiześ
str | NoneŚprivateKeySubtypec                 C  sĄ   |   ” }dd|d|dg}|d ur| d|g” |d ur"| d|g” t |” t |”}t |d ”}|dkr@|  | ” d	” n|d
krM|  | ” d” n
|  | ” | ” ” |  	| 
” ” d S )NŚckeygenś-tś-fz--no-passphrasez-bz--private-key-subtypeś.pubŚecdsaZECŚed25519ZEd25519)ŚmktempŚextendŚ
subprocessŚcallr   ZfromFileŚassertEqualŚtypeŚupperŚ
assertTrueZisPublic)r.   r0   r1   r3   ŚfilenameŚargsZprivKeyŚpubKeyr"   r"   r#   Ś_testrunN   s   

zKeyGenTests._testrunc                 C  sŖ   |   dd” | j dddd |   d” | j ddd |   d” |   dd” | j dddd |   d” | j ddd |   dd” | j dddd |   d” | j ddd d S )	Nr8   Z384Śv1)r3   r9   ZdsaZ2048Śrsa)rE   r-   r"   r"   r#   Śtest_keygeneratione   s   



zKeyGenTests.test_keygenerationc                 C  sN   |   ” }|  tj” t dddd|g” W d    d S 1 s w   Y  d S )Nr4   r5   Zfoor6   )r:   ŚassertRaisesr<   ŚCalledProcessErrorŚ
check_call©r.   rB   r"   r"   r#   Śtest_runBadKeytypet   s   "’zKeyGenTests.test_runBadKeytypec                 C  ó"   t ddi}|  |d tj” dS )z
        L{enumrepresentation} takes a dictionary as input and returns a
        dictionary with its attributes changed to enum representation.
        Śformatśmd5-hexN)r   ŚassertIsr   ZMD5_HEX©r.   Śoptionsr"   r"   r#   Śtest_enumrepresentationy   s   z#KeyGenTests.test_enumrepresentationc                 C  rN   )zF
        Test for format L{FingerprintFormats.SHA256-BASE64}.
        rO   śsha256-base64N)r   rQ   r   ZSHA256_BASE64rR   r"   r"   r#   Śtest_enumrepresentationsha256   s   z)KeyGenTests.test_enumrepresentationsha256c                 C  sN   |   t”}tddi W d   n1 sw   Y  |  d|jjd ” dS )z9
        Test for unsupported fingerprint format
        rO   ś
sha-base64Nś*Unsupported fingerprint format: sha-base64r   )rI   r   r   r>   Ś	exceptionrC   )r.   Śemr"   r"   r#   Ś test_enumrepresentationBadFormat   s   ’’z,KeyGenTests.test_enumrepresentationBadFormatc                 C  ó:   |   ” }t| t” t|dd |  | j ” d” dS )z¹
        L{printFingerprint} writes a line to standard out giving the number of
        bits of the key, its fingerprint, and the basename of the file from it
        was read.
        rP   ©rB   rO   z:2048 85:25:04:32:58:55:96:9f:57:ee:fb:a8:1a:ea:69:da temp
N©r:   r   Ś
setContentr
   r   r>   r*   ŚgetvaluerL   r"   r"   r#   Śtest_printFingerprint   s   žz!KeyGenTests.test_printFingerprintc                 C  r\   )z
        L{printFigerprint} will print key fingerprint in
        L{FingerprintFormats.SHA256-BASE64} format if explicitly specified.
        rU   r]   z72048 FBTCOoknq0mHy+kpfnY9tDdcAJuWtCpuQMaV3EsvbUI= temp
Nr^   rL   r"   r"   r#   Śtest_printFingerprintsha256    s   žz'KeyGenTests.test_printFingerprintsha256c                 C  sf   |   ” }t| t” |  t”}t|dd W d   n1 s"w   Y  |  d|jj	d ” dS )zx
        L{printFigerprint} raises C{keys.BadFingerprintFormat} when unsupported
        formats are requested.
        rW   r]   NrX   r   )
r:   r   r_   r
   rI   r   r   r>   rY   rC   )r.   rB   rZ   r"   r"   r#   Ś)test_printFingerprintBadFingerPrintFormat­   s   ’’z5KeyGenTests.test_printFingerprintBadFingerPrintFormatc                 C  s>   |   ” }t|d  t” t|dd |  | j ” d” dS )zn
        L{printFingerprint} checks if the filename with the  '.pub' suffix
        exists in ~/.ssh.
        r7   rP   r]   z>2048 85:25:04:32:58:55:96:9f:57:ee:fb:a8:1a:ea:69:da temp.pub
Nr^   rL   r"   r"   r#   Ś#test_printFingerprintSuffixAppendedŗ   s   žz/KeyGenTests.test_printFingerprintSuffixAppendedc                 C  ó   t |  ” }| ”  | d”j}t t”}t||ddd |  	| j
 ” d||f ” |  	| | d” ” dd”|” |  	t | d” ” ”| ” ” dS )z
        L{_saveKey} writes the private and public parts of a key to two
        different files and writes a report of this to standard out.
        Śid_rsaŚ
passphraserP   ©rB   ŚpassrO   śŗYour identification has been saved in %s
Your public key has been saved in %s.pub
The key fingerprint in <FingerprintFormats=MD5_HEX> is:
85:25:04:32:58:55:96:9f:57:ee:fb:a8:1a:ea:69:da
Nś
id_rsa.pub©r   r:   ŚmakedirsŚchildŚpathr   Ś
fromStringr   r   r>   r*   r`   Ś
getContentŚpublic©r.   ŚbaserB   Śkeyr"   r"   r#   Śtest_saveKeyĒ   s"   
żž’’zKeyGenTests.test_saveKeyc                 C  re   )z³
        L{_saveKey} writes the private and public parts of a key to two
        different files and writes a report of this to standard out.
        Test with ECDSA key.
        Śid_ecdsarg   rP   rh   zŗYour identification has been saved in %s
Your public key has been saved in %s.pub
The key fingerprint in <FingerprintFormats=MD5_HEX> is:
1e:ab:83:a6:f2:04:22:99:7c:64:14:d2:ab:fa:f5:16
Nzid_ecdsa.pub)r   r:   rm   rn   ro   r   rp   r   r   r>   r*   r`   rq   rr   rs   r"   r"   r#   Śtest_saveKeyECDSAß   s"   
żž’’zKeyGenTests.test_saveKeyECDSAc                 C  re   )zµ
        L{_saveKey} writes the private and public parts of a key to two
        different files and writes a report of this to standard out.
        Test with Ed25519 key.
        Ś
id_ed25519rg   rP   rh   zŗYour identification has been saved in %s
Your public key has been saved in %s.pub
The key fingerprint in <FingerprintFormats=MD5_HEX> is:
ab:ee:c8:ed:e5:01:1b:45:b7:8d:b2:f0:8f:61:1c:14
Nzid_ed25519.pub)r   r:   rm   rn   ro   r   rp   r   r   r>   r*   r`   rq   rr   rs   r"   r"   r#   Śtest_saveKeyEd25519ų   s$   
żžž’zKeyGenTests.test_saveKeyEd25519c                 C  re   )z
        L{_saveKey} will generate key fingerprint in
        L{FingerprintFormats.SHA256-BASE64} format if explicitly specified.
        rf   rg   rU   rh   z½Your identification has been saved in %s
Your public key has been saved in %s.pub
The key fingerprint in <FingerprintFormats=SHA256_BASE64> is:
FBTCOoknq0mHy+kpfnY9tDdcAJuWtCpuQMaV3EsvbUI=
Nrk   rl   rs   r"   r"   r#   Śtest_saveKeysha256  s&   
’żž’’zKeyGenTests.test_saveKeysha256c                 C  s~   t |  ” }| ”  | d”j}t t”}|  t	”}t
||ddd W d   n1 s.w   Y  |  d|jjd ” dS )zq
        L{_saveKey} raises C{keys.BadFingerprintFormat} when unsupported
        formats are requested.
        rf   rg   rW   rh   NrX   r   )r   r:   rm   rn   ro   r   rp   r   rI   r   r   r>   rY   rC   )r.   rt   rB   ru   rZ   r"   r"   r#   Ś test_saveKeyBadFingerPrintformat,  s   

ž’’z,KeyGenTests.test_saveKeyBadFingerPrintformatc                 C  s`   t |  ” }| ”  | d”j}t t”}t||ddd |  	| | d” 
” dd”|” dS )śq
        L{_saveKey} will choose an empty string for the passphrase if
        no-passphrase is C{True}.
        rf   TrP   ©rB   zno-passphraserO   Nó    )r   r:   rm   rn   ro   r   rp   r   r   r>   rq   rs   r"   r"   r#   Śtest_saveKeyEmptyPassphrase>  s   
’’z'KeyGenTests.test_saveKeyEmptyPassphrasec                 C  ó^   t |  ” }| ”  | d”j}t t”}t||ddd |  	| | d” 
” d”|” dS )r}   rw   TrP   r~   N)r   r:   rm   rn   ro   r   rp   r   r   r>   rq   rs   r"   r"   r#   Ś test_saveKeyECDSAEmptyPassphraseN  s   
’"z,KeyGenTests.test_saveKeyECDSAEmptyPassphrasec                 C  r   )r}   ry   TrP   r~   N)r   r:   rm   rn   ro   r   rp   r   r   r>   rq   rs   r"   r"   r#   Ś"test_saveKeyEd25519EmptyPassphrase\  s   
’’z.KeyGenTests.test_saveKeyEd25519EmptyPassphrasec                   s    t |  ” }| ”  | d”jg  ddl}d fdd	}|  |jjj	d
fdd” t
 t”}t|dddd| | d” ” }| |dd”}|  ||” dS )zd
        When no path is specified, it will ask for the path used to store the
        key.
        Ś
custom_keyr   NrC   r   r   r   c                    ó      d” dS ©NŚ ©Śappend©rC   ©Śinput_promptsr"   r#   Ś
mock_inputx  ó   
z6KeyGenTests.test_saveKeyNoFilename.<locals>.mock_inputZ_inputSaveFilec                   s    S r   r"   r    )ŚkeyPathr"   r#   Ś<lambda>|  ó    z4KeyGenTests.test_saveKeyNoFilename.<locals>.<lambda>TrP   r~   r   ©rC   r   r   r   )r   r:   rm   rn   ro   Śtwisted.conch.scripts.ckeygenr+   ZconchŚscriptsr4   r   rp   r   r   rq   r>   )r.   rt   Ztwistedr   ru   ZpersistedKeyContentZpersistedKeyr"   )r   r   r#   Śtest_saveKeyNoFilenamel  s    

żz"KeyGenTests.test_saveKeyNoFilenamec                 C  sj   ddd}t |  ” }| ”  | d”j}|  tjdd	d
 ” t t	”}|ddd}|  
tt|||” dS )zs
        When the specified file exists, it will ask the user for confirmation
        before overwriting.
        rC   r   r   ś	list[str]c                  W  s   dgS )NŚnr"   r   r"   r"   r#   r     s   z6KeyGenTests.test_saveKeyFileExists.<locals>.mock_inputr   Śexistsc                 S  ó   dS )NTr"   r    r"   r"   r#   r     r   z4KeyGenTests.test_saveKeyFileExists.<locals>.<lambda>TrP   r~   N)rC   r   r   r   )r   r:   rm   rn   ro   r+   Śosr   rp   r   rI   Ś
SystemExitr   )r.   r   rt   r   ru   rS   r"   r"   r#   Śtest_saveKeyFileExists  s   

z"KeyGenTests.test_saveKeyFileExistsc                 C  s°   t |  ” }| ”  | d”j}t t”}t||dddd |  	| j
 ” d||f ” | d” ” }|  	| |dd”|” |  | d”” |  	t | d	” ” ”| ” ” dS )
zi
        L{_saveKey} can be told to write the new private key file in OpenSSH
        v1 format.
        rf   rg   rP   rF   )rB   ri   rO   śprivate-key-subtyperj   Nó$   -----BEGIN OPENSSH PRIVATE KEY-----
rk   )r   r:   rm   rn   ro   r   rp   r   r   r>   r*   r`   rq   rA   Ś
startswithrr   )r.   rt   rB   ru   ŚprivateKeyContentr"   r"   r#   Śtest_saveKeySubtypeV1  s4   
üž	żž’’z!KeyGenTests.test_saveKeySubtypeV1c                 C  sX   |   ” }t t”}t| t” td|i | j 	”  
d” d”}|  || d”” dS )zl
        L{displayPublicKey} prints out the public key associated with a given
        private key.
        rB   Ś
ŚasciiŚopensshN)r:   r   rp   r
   r   r_   r   r   r*   r`   ŚstripŚencoder>   ŚtoString©r.   rB   rD   Z	displayedr"   r"   r#   Śtest_displayPublicKey¼  s   
z!KeyGenTests.test_displayPublicKeyc                 C  sZ   |   ” }t t”}t| t” t|dd | j 	”  
d” d”}|  || d”” dS )z
        L{displayPublicKey} prints out the public key associated with a given
        private key using the given passphrase when it's encrypted.
        Ś	encrypted©rB   ri   r¢   r£   r¤   N)r:   r   rp   r
   r   r_   r	   r   r*   r`   r„   r¦   r>   r§   rØ   r"   r"   r#   Śtest_displayPublicKeyEncryptedČ  s   
z*KeyGenTests.test_displayPublicKeyEncryptedc                 C  sj   |   ” }t t”}t| t” |  tddd ” t	d|i | j
 ”  d” d”}|  || d”” dS )	z
        L{displayPublicKey} prints out the public key associated with a given
        private key, asking for the passphrase when it's encrypted.
        Śgetpassc                 S  r   )NrŖ   r"   )Śxr"   r"   r#   r   Ü  r   zLKeyGenTests.test_displayPublicKeyEncryptedPassphrasePrompt.<locals>.<lambda>rB   r¢   r£   r¤   N)r:   r   rp   r
   r   r_   r	   r+   r­   r   r*   r`   r„   r¦   r>   r§   rØ   r"   r"   r#   Ś.test_displayPublicKeyEncryptedPassphrasePromptŌ  s   
z:KeyGenTests.test_displayPublicKeyEncryptedPassphrasePromptc                 C  s.   |   ” }t| t” |  tt|dd” dS )z
        L{displayPublicKey} fails with a L{BadKeyError} when trying to decrypt
        an encrypted key with the wrong password.
        Śwrongr«   N)r:   r   r_   r	   rI   r   r   rL   r"   r"   r#   Ś$test_displayPublicKeyWrongPassphraseį  s
   ’z0KeyGenTests.test_displayPublicKeyWrongPassphrasec                 C  sl   t ddd}|  td|” |  ” }t| t” td|i |  | j	 
”  d”d” |  tt| ” ” dS )zt
        L{changePassPhrase} allows a user to change the passphrase of a
        private key interactively.
        rŖ   Śnewpassr­   rB   r¢   ś;Your identification has been saved with the new passphrase.N©r'   r+   r­   r:   r   r_   r	   r   r>   r*   r`   r„   ŚassertNotEqualrq   )r.   ŚoldNewConfirmrB   r"   r"   r#   Śtest_changePassphraseģ  s   ž’z!KeyGenTests.test_changePassphrasec                 C  sl   t dd}|  td|” |  ” }t| t” t|dd |  | j	 
”  d”d” |  tt| ” ” dS )z
        L{changePassPhrase} allows a user to change the passphrase of a
        private key, providing the old passphrase and prompting for new one.
        r²   r­   rŖ   r«   r¢   r³   Nr“   )r.   Z
newConfirmrB   r"   r"   r#   Śtest_changePassphraseWithOld   s   
ž’z(KeyGenTests.test_changePassphraseWithOldc                 C  sV   |   ” }t| t” t|ddd |  | j ”  d”d” |  	tt| 
” ” dS )z¢
        L{changePassPhrase} allows a user to change the passphrase of a private
        key by providing both old and new passphrases without prompting.
        rŖ   Ś
newencrypt)rB   ri   r²   r¢   r³   N)r:   r   r_   r	   r   r>   r*   r`   r„   rµ   rq   rL   r"   r"   r#   Śtest_changePassphraseWithBoth  s   
’ž’z)KeyGenTests.test_changePassphraseWithBothc                 C  óR   |   ” }t| t” |  tt|dd”}|  dt|” |  tt| 	” ” dS )z
        L{changePassPhrase} exits if passed an invalid old passphrase when
        trying to change the passphrase of a private key.
        r°   r«   z1Could not change passphrase: old passphrase errorN)
r:   r   r_   r	   rI   r   r   r>   r   rq   ©r.   rB   Śerrorr"   r"   r#   Ś$test_changePassphraseWrongPassphrase'  s   ’’z0KeyGenTests.test_changePassphraseWrongPassphrasec                 C  sb   |   tdtd” |  ” }t| t” |  tt	d|i”}|  
dt|” |  
tt| ” ” dS )z
        L{changePassPhrase} exits if no passphrase is specified for the
        C{getpass} call and the key is encrypted.
        r­   r   rB   zMCould not change passphrase: Passphrase must be provided for an encrypted keyN)r+   r­   r'   r:   r   r_   r	   rI   r   r   r>   r   rq   r¼   r"   r"   r#   Ś!test_changePassphraseEmptyGetPass6  s   żz-KeyGenTests.test_changePassphraseEmptyGetPassc                 C  sT   |   ” }t| d” |  ttd|i”}d}|  |t|” |  dt| ” ” dS )zc
        L{changePassPhrase} exits if the file specified points to an invalid
        key.
        s   foobarrB   z?Could not change passphrase: cannot guess the type of b'foobar'N)	r:   r   r_   rI   r   r   r>   r   rq   )r.   rB   r½   Śexpectedr"   r"   r#   Śtest_changePassphraseBadKeyF  s   z'KeyGenTests.test_changePassphraseBadKeyc                 C  sj   |   ” }t| t” ddd}|  td|” |  tt|d	d
”}|  	dt
|” |  	tt| ” ” dS )z
        L{changePassPhrase} doesn't modify the key file if an unexpected error
        happens when trying to create the key with the new passphrase.
        rC   r   Śkwargsr   r   c                  _  s   t d)NZoops)ŚRuntimeError©rC   rĀ   r"   r"   r#   r§   [  r%   z>KeyGenTests.test_changePassphraseCreateError.<locals>.toStringr§   r¹   ©rB   r²   z!Could not change passphrase: oopsN)rC   r   rĀ   r   r   r   ©r:   r   r_   r   r+   r   rI   r   r   r>   r   rq   )r.   rB   r§   r½   r"   r"   r#   Ś test_changePassphraseCreateErrorS  s   
żz,KeyGenTests.test_changePassphraseCreateErrorc                 C  sn   |   ” }t| t” ddd}|  td|” |  tt|d	d
”}d}|  	|t
|” |  	tt| ” ” dS )zq
        L{changePassPhrase} doesn't modify the key file if C{toString} returns
        an empty string.
        rC   r   rĀ   r   r   c                  _  r   r   r"   rÄ   r"   r"   r#   r§   r  s   zCKeyGenTests.test_changePassphraseEmptyStringError.<locals>.toStringr§   r¹   rÅ   z9Could not change passphrase: cannot guess the type of b''N)rC   r   rĀ   r   r   r   rĘ   )r.   rB   r§   r½   rĄ   r"   r"   r#   Ś%test_changePassphraseEmptyStringErrorj  s   
żz1KeyGenTests.test_changePassphraseEmptyStringErrorc                 C  r»   )z
        L{changePassPhrase} exits when trying to change the passphrase on a
        public key, and doesn't change the file.
        ri   rÅ   z.Could not change passphrase: key not encryptedN)
r:   r   r_   r
   rI   r   r   r>   r   rq   r¼   r"   r"   r#   Śtest_changePassphrasePublicKey  s   ’z*KeyGenTests.test_changePassphrasePublicKeyc                 C  s   t ddd}|  td|” |  ” }t| t” t|dd |  | j	 
”  d”d” t| ” }|  t|” |  | d”” d	S )
zq
        L{changePassPhrase} can be told to write the new private key file in
        OpenSSH v1 format.
        rŖ   r²   r­   rF   )rB   r   r¢   r³   r   N)r'   r+   r­   r:   r   r_   r	   r   r>   r*   r`   r„   rq   rµ   rA   r   )r.   r¶   rB   r    r"   r"   r#   Śtest_changePassphraseSubtypeV1  s   ž’z*KeyGenTests.test_changePassphraseSubtypeV1c                   sp   g  d fdd}ddi}t ||}|  |d d” |  | tj d	d
””” |  dt ” |  dg ” dS )zg
        L{options} will default to "~/.ssh/id_rsa" if the user doesn't
        specify a key.
        rC   r   r   r   c                    r   r   r   r   r   r"   r#   r   ¬  r   z5KeyGenTests.test_useDefaultForKey.<locals>.mock_inputrB   r   z.sshrf   é   Nr   )r   r>   rA   Śendswithr   ro   ŚjoinŚlen)r.   r   rS   rB   r"   r   r#   Śtest_useDefaultForKey„  s   
žz!KeyGenTests.test_useDefaultForKeyc                 C  ó,   ddi}|   tt|”}|  d|jd ” dS )z
        Ensure FileNotFoundError is handled, whether the user has supplied
        a bad path, or has no key at the default path.
        rB   ś/foo/barś+could not be opened, please specify a file.r   N)rI   r   r   ŚassertInrC   ©r.   rS   Śexcr"   r"   r#   Ś'test_displayPublicKeyHandleFileNotFound¾  s   z3KeyGenTests.test_displayPublicKeyHandleFileNotFoundc                 C  rŠ   )śN
        Ensure FileNotFoundError is handled for an invalid filename.
        rB   rŃ   rŅ   r   N)rI   r   r   rÓ   rC   rŌ   r"   r"   r#   Ś'test_changePassPhraseHandleFileNotFoundĒ  s   z3KeyGenTests.test_changePassPhraseHandleFileNotFoundc                 C  s.   ddd}|   tt|”}|  d|jd ” dS )r×   rŃ   rP   r]   rŅ   r   N)rI   r   r   rÓ   rC   rŌ   r"   r"   r#   Ś'test_printFingerprintHandleFileNotFoundĻ  s   
z3KeyGenTests.test_printFingerprintHandleFileNotFound)r   r)   )NN)r0   r   r1   r2   r3   r2   r   r)   ),Ś__name__Ś
__module__Ś__qualname__Ś__doc__r/   rE   rH   rM   rT   rV   r[   ra   rb   rc   rd   rv   rx   rz   r{   r|   r   r   r   r   r   r”   r©   r¬   rÆ   r±   r·   rø   rŗ   r¾   ræ   rĮ   rĒ   rČ   rÉ   rŹ   rĻ   rÖ   rŲ   rŁ   r"   r"   r"   r#   r(   B   sX    

ü





















"















	r(   )r   r   r   r   )(rŻ   Ś
__future__r   r­   r   r<   r,   Śior   Śtypingr   Ztyping_extensionsr   Ztwisted.conch.test.keydatar   r   r   r	   r
   Ztwisted.python.filepathr   Ztwisted.python.reflectr   Ztwisted.trial.unittestr   r   r   r   r   r   r   r   Ztwisted.conch.ssh.keysr   r   r   r   Śskipr'   r(   r"   r"   r"   r#   Ś<module>   s&    
