403Webshell
Server IP : 3.96.16.70  /  Your IP : 216.73.216.15
Web Server : Apache
System : Linux ip-172-31-26-103.ca-central-1.compute.internal 6.1.163-186.299.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Feb 24 16:35:42 UTC 2026 x86_64
User : ec2-user ( 1000)
PHP Version : 8.4.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python3.9/site-packages/cloudinit/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.9/site-packages/cloudinit/__pycache__/gpg.cpython-39.pyc
a

�½bH�@spdZddlZddlmZddlmZe�e�Zgd�Z	dd�Z
dd	�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	--keyringc
Cs\ztjddd|gdd�\}}Wn8tjyV}zt�d||�d}WYd}~n
d}~00|S)z*Export gpg key, armoured key gets returnedrz--exportz--armourT�Zcapture�&Failed to export armoured key "%s": %sN)r�ProcessExecutionError�LOG�debug)�key�armour�_�error�r�1/usr/lib/python3.9/site-packages/cloudinit/gpg.py�
export_armours�rcCstjddg|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)r
rrr�dearmor'srFcCsNg}|�t�|s|�d�|�|�tj|dd�\}}|rJt�d||�|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-colonsTrr)�extend�GPG_LIST�appendrr�warning)Zkey_fileZhuman_output�cmdr�stderrrrr�list/s


r��rc	
Cs�t�d||�ddd|d|g}|dur,g}d}d}t|�}|d7}z$tj|d	d
�t�d|||�WdStjy�}z|}WYd}~n
d}~00z&t|�}t�d|j|�t�|�Wq<t	y�}z"t
d
||||f�|�WYd}~q<d}~00q<dS)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-keysNrrTrz/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�time�sleep�
StopIteration�
ValueError)	r
�	keyserverZretriesrZtrynumr
Zsleeps�eZnaplenrrr�recv_keyBsF��
���r&c
CsVztjdddd|gdd�Wn4tjyP}zt�d||�WYd}~n
d}~00dS)	z0Delete the specified key from the local gpg ringrz--batchz--yesz
--delete-keysTrzFailed delete key "%s": %sN)rrrr)r
r
rrr�
delete_keyss�
r'�keyserver.ubuntu.comcCsbt|�}|s^zFzt||d�t|�}Wn tyFt�d|��Yn0Wt|�n
t|�0|S)zget gpg keyid from keyserver)r$zFailed to obtain gpg key %s)rr&r#r�	exceptionr')Zkeyidr$rrrr�
getkeybyid}s
r*)F)r)r()�__doc__r Z	cloudinitrZloggingrZ	getLogger�__name__rrrrrr&r'r*rrrr�<module>s
	


1

Youez - 2016 - github.com/yon3zu
LinuXploit