404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.133.125.185: ~ $
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

Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 113 B 0644
__init__.cpython-36.pyc File 113 B 0644
apport.cpython-36.opt-1.pyc File 5.92 KB 0644
apport.cpython-36.pyc File 5.96 KB 0644
atomic_helper.cpython-36.opt-1.pyc File 2.05 KB 0644
atomic_helper.cpython-36.pyc File 2.05 KB 0644
cloud.cpython-36.opt-1.pyc File 3.08 KB 0644
cloud.cpython-36.pyc File 3.08 KB 0644
dmi.cpython-36.opt-1.pyc File 5.32 KB 0644
dmi.cpython-36.pyc File 5.32 KB 0644
event.cpython-36.opt-1.pyc File 1.97 KB 0644
event.cpython-36.pyc File 1.97 KB 0644
features.cpython-36.opt-1.pyc File 1.47 KB 0644
features.cpython-36.pyc File 1.47 KB 0644
gpg.cpython-36.opt-1.pyc File 3.76 KB 0644
gpg.cpython-36.pyc File 3.76 KB 0644
helpers.cpython-36.opt-1.pyc File 13.31 KB 0644
helpers.cpython-36.pyc File 13.31 KB 0644
importer.cpython-36.opt-1.pyc File 1.68 KB 0644
importer.cpython-36.pyc File 1.68 KB 0644
log.cpython-36.opt-1.pyc File 4.61 KB 0644
log.cpython-36.pyc File 4.61 KB 0644
netinfo.cpython-36.opt-1.pyc File 12.67 KB 0644
netinfo.cpython-36.pyc File 12.67 KB 0644
persistence.cpython-36.opt-1.pyc File 2.82 KB 0644
persistence.cpython-36.pyc File 2.82 KB 0644
registry.cpython-36.opt-1.pyc File 1.38 KB 0644
registry.cpython-36.pyc File 1.38 KB 0644
safeyaml.cpython-36.opt-1.pyc File 8 KB 0644
safeyaml.cpython-36.pyc File 8 KB 0644
settings.cpython-36.opt-1.pyc File 1.14 KB 0644
settings.cpython-36.pyc File 1.14 KB 0644
signal_handler.cpython-36.opt-1.pyc File 1.58 KB 0644
signal_handler.cpython-36.pyc File 1.58 KB 0644
simpletable.cpython-36.opt-1.pyc File 2.53 KB 0644
simpletable.cpython-36.pyc File 2.53 KB 0644
ssh_util.cpython-36.opt-1.pyc File 15.36 KB 0644
ssh_util.cpython-36.pyc File 15.36 KB 0644
stages.cpython-36.opt-1.pyc File 25.15 KB 0644
stages.cpython-36.pyc File 25.15 KB 0644
subp.cpython-36.opt-1.pyc File 9.97 KB 0644
subp.cpython-36.pyc File 9.97 KB 0644
temp_utils.cpython-36.opt-1.pyc File 2.81 KB 0644
temp_utils.cpython-36.pyc File 2.81 KB 0644
templater.cpython-36.opt-1.pyc File 4.55 KB 0644
templater.cpython-36.pyc File 4.55 KB 0644
type_utils.cpython-36.opt-1.pyc File 437 B 0644
type_utils.cpython-36.pyc File 437 B 0644
url_helper.cpython-36.opt-1.pyc File 21.03 KB 0644
url_helper.cpython-36.pyc File 21.03 KB 0644
user_data.cpython-36.opt-1.pyc File 8.25 KB 0644
user_data.cpython-36.pyc File 8.25 KB 0644
util.cpython-36.opt-1.pyc File 73.64 KB 0644
util.cpython-36.pyc File 73.64 KB 0644
version.cpython-36.opt-1.pyc File 429 B 0644
version.cpython-36.pyc File 429 B 0644
warnings.cpython-36.opt-1.pyc File 3.25 KB 0644
warnings.cpython-36.pyc File 3.25 KB 0644