Current File : //lib/python3/dist-packages/twisted/conch/test/__pycache__/test_default.cpython-312.pyc |
�
Ϫ�f- � � � d Z ddlZddlmZ ddlmZ ddlmZ ddlm Z ddl
mZ ddlm
Z
dd lmZ dd
lmZ ddlmZ dZd
Z ed� rddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ndZdZeZ ejB � rdZdZejD jG � sdZdZejH jG � sdZdZ G d� de� Z% G d� de� Z&y)z,
Tests for L{twisted.conch.client.default}.
� N)�skipIf)�
ConchError)�keydata)�StringTransport)�nativeString)�FilePath)�
requireModule)�platform)�TestCaseF� �cryptography)�default)�SSHAgentClient)�SSHUserAuthClient)�ConchOptions)�KeyTz7cryptography required for twisted.conch.client.default.zlgenericAnswers and getPassword does not work on Windows. Should be fixed as part of fixing bug 6409 and 6410z#sys.stdin is not an interactive ttyz$sys.stdout is not an interactive ttyc � � e Zd ZdZd� Zd� Zd� Zd� Zd� Zd� Z d� Z
d � Z ee
e� d
� � Z ee
e� d� � Z ee
e� d� � Z ee
e� d
� � Zy)�SSHUserAuthClientTestszm
Tests for L{SSHUserAuthClient}.
@type rsaPublic: L{Key}
@ivar rsaPublic: A public RSA key.
c �� � t j t j � | _ t | j
� � | _ | j j � | j j d� | _
| j j t j � | j j d� j t j � y )N�id_rsa�
id_rsa.pub)
r �
fromStringr �publicRSA_openssh� rsaPublicr �mktemp�tmpdir�makedirs�child�rsaFile�
setContent�privateRSA_openssh��selfs �A/usr/lib/python3/dist-packages/twisted/conch/test/test_default.py�setUpzSSHUserAuthClientTests.setUp: s� � �����(A�(A�B����t�{�{�}�-����������{�{�(�(��2��������� :� :�;������,�'�2�2�7�3L�3L�M� c �J � t dt � d� }t � }t � }|j |� ||_ d}|j
| j |� | j |j � d| j j � z dz |z dz � y)z�
When connected to an agent, L{SSHUserAuthClient} can use it to
request signatures of particular data with a particular L{Key}.
� userNs Sign heres -
s s )r r r r �makeConnection�keyAgent�signDatar �assertEqual�value�blob)r# �client�agent� transport� cleartexts r$ �test_signDataWithAgentz-SSHUserAuthClientTests.test_signDataWithAgentB s� � �
#�7�L�N�D�A��� ��#�%� �
���Y�'���� � ������� �2�����O�O��1��n�n�!�!�#�
$��
� �
� "�
"�
r&