HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /proc/self/root/usr/lib/python3/dist-packages/apt/__pycache__/
Upload File :
Current File : //proc/self/root/usr/lib/python3/dist-packages/apt/__pycache__/auth.cpython-311.pyc
�

�xkd�)��p�dZddlmZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddl
mZddl
mZmZmZGd�de��ZGd�d	e��ZGd
�de��Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Ze dkr-d�d�e
j!��e��D]Z"e#e"���dSdS)z4Handle GnuPG keys used to trust signed repositories.�)�print_functionN)�gettext)�List�Optional�Tuplec��eZdZdS)�AptKeyErrorN)�__name__�
__module__�__qualname__���*/usr/lib/python3/dist-packages/apt/auth.pyr	r	+s�������Drr	c��eZdZdZdS)�AptKeyIDTooShortErrorz!Internal class do not rely on it.N)r
rr�__doc__r
rrrr/s������+�+�+�+rrc��eZdZdZd�Zd�ZdS)�
TrustedKeyzRepresents a trusted key.c�X�||_t|��|_||_||_dS)N)�raw_name�_�name�keyid�date)�selfrrrs    r�__init__zTrustedKey.__init__7s(����
��d�G�G��	���
���	�	�	rc�4�|j�d|j�d|j��S)N�
� )rrr)rs r�__str__zTrustedKey.__str__?s��"�i�i�i�����T�Y�Y�?�?rN)r
rrrrr r
rrrr3s=������#�#����@�@�@�@�@rrc
�
�d}tj�dd��g}|�|��tj���}d|d<d|d<	tj�d��d	krxtj	d
d���}|�
tj����d
����|�
��|j|d<tj||dtjtjtj���}|�dd��}|�|��\}}|jr3t+d|j�dd�|���d|�d|�����|rt.j�
|��|���|�|���SS#|�|���wwxYw)z0Run the apt-key script with the given arguments.NzDir::Bin::Apt-Keyz/usr/bin/apt-key�C�LANG�1�$APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE�Dir�/zapt-keyz.conf)�prefix�suffixzUTF-8�
APT_CONFIGT)�env�universal_newlines�stdin�stdout�stderrr-z+The apt-key script failed with return code z:
rz	
stdout: z	
stderr: )�apt_pkg�config�	find_file�extend�os�environ�copy�find_dir�tempfile�NamedTemporaryFile�write�dump�encode�flushr�
subprocess�Popen�PIPE�get�communicate�
returncoder	�join�sysr/�strip�close)	�args�kwargs�conf�cmdr+�procr-�outputr/s	         r�_call_apt_key_scriptrNDs����D��>�#�#�$7�9K�L�L�
M�C��J�J�t����
�*�/�/�
�
�C��C��K�25�C�.�/�$��>�"�"�5�)�)�S�0�0�
�.�i��P�P�P�D��J�J�w�~�*�*�,�,�3�3�G�<�<�=�=�=��J�J�L�L�L� $�	�C�������#��/��?��?�

�
�
���
�
�7�D�)�)���)�)�%�0�0�����?�	%��+�!%�������#����������P���
��	%��J���V�$�$�$��|�|�~�~����J�J�L�L�L�L���4���J�J�L�L�L�L����s
�"E/G)�)Hc���tj�|��std|z���tj|tj��std|z���t
d|��dS)z�Import a GnuPG key file to trust repositores signed by it.

    Keyword arguments:
    filename -- the absolute path to the public GnuPG key file
    z An absolute path is required: %szKey file cannot be accessed: %s�addN)r4�path�abspathr	�access�R_OKrN)�filenames r�add_key_from_filerVtsp���7�?�?�8�$�$�I��<�x�G�H�H�H�
�9�X�r�w�'�'�H��;�h�F�G�G�G����)�)�)�)�)rc���tj��}	t|||��n#t$r�wxYw	d�}t	j||���dS#d�}t	j||���wxYw)z�Import a GnuPG key file to trust repositores signed by it.

    Keyword arguments:
    keyid -- the long keyid (fingerprint) of the key, e.g.
             A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553
    keyserver -- the URL or hostname of the key server
    c�t�t|dt��r|djtjkrdS�)N�)�
isinstance�OSError�errno�ENOENT)�funcrQ�exc_infos   r�onerrorz'add_key_from_keyserver.<locals>.onerror�s3���(�1�+�w�/�/�
�H�Q�K�4E���4U�4U���r)r`N)r8�mkdtemp�_add_key_from_keyserver�	Exception�shutil�rmtree)r�	keyserver�tmp_keyring_dirr`s    r�add_key_from_keyserverrh�s����&�(�(�O�
8���y�/�B�B�B�B������
�����	C�	�	�	�	�
�o�w�7�7�7�7�7�7��
	�	�	�	�
�o�w�7�7�7�7�7���s�'�A�3�A�A-c��t|�dd���dd����dkrtd���tj�|d��}tj�|d��}dd	d
d|g}t
j|d|d
|d|d|gz��}|dkrtd|�d|�d����tj�|d��}t
j|d
|d|d|gz��}|dkrtd|���t
j	|d
|ddddgztj
d������d}d}	|���D]4}
|
�
d��r|
�d��d }	n�5|�dd�����}|	|krtd|�d|�d����t!|��dS)!Nr��0xgD@z,Only fingerprints (v4, 160bit) are supportedzsecring.gpgzpubring.gpg�gpgz--no-default-keyringz--no-optionsz	--homedirz--secret-keyringz	--keyringz--keyserverz--recvrzrecv from 'z' failed for '�'zexport-keyring.gpgz--outputz--exportzexport of '%s' failedz
--fingerprint�--batch�--fixed-list-mode�
--with-colonsT)r.r,zfpr:�:�	)�len�replacerr4rQrDr>�callr	r?r@rB�
splitlines�
startswith�split�upperrV)rrfrg�tmp_secret_keyring�tmp_keyring�gpg_default_options�res�tmp_export_keyringrM�got_fingerprint�line�signing_key_fingerprints            rrbrb�sa��
�5�=�=��b�!�!�)�)�$��3�3�4�4��@�@�#�$R�S�S�S�����o�}�E�E���'�,�,��
�>�>�K�	��������/����������	
�
	
���C��a�x�x��k�i�i�i����O�P�P�P�����o�7K�L�L��
�/��������

�	
�
�
�C��a�x�x��1�5�9�9�9��
��������

�	
��������k�m�m�A��F��O��!�!�#�#�����?�?�6�"�"�	�"�j�j��o�o�a�0�O��E�	�$�m�m�D�"�5�5�;�;�=�=���1�1�1��k�09�	�	�;R�;R�;R�S�
�
�	
��(�)�)�)�)�)rc�0�tddddd|���dS)z�Import a GnuPG key to trust repositores signed by it.

    Keyword arguments:
    content -- the content of the GnuPG public key
    �advz--quietrnz--import�-)r-N�rN)�contents r�add_keyr��s%����	�9�j�#�W�U�U�U�U�U�Urc�&�td|��dS)z�Remove a GnuPG key to no longer trust repositores signed by it.

    Keyword arguments:
    fingerprint -- the fingerprint identifying the key
    �rmNr���fingerprints r�
remove_keyr��s����{�+�+�+�+�+rc�"�td|��S)zxReturn the GnuPG key in text format.

    Keyword arguments:
    fingerprint -- the fingerprint identifying the key
    �exportr�r�s r�
export_keyr�s�� ��+�6�6�6rc� �td��S)aUpdate the local keyring with the archive keyring and remove from
    the local keyring the archive keys which are no longer valid. The
    archive keyring is shipped in the archive-keyring package of your
    distribution, e.g. the debian-archive-keyring package in Debian.
    �updater�r
rrr�r�s�� ��)�)�)rc� �td��S)ayWork similar to the update command above, but get the archive
    keyring from an URI instead and validate it against a master key.
    This requires an installed wget(1) and an APT build configured to
    have a server to fetch from and a master keyring to validate. APT
    in Debian does not support this command and relies on update
    instead, but Ubuntu's APT does.
    z
net-updater�r
rr�
net_updater�s�� ��-�-�-rc�6�tddddd��}g}|�d��D]m}|�d��}|dd	kr|d
}|ddkr6|d}|d
}t|||��}|�|���n|S)zaReturns a list of TrustedKey instances for each key which is
    used to trust repositories.
    r�rprnroz--list-keysrrqr�pub��uidrr�)rNrxr�append)rMr}r��fieldsrr��
creation_date�keys        r�	list_keysr�(s���"�
��	�+>�
���F�
�C����T�"�"�������C�����!�9�����1�I�E��!�9������)�C�"�1�I�M��S�%��7�7�C��J�J�s�O�O�O���Jr�__main__c� �td��S)Nz;Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com>�rr
rr�<lambda>r�Bs��A�K�L�L�rc� �td��S)Nz:Ubuntu CD Image Automatic Signing Key <cdimage@ubuntu.com>r�r
rrr�r�Cs��A�J�K�K�r)$r�
__future__rr\r4�os.pathrdr>rEr8r0rr�typingrrrrcr	r�objectrrNrVrhrbr�r�r�r�r�r�r
�init�trusted_key�printr
rr�<module>r�s'��2;�:�%�%�%�%�%�%�����	�	�	�	�����
�
�
�
�����
�
�
�
��������� � � � � � �(�(�(�(�(�(�(�(�(�(�	�	�	�	�	�)�	�	�	�,�,�,�,�,�K�,�,�,�@�@�@�@�@��@�@�@�"-�-�-�`*�*�*�8�8�8�4U*�U*�U*�pV�V�V�,�,�,�7�7�7�*�*�*�	.�	.�	.����.�z���M�L�L�K�K�K��G�L�N�N�N� �y�{�{����
��k��������r