HEX
Server: Apache
System: Linux hn220.greenhost.nl 6.12.58 #3 SMP Wed Nov 19 09:04:59 UTC 2025 x86_64
User: webmaster (87278)
PHP: 8.4.5
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
Upload Files
File: //.vs/lib/python3/dist-packages/apt/__pycache__/auth.cpython-39.pyc
a

?��`g)�@s,dZddlmZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddl
mZddl
mZmZmZGdd�de�ZGdd	�d	e�ZGd
d�de�Zdd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Ze d k�r(d!d"�d#d"�e
�!�e�D]Z"e#e"��qdS)$z4Handle GnuPG keys used to trust signed repositories.�)�print_functionN)�gettext)�List�Optional�Tuplec@seZdZdS)�AptKeyErrorN)�__name__�
__module__�__qualname__�rr�*/usr/lib/python3/dist-packages/apt/auth.pyr+src@seZdZdZdS)�AptKeyIDTooShortErrorz!Internal class do not rely on it.N)rr	r
�__doc__rrrrr
/sr
c@s eZdZdZdd�Zdd�ZdS)�
TrustedKeyzRepresents a trusted key.cCs ||_t|�|_||_||_dS)N)Zraw_name�_�name�keyid�date)�selfrrrrrr�__init__7s
zTrustedKey.__init__cCsd|j|j|jfS)Nz%s
%s %s)rrr)rrrr�__str__?szTrustedKey.__str__N)rr	r
rrrrrrrr3src	Os d}tj�dd�g}|�|�tj��}d|d<d|d<z�tj�d�d	kr�tj	d
dd�}|�
tj���d
��|�
�|j|d<tj||dtjtjtjd�}|�dd�}|�|�\}}|jr�td|jd�|�||f��n|r�tj�
|�|��W|du�r|��Sn|du�r|��0dS)z0Run the apt-key script with the given arguments.NzDir::Bin::Apt-Keyz/usr/bin/apt-key�CZLANG�1Z$APT_KEY_DONT_WARN_ON_DANGEROUS_USAGEZDir�/zapt-keyz.conf)�prefix�suffixzUTF-8Z
APT_CONFIGT)�env�universal_newlines�stdin�stdout�stderrrzGThe apt-key script failed with return code %s:
%s
stdout: %s
stderr: %s� )�apt_pkgZconfigZ	find_file�extend�os�environ�copyZfind_dir�tempfileZNamedTemporaryFile�write�dump�encode�flushr�
subprocess�Popen�PIPE�get�communicate�
returncoder�join�sysr �strip�close)	�args�kwargsZconf�cmdr�procr�outputr rrr�_call_apt_key_scriptDsL

�

����
��
r;cCs@tj�|�std|��t�|tj�s2td|��td|�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)r$�path�abspathr�access�R_OKr;)�filenamerrr�add_key_from_fileqs
rBc
Csft��}z@zt|||�Wnty.�Yn0Wdd�}tj||d�ndd�}tj||d�0dS)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
    cSs(t|dt�r"|djtjkr"dS�dS)N�)�
isinstance�OSError�errnoZENOENT)�funcr=�exc_inforrr�onerror�s
�z'add_key_from_keyserver.<locals>.onerror)rIN)r'Zmkdtemp�_add_key_from_keyserver�	Exception�shutilZrmtree)r�	keyserver�tmp_keyring_dirrIrrr�add_key_from_keyservers	
�rOcCsNt|�dd��dd��dkr$td��tj�|d�}tj�|d�}dd	d
d|g}t�|d|d
|d|d|g�}|dkr�td||f��tj�|d�}t�|d
|d|d|g�}|dkr�td|��tj	|d
|ddddgtj
dd���d}d}	|��D]"}
|
�
d�r�|
�d�d}	�qq�|�dd���}|	|k�rBtd||f��t|�dS)Nr!�Z0xgD@z,Only fingerprints (v4, 160bit) are supportedzsecring.gpgzpubring.gpgZgpgz--no-default-keyringz--no-optionsz	--homedirz--secret-keyringz	--keyringz--keyserverz--recvrzrecv from '%s' failed for '%s'zexport-keyring.gpgz--outputz--exportzexport of '%s' failedz
--fingerprint�--batch�--fixed-list-mode�
--with-colonsT)rrzfpr:�:�	)�len�replacer
r$r=r2r,Zcallrr-r.r0�
splitlines�
startswith�split�upperrB)rrMrNZtmp_secret_keyringZtmp_keyringZgpg_default_options�resZtmp_export_keyringr:Zgot_fingerprint�lineZsigning_key_fingerprintrrrrJ�sl����
�
��	�


��rJcCstddddd|d�dS)z�Import a GnuPG key to trust repositores signed by it.

    Keyword arguments:
    content -- the content of the GnuPG public key
    �advz--quietrQz--import�-)rN�r;)Zcontentrrr�add_key�s�racCstd|�dS)z�Remove a GnuPG key to no longer trust repositores signed by it.

    Keyword arguments:
    fingerprint -- the fingerprint identifying the key
    ZrmNr`�Zfingerprintrrr�
remove_key�srccCs
td|�S)zxReturn the GnuPG key in text format.

    Keyword arguments:
    fingerprint -- the fingerprint identifying the key
    Zexportr`rbrrr�
export_key�srdcCstd�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`rrrrresrecCstd�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`rrrr�
net_updates	rfcCsxtddddd�}g}|�d�D]T}|�d�}|dd	kr@|d
}|ddkr|d}|d
}t|||�}|�|�q|S)zaReturns a list of TrustedKey instances for each key which is
    used to trust repositories.
    r^rSrQrRz--list-keys�
rTrZpub��uidrU�)r;rZr�append)r:r\r]�fieldsrriZ
creation_date�keyrrr�	list_keyss�
rn�__main__cCstd�S)Nz;Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com>�rrrrr�<lambda>0�rqcCstd�S)Nz:Ubuntu CD Image Automatic Signing Key <cdimage@ubuntu.com>rprrrrrq1rr)$rZ
__future__rrFr$�os.pathrLr,r3r'r"rr�typingrrrrKrr
�objectrr;rBrOrJrarcrdrerfrnrZinitZtrusted_key�printrrrr�<module>s<-H