- GRAYBYTE UNDETECTABLE CODES -

403Webshell
Server IP : 184.154.167.98  /  Your IP : 3.23.103.132
Web Server : Apache
System : Linux pink.dnsnetservice.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
User : puertode ( 1767)
PHP Version : 8.2.26
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3.6/site-packages/cloudinit/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3.6/site-packages/cloudinit/__pycache__/gpg.cpython-36.pyc
3

\�me�@srdZddlZddlZddlmZeje�ZdddddgZd	d
�Z	dd�Z
ddd�Zddd�Zdd�Z
ddd�ZdS)z0gpg.py - Collection of gpg key related functions�N)�subp�gpgz--with-fingerprintz--no-default-keyringz--list-keysz	--keyringcCsZytjddd|gdd�\}}Wn6tjk
rT}ztjd||�d}WYdd}~XnX|S)z*Export gpg key, armoured key gets returnedrz--exportz--armourT)�capturez&Failed to export armoured key "%s": %sN)r�ProcessExecutionError�LOG�debug)�key�armour�_�error�r�/usr/lib/python3.6/gpg.py�
export_armoursrcCstjddg|dd�jS)z~Dearmor gpg key, dearmored key gets returned

    note: man gpg(1) makes no mention of an --armour spelling, only --armor
    rz	--dearmorF)�data�decode)r�stdout)rrrr
�dearmor'srFcCsNg}|jt�|s|jd�|j|�tj|dd�\}}|rJtjd||�|S)z�List keys from a keyring with fingerprints. Default to a stable machine
    parseable format.

    @param key_file: a string containing a filepath to a key
    @param human_output: return output intended for human parsing
    z
--with-colonsT)rz&Failed to export armoured key "%s": %s)�extend�GPG_LIST�appendrr�warning)Zkey_fileZhuman_output�cmdr�stderrrrr
�list/s


r�c	 Cs�tjd||�ddd|d|g}|dkr,g}d}d}t|�}x�|d7}y"tj|d	d
�tjd|||�dStjk
r�}z
|}WYdd}~XnXy&t|�}tjd|j|�tj|�Wq>t	k
r�}zt
d
||||f�|�WYdd}~Xq>Xq>WdS)a�Receive gpg key from the specified keyserver.

    Retries are done by default because keyservers can be unreliable.
    Additionally, there is no way to determine the difference between
    a non-existant key and a failure.  In both cases gpg (at least 2.2.4)
    exits with status 2 and stderr: "keyserver receive failed: No data"
    It is assumed that a key provided to cloud-init exists on the keyserver
    so re-trying makes better sense than failing.

    @param key: a string key fingerprint (as passed to gpg --recv-keys).
    @param keyserver: the keyserver to request keys from.
    @param retries: an iterable of sleep lengths for retries.
                    Use None to indicate no retries.z&Importing key '%s' from keyserver '%s'rz--no-ttyz--keyserver=%sz--recv-keysNrrT)rz/Imported key '%s' from keyserver '%s' on try %dz6Import failed with exit code %d, will try again in %ssz@Failed to import key '%s' from keyserver '%s' after %d tries: %s)rr�iterrr�nextZ	exit_code�timeZsleep�
StopIteration�
ValueError)	r�	keyserverZretriesrZtrynumrZsleeps�eZnaplenrrr
�recv_keyBs>r"cCsTytjdddd|gdd�Wn2tjk
rN}ztjd||�WYdd}~XnXdS)	z0Delete the specified key from the local gpg ringrz--batchz--yesz
--delete-keysT)rzFailed delete key "%s": %sN)rrrr)rrrrr
�
delete_keyss
r#�keyserver.ubuntu.comcCs\t|�}|sXz@yt||d�t|�}Wn"tk
rHtjd|��YnXWdt|�X|S)zget gpg keyid from keyserver)r zFailed to obtain gpg key %sN)rr"rrZ	exceptionr#)Zkeyidr r	rrr
�
getkeybyid}s
r%)F�rr)r&)r$)�__doc__ZloggingrZ	cloudinitrZ	getLogger�__name__rrrrrr"r#r%rrrr
�<module>s



1

Youez - 2016 - github.com/yon3zu
LinuXploit