File: //usr/lib/python3/dist-packages/twisted/conch/test/__pycache__/test_ckeygen.cpython-38.pyc
U
s�@g9O � @ s� d Z ddlZddlZddlZddlZddlmZmZ ddlm Z m
Z
ddlmZ ed�r�ed�r�ddl
mZmZmZmZ dd lmZmZmZmZmZ nd
ZddlmZ ddlmZ dd
lmZmZm Z m!Z! dd� Z"G dd� de�Z#dS )z-
Tests for L{twisted.conch.scripts.ckeygen}.
� N)�BytesIO�StringIO)�unicode�_PY3)�
requireModuleZcryptographyZpyasn1)�Key�BadKeyError�BadFingerPrintFormat�FingerprintFormats)�changePassPhrase�displayPublicKey�printFingerprint�_saveKey�enumrepresentationzBcryptography and pyasn1 required for twisted.conch.scripts.ckeygen)�FilePath)�TestCase)�publicRSA_openssh�privateRSA_openssh�privateRSA_openssh_encrypted�privateECDSA_opensshc s t � �� � fdd�}|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}.
c s t � �S �N)�next��_��passphrases� �A/usr/lib/python3/dist-packages/twisted/conch/test/test_ckeygen.py�fakeGetpass. s z makeGetpass.<locals>.fakeGetpass)�iter)r r r r r �makeGetpass"