%PDF- %PDF-
Mini Shell

Mini Shell

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

�

\�ey(���dZddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z
Gd�de�ZGd�de�Z
Gd�d	�Zd
ededzdefd
�Zdeddfd�Zdededdfd�Zdedededdfd�Zdeddfd�Zdeddfd�Zdedefd�Zdefd�Zdefd�Zdeefd�Zedk(r,d�d�ej8�e�D]
Zee��yy) z4Handle GnuPG keys used to trust signed repositories.�N)�gettextc��eZdZy)�AptKeyErrorN)�__name__�
__module__�__qualname__���*/usr/lib/python3/dist-packages/apt/auth.pyrr&s��r
rc��eZdZdZy)�AptKeyIDTooShortErrorz!Internal class do not rely on it.N)rrr�__doc__r	r
rr
r
*s��+r
r
c�4�eZdZdZdedededdfd�Zdefd�Zy)	�
TrustedKeyzRepresents a trusted key.�name�keyid�date�returnNc�N�||_t|�|_||_||_y)N)�raw_name�_rrr)�selfrrrs    r�__init__zTrustedKey.__init__2s"����
��d�G��	���
���	r
c�R�|j�d|j�d|j��S)N�
� )rrr)rs r�__str__zTrustedKey.__str__9s%���)�)��B�t�z�z�l�!�D�I�I�;�7�7r
)rrrr�strrrr	r
rrr.s2��#��S����C��D��8��8r
r�args�kwargsrc
���d}tjjdd�g}|j|�tj
j
�}d|d<d|d<	tjjd�d	k7rrtjd
d��}|jtjj�jd
��|j�|j|d<tj ||dtj"tj"tj"��}|j%dd�}|j'|�\}}|j(r0t+d|j(�ddj-|��d|�d|����|rt.j0j|�|j3�|�|j5�SS#|�|j5�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)	rr �conf�cmdr+�procr-�outputr/s	         r�_call_apt_key_scriptrL=s����D��>�>�#�#�$7�9K�L�
M�C��J�J�t��
�*�*�/�/�
�C��C��K�25�C�.�/�$��>�>�"�"�5�)�S�0�
�.�.�i��P�D��J�J�w�~�~�*�*�,�3�3�G�<�=��J�J�L� $�	�	�C��������#��/�/��?�?��?�?�

���
�
�7�D�)���)�)�%�0�����?�?��!%������#����P��
���J�J���V�$��|�|�~����J�J�L���4���J�J�L��s
�E+G�G2�filenamec���tjj|�std|z��tj|tj
�std|z��t
d|�y)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_OKrL)rMs r�add_key_from_filerTlsR���7�7�?�?�8�$��<�x�G�H�H�
�9�9�X�r�w�w�'��;�h�F�G�G����)r
r�	keyserverc�t�tj�}	t|||�	dtdt
dttttfddfd�}tj||��y#t$r�wxYw#dtdt
dttttfddfd�}tj||��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
    �funcrP�exc_inforNc�l�t|dt�r!|djtjk(ry�)N�)�
isinstance�OSError�errno�ENOENT)rWrPrXs   r�onerrorz'add_key_from_keyserver.<locals>.onerror�s-���(�1�+�w�/�H�Q�K�4E�4E����4U��r
)r_)
r8�mkdtemp�_add_key_from_keyserver�	Exception�objectr�tuple�type�shutil�rmtree)rrU�tmp_keyring_dirr_s    r�add_key_from_keyserverriys����&�&�(�O�8���y�/�B�	��	� #�	�/4�T�9�f�5L�/M�	�
�	�	�
�
�o�w�7����
���
	��	� #�	�/4�T�9�f�5L�/M�	�
�	�	�
�
�o�w�7�s�
A&�&A1�1A4�4AB7rhc��t|jdd�jdd��dkrtd��tjj|d�}tjj|d�}dd	d
d|g}t
j|d|d
|d|d|gz�}|dk7rtd|�d|�d���tjj|d�}t
j|d
|d|d|gz�}|dk7rtd|��t
j|d
|ddddgztjd��j�d}d}	|j�D])}
|
jd�s�|
jd�d }	n|jdd�j�}|	|k7rtd|�d|�d���t!|�y)!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�replacer
r4rPrDr>�callrr?r@rB�
splitlines�
startswith�split�upperrT)rrUrh�tmp_secret_keyring�tmp_keyring�gpg_default_options�res�tmp_export_keyringrK�got_fingerprint�line�signing_key_fingerprints            rrara�s	��
�5�=�=��b�!�)�)�$��3�4��@�#�$R�S�S������o�}�E���'�'�,�,��
�>�K�	��������/�/����������	
�
	
��C��a�x��K�	�{�.���q�I�J�J������o�7K�L��
�/�/��������

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

�	
�������k�m�A��F��O��!�!�#����?�?�6�"�"�j�j��o�a�0�O��	�$�m�m�D�"�5�;�;�=���1�1���)��N�3J�2K�1�M�
�	
��(�)r
�contentc�&�tddddd|��y)z�Import a GnuPG key to trust repositores signed by it.

    Keyword arguments:
    content -- the content of the GnuPG public key
    �advz--quietroz--import�-)r-N�rL)r�s r�add_keyr��s����	�9�j�#�W�Ur
�fingerprintc��td|�y)z�Remove a GnuPG key to no longer trust repositores signed by it.

    Keyword arguments:
    fingerprint -- the fingerprint identifying the key
    �rmNr��r�s r�
remove_keyr��s����{�+r
c��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�6r
c��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	r
rr�r�s�� ��)�)r
c��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	r
r�
net_updater�s�� ��-�-r
c���tddddd�}g}|jd�D]Q}|jd�}|dd	k(r|d
}|ddk(s�*|d}|d
}t||�}|j|��S|S)zaReturns a list of TrustedKey instances for each key which is
    used to trust repositories.
    r�rqrorpz--list-keysrrrr�pub��uidrs�)rLryr�append)rKr~r��fieldsrr��
creation_date�keys        r�	list_keysr�s���"�
��	�+>�
��F�
�C����T�"������C����!�9����1�I�E��!�9�����)�C�"�1�I�M��S�%��7�C��J�J�s�O���Jr
�__main__c��td�S)Nz;Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com>�rr	r
r�<lambda>r�2s��A�K�L�r
c��td�S)Nz:Ubuntu CD Image Automatic Signing Key <cdimage@ubuntu.com>r�r	r
rr�r�3s��A�J�K�r
)rr]r4�os.pathrfr>rEr8r0rrrbrr
rrrLrTrirar�r�r�r�r��listr�r�init�trusted_key�printr	r
r�<module>r�s\��0;��	��
��
��� �	�)�	�,�K�,�8�8�,��,�s�T�z�,�c�,�^
*��
*��
*�8�#�8�#�8�$�8�4T*�3�T*�3�T*��T*�QU�T*�nV�S�V�T�V�,�C�,�D�,�7�C�7�C�7�*��*�.�C�.��4�
�#��,�z��M�K��G�L�L�N� �{���
�k���r

Zerion Mini Shell 1.0