ok

Mini Shell

Direktori : /proc/self/root/proc/self/root/proc/self/root/lib/python2.7/site-packages/yum/
Upload File :
Current File : //proc/self/root/proc/self/root/proc/self/root/lib/python2.7/site-packages/yum/pgpmsg.pyc

�
8M�bc@sbddlZddlZddlZddlZddlZyddlZWn<ek
r�ddlZddlZdfd��YZnXe	Z
dZdZdZ
dZdZdZd	Zd
ZdZdZd
ZdZdZdZdZdZdZdZdZdZdZdZ ide6de6de6de6de6de6de6d e6d!e6d"e6d#e6d$e6d%e6d&e6d'e6d(e6d)e 6Z!d
Z"d*Z#dZ$d	Z%d
Z&dZ'd	Z(d
Z)d+Z*dZ+dZ,dZ-d,Z.d-Z/i	d.e'6d/e(6d0e)6d1e*6d2e+6d3e,6d4e-6d5e.6d6e/6Z0d*Z1dZ2d	Z3d
Z4dZ5dZ6d
Z7dZ8dZ9dZ:dZ;id7e16d8e26d9e36d:e46d;e56d<e66d=e76d>e86d?e96d@e:6dAe;6Z<d*Z=dZ>d	Z?d
Z@idBe=6dCe>6dDe?6dEe@6ZAdZBd	ZCd
ZDdZEdZFd
ZGdZHdZIdZJdZKdZLidFeB6dGeC6dHeD6dIeE6dJeF6dKeG6dLeH6dMeI6dNeJ6dOeK6dPeL6ZMd*ZNdZOd	ZPd+ZQdZRdZSdZTdQZUdRZVdSZWdTZXdUZYdVZZi
dWeN6dXeO6dYeP6dZeQ6d[eR6d\eS6d]eT6d^eU6d_eV6d`eW6daeX6dbeY6dceZ6Z[d	Z\d
Z]dZ^dZ_d
Z`dZadZbdZcdZddZed+Zfd,Zgd-ZhddZideZjdQZkdfZldgZmdhZndiZodjZpdkZqdRZrdSZsidle\6dme]6dne^6doe_6dpe`6dqea6dreb6dsec6dted6duee6dvef6dweg6dxeh6dyei6dzej6d{ek6d|el6d}em6d~en6deo6d�ep6d�eq6d�er6d�es6Ztd*ZudZvd	Zwd
ZxdSZyid�eu6d�ev6d�ew6d�ex6d�ey6ZzdZ{d	Z|dZ}dZ~d+ZdZ�dZ�dVZ�dZ�id�e�6Z�d��Z�d��Z�d��Z�d��Z�d��Z�d��Z�d��Z�d��Z�d��Z�d��Z�d�e�fd���YZ�d�e�fd���YZ�d�e�fd���YZ�d�e�fd���YZ�d�e�fd���YZ�d�e�fd���YZ�d��Z�d��Z�d��Z�e�d��Z�d��Z�e�d�kr^ddl�Z�x,e�e�e�j�d�j���D]Z�e�GHqLWndS(�i����NthashlibcBseZed��ZRS(cCs9|dkrtj�S|dkr,tj�Std�dS(Ntmd5tsha1sBad checksum type(Rtnewtshat
ValueError(talgo((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyR#s


(t__name__t
__module__tstaticmethodR(((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyR!si�i�i<i?iiiiiiiii	i
iii
iiiis#public-key encrypted session packetssignature packets&symmetric-key encrypted session packetsone-pass signature packetssecret-key certificate packetspublic-key certificate packetssecret-key subkey packetscompressed data packets#symmetric-key encrypted data packets
marker packetsliteral data packetstrust packetsuser id packetspublic subkey packetsuser attribute packets$symmetric encrypted integrity packets"modification detection code packetiiiisRSA (Encrypt or Sign)sRSA Encrypt-Onlys
RSA Sign-OnlysElgamal Encrypt-Onlys DSA (Digital Signature Standard)sElliptic CurvetECDSAsElgamal (Encrypt or Sign)sDiffie-HellmansPlaintext or unencrypted datatIDEAs
Triple-DEStCAST5tBlowfishsSAFER-SK128sDES/SKsAES 128-bitsAES 192-bitsAES 256-bitsTwofish 256-bittUncompressedtZIPtZLIBtBZip2tMD5tSHA1t	RIPEMD160sdouble-width SHAtMD2tTIGER192sHAVAL-5-160tSHA256tSHA384tSHA512tSHA224iii i(i0i@s document signature, binary images"document signature, canonical textssignature over just subpacketss;public key packet and user ID packet, generic certifications-public key packet and user ID packet, personas:public key packet and user ID packet, casual certifications<public key packet and user ID packet, positive certificationssubkey bindings
key signatureskey revocationssubkey revocationscertificate revocationt	timestampiiiiiiiissignature creation timessignature expiration timesexportable certificationstrust signaturesregular expressiont	revocableskey expiration times&placeholder for backward compatibilityspreferred symmetric algorithmssrevocation keys
issuer key IDs
notation dataspreferred hash algorithmss preferred compression algorithmsskey server preferencesspreferred key serversprimary user ids
policy URIs	key flagsssigner's user idsreason for revocationtfeaturesssignature targetsembedded signaturesNo reason specifiedsKey is supercededsKey has been compromisedsKey is no longer useds&user id information is no longer validsModification DetectioncCsld}xY|dkratjd|||d!�d}|dt|�}|d}|d}q	W||fS(s�get_whole_number(msg, idx, numlen)
extracts a "whole number" field of length numlen from msg at index idx
returns (<whole number>, new_idx) where the whole number is a long integer
and new_idx is the index of the next element in the messagelitBil(tstructtunpacktlong(tmsgtidxtnumlentntb((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pytget_whole_number:s!
cCs(t|||�\}}t|�|fS(siget_whole_int(msg, idx, numlen)
same as get_whole_number but returns the number as an int for convenience(R'tint(R"R#R$R%((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyt
get_whole_intGscCsPg}x:|dkrB|jdtjd|d@��|dL}q	Wdj|�S(sKpack_long(l)
    returns big-endian representation of unsigned long integeriRi�it(tinsertRtpacktjoin(tltarr((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyt	pack_longMs
 cCs�t|�}t|�dd}t|�dkrlt|d�}x-|dkrh|d7}|dL}qEWnd}tjd|�|S(s_pack_mpi(l)
    returns the PGP Multi-Precision Integer representation of unsigned long integeriiis>H(R0tlentordRR,(R.tstbitsR%((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pytpack_mpiVs
cCs|t||d�\}}|dkr.||fS|dkrlt||d�\}}|dd>|d|fSt||d�S(sfget_sig_subpak_len(msg, idx)
extracts a signature subpacket length field
returns (subpak_len, new_idx)ii�i�ii(R)(R"R#tplentplen2((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pytget_sig_subpak_lenfs
cCs7t||d�\}}|ft|||dd�S(sget_mpi(msg, idx)
    extracts a multi-precision integer field from the message msg at index idx
    returns (n, <mpi>, new_idx) where the mpi is a long integer and new_idx is
    the index of the next element in the message and n is the number of bits of
    precision in <mpi>iii(R)R'(R"R#tln((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyt	get_n_mpirscCs!t||�}|d|dfS(s�get_mpi(msg, idx)
extracts a multi-precision integer field from the message msg at index idx
returns (<mpi>, new_idx) where the mpi is a long integer and new_idx is
the index of the next element in the messageii(R:(R"R#R.((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pytget_mpi{scCsdjtd�t|���S(NR*cSstt|��djd�S(Ni(thexR2tzfill(tx((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyt<lambda>�s(R-tmaptlist(R3((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyt
str_to_hex�scCsf|dkrdS|d}|d}|d}|d}|d}|d}|}d||||fS(Nitneveri<is%d days %02d:%02d:%02d((R3tsecstminsthrstdays((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pytduration_to_str�s





cCs�g}t|�tjkrBt|�tjkrBt|f�}nxI|D]A}||kro|j||�qI|jdt|�d�qIWdj|�S(Nsunknown(t)s, (ttypettypestListTypet	TupleTypeRAtappendtstrR-(tmtvalstslistti((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyt
map_to_str�s*
t
pgp_packetcBseZd�Zd�ZRS(cCs
d|_dS(N(tNonetpkt_typ(tself((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyt__init__�scCstt|j�S(N(RTtctb_pkt_to_strRW(RX((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyt__str__�s(RRRYR[(((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyRU�s	t
public_keycBs>eZd�Zd�Zd�Zd�Zd�Zd�ZRS(cCs5tj|�d|_d|_d|_d|_dS(Ni(RURYRVtversiontpk_algotkey_sizetfingerprint_(RX((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyRY�s

			cCs�|jr|jS|jdkrltjd�}|jt|j��|jt|j��|j�|_n�|jdkr�tjd�}|jd�|j	�}|jt
jdt|���|j|�|j�|_nt
d|j��|jS(NiRiRs�s>Hsunknown public key version %d(R`R]RRtupdateR0t
pk_rsa_modt
pk_rsa_exptdigestt	serializeRR,R1tRuntimeError(RXthtbuf((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pytfingerprint�s 	

cCsA|jdkr t|jd@�S|jdkr=|j�dSdS(Nil����ii����(R]R0RbRi(RX((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pytkey_id�scCs�g}|jdkrx|jtjd|jt|j�|j|j��|jt|j	��|jt|j
��nm|jdkr�|jtjd|jt|j�|j��|jtks�|jtkr|jt|j	��|jt|j
��q�|jt
krl|jt|j��|jt|j��|jt|j��|jt|j��q�|jtks�|jtkr�|jt|j��|jt|j��|jt|j��q�td|j��ndj|�S(Nis>BIHBis>BIBsunknown public key algorithm %dR*(R]RNRR,R(RtvalidityR^R5RbRctALGO_PK_RSA_ENC_OR_SIGNtALGO_PK_RSA_SIGN_ONLYtALGO_PK_DSAtpk_dsa_prime_ptpk_dsa_grp_ord_qtpk_dsa_grp_gen_gtpk_dsa_pub_keytALGO_PK_ELGAMAL_ENC_OR_SIGNtALGO_PK_ELGAMAL_ENC_ONLYtpk_elgamal_prime_ptpk_elgamal_grp_gen_gtpk_elgamal_pub_keyRfR-(RXtchunks((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyRe�s*4.cCsb|}t||d�\|_}|jdkrj|jdkrj|jdkrjtd|j|f��n|jdkr�d|_nt||d�\|_}t|j�|_|jdkr�t||d�\|_}nt||d�\|_}|jtks|jt	krQt
||�\|_|_}t
||�\|_}n
|jtkr�t
||�\}|_}t
||�\|_}t
||�\|_}t
||�\}|_}|||_n�|jtks�|jtkrEt
||�\|_|_}t
||�\|_}t
||�\|_}ntd|j|f��dS(Niiiis*unknown public key packet version %d at %ds%unknown public key algorithm %d at %d(R)R]RfR'RtfloatRkR^RlRmR:R_RbR;RcRnRoRpRqRrRsRtRuRvRw(RXR"R#tpkt_lentidx_savetl1tl2((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pytdeserialize�s2-cCs3tj�}|jtj|�d�|jdt|j�d�|jdtj|j	�d�|jdkr�|jdtj|j	|j
ddd�d�n|jdt|jd�|jt
ks�|jtkr$|jd	t|j�d�|jd
t|j�d�n|jtkr�|jdt|j�d�|jdt|j�d�|jd
t|j�d�|jdt|j�d�n{|jtks�|jtkr)|jdt|j�d�|jdt|j�d�|jdt|j�d�n|j�S(Ns
s	version: stimestamp: is
validity: ii<s
pubkey algo: spk_rsa_mod: spk_rsa_exp: spk_dsa_prime_p: spk_dsa_grp_ord_q: spk_dsa_grp_gen_g: spk_dsa_pub_key: spk_elgamal_prime_p: spk_elgamal_grp_gen_g: spk_elgamal_pub_key: (t	cStringIOtStringIOtwriteRUR[ROR]ttimetctimeRRktalgo_pk_to_strR^RlRmR<RbRcRnRoRpRqRrRsRtRuRvRwtgetvalue(RXtsio((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyR[s(!7!!!(RRRYRiRjReR~R[(((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyR\�s					tuser_idcBs#eZd�Zd�Zd�ZRS(cCstj|�d|_dS(N(RURYRVtid(RX((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyRYs
cCs||||!|_dS(N(R�(RXR"R#Rz((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyR~scCs tj|�dd|jdS(Ns
sid: (RUR[R�(RX((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyR[s(RRRYR~R[(((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyR�s		tuser_attributecBs#eZd�Zd�Zd�ZRS(cCs#tj|�d|_d|_dS(N(RURYRVtsub_typetdata(RX((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyRY#s
	cCs=t||d�\|_}|d}||||!|_dS(Ni(R)R�R�(RXR"R#Rz((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyR~(s
cCs3tj|�ddt|j�dt|j�S(Ns
s
sub_type: s
data: (RUR[ROR�RBR�(RX((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyR[-s(RRRYR~R[(((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyR�"s		t	signaturecBskeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�ZRS(cCs>tj|�d|_d|_d|_d|_d|_dS(N(RURYRVR]tsig_typeR^t	hash_algot	hash_frag(RX((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyRY1s
				cCsX|jdkr|jS|jt�}|r3|dS|jt�}|rP|dSdSdS(Nii(R]tkey_id_tget_hashed_subpaktSIG_SUB_TYPE_ISSUER_KEY_IDtget_unhashed_subpakRV(RXRS((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyRj9scCs1|jdkr|jS|jt�}|dSdS(Nii(R]RR�tSIG_SUB_TYPE_CREATE_TIME(RXRS((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyt
creation_timeEscCs?|jdkrtd��n|jt�}|r;|dSdS(Nis$v3 signatures don't have expirationsii(R]RR�tSIG_SUB_TYPE_KEY_EXPIRE(RXRS((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyt
expirationLscCs,x%|jD]}|d|kr
|Sq
WdS(Ni(thashed_subpaksRV(RXttypRS((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyR�TscCs,x%|jD]}|d|kr
|Sq
WdS(Ni(tunhashed_subpaksRV(RXR�RS((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyR�Zsc&Cs|t||�\}}t||d�\}}|tkrgt||d�\}}|t|�f|fS|tks|tkr�t||d�\}}||f|fS|tks�|tkr�t||d�\}}||f|fS|t	kr6t||d�\}}t||d�\}	}|||	f|fS|t
kru||||d!}
||d}||
f|fS|tks�|tks�|t
ks�|tkr�td�t||||d!��}||d}||f|fS|tkrWt||d�\}}t||d�\}
}|||d!}|d}|||
|f|fS|tkr�|||d!}|d}||f|fS|tkrt||d�\}}t||d�\}}t||d�\}}t||d�\}}t||d�\}}t||d�\}}||||!}||}||||!}||}|||||||f|fS|tkr�g||||d!D]}t|�^q�}||d}||f|fS|tkr||||d!}||d}||f|fS|tkrJt||d�\}}||f|fS|tkr�||||d!}||d}||f|fS|tkr�||||d!}||d}||f|fS|tkr$t||d�\}}|d}||||!}||}|||f|fS|tkr�|d}|g} x?|dkr�t||d�\}!}| j|!�|d}qFWt| �|fS|tkr
t||d�\}"}t||d�\}#}||||d!}$||d}||"|#|$f|fS|tkrI||||d!}%||d}||%f|fS||||d!}%||d}||%f|fS(	NiicSs
t|�S(N(R2(R>((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyR?usiiiii( R8R)R�R'RytSIG_SUB_TYPE_EXPIRE_TIMER�tSIG_SUB_TYPE_EXPORT_CERTtSIG_SUB_TYPE_REVOCABLEtSIG_SUB_TYPE_TRUST_SIGtSIG_SUB_TYPE_REGEXPtSIG_SUB_TYPE_PREF_SYMM_ALGOtSIG_SUB_TYPE_PREF_HASH_ALGOtSIG_SUB_TYPE_PREF_COMP_ALGOtSIG_SUB_TYPE_KEY_FLAGSR@RAtSIG_SUB_TYPE_REVOKE_KEYR�tSIG_SUB_TYPE_NOTATIONtSIG_SUB_TYPE_KEY_SRV_PREFR2tSIG_SUB_TYPE_PREF_KEY_SRVRtSIG_SUB_TYPE_PRIM_USER_IDtSIG_SUB_TYPE_POLICY_URItSIG_SUB_TYPE_SGNR_USER_IDtSIG_SUB_TYPE_REVOKE_REASONtSIG_SUB_TYPE_FEATURESRNttupletSIG_SUB_TYPE_SIG_TARGETtSIG_SUB_TYPE_EMBEDDED_SIG(&RXR"R#tsublentsubtypettmR3tboolt	trust_lvlt	trust_amttexprt	algo_listtclsRtfprinttk_idtflg1tflg2tflg3tflg4tname_lentval_lentnamtvalR>tprefsturlturit	signer_idtrev_codetreas_lentreasR.tocttpublic_key_algoR�thashtdat((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pytdeserialize_subpacket`s�0'



.


	
cCs0x)|jD]}|dtkr
|dSq
WdS(spis_primary_user_id()
        returns true if this signature contains a primary user id subpacket with value trueii(R�R�(RXRS((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pytis_primary_user_id�sc
Cs|dtkr%dtj|d�S|dtkrGdt|d�S|dtkrl|dredSdSn|dtkr�|ddkr�dS|ddkr�d|d	S|dd	kr�d
|d	Sd|d|d	fS|dtkr�d|dS|dtkr|drd
SdSn|dt	krAdt|d�S|dt
krfdtt|d�S|dt
kr�d}|dt@r�|d}n|tt|d	�dt|d�S|dtkr�dt|d�S|dtkr�d|dS|dtkr!dtt|d�S|dtkrFdtt|d�S|dtkr�d}g}|ddd@r�|jd�n|dj|�S|dtkr�d|dS|dtkr�|dr�dSdSn|dtkr�d |dS|dtkr�g}d}t|d�dkr5|dd}n|t@rO|jd!�n|t @ri|jd"�n|t!@r�|jd#�n|t"@r�|jd$�n|t#@r�|jd%�n|t$@r�|jd&�nd'dj|�S|dt%kr�d(|dS|dt&kr6t'j(|dd)�}d*||d	fS|dt)krg}t|�dkr�|d}|t*@r�|jd+�n|t*@}|dkr�|jd,|�q�nx<t+d	t|��D]%}	|jd-|	d||	f�q�Wd.dj|�Sd/|dt|d�fS(0Niscreation time: issignature expires: ssignature exportable: TRUEssignature exportable: FALSEstrust: ordinarystrust: introducer (%d)istrust: meta-introducer (%d)strust: %d %dsregexp: ssignature revocable: TRUEssignature revocable: FALSEs
key expires: s preferred symmetric algorithms: srevocation key: s(sensitive) t isissuer key id: s2notation: flags(%d, %d, %d, %d) name(%s) value(%s)spreferred hash algorithms: s"preferred compression algorithms: skey server preferences: i�s	No-modifys, spreferred key server: %ssis primary user idsis not primary user idspolicy url: %ssmay certify other keyss
may sign datasmay encrypt communicationssmay encrypt storages4private component may have been secret-sharing splits	group keyskey flags: ssigner id: R*sreason for revocation: %s, %ssModification Detections[0]=0x%xs	[%d]=0x%xs
features: sunknown(%d): %s(,R�R�R�R�RHR�R�R�R�R�R�RTtalgo_sk_to_strR�tREVOKE_KEY_CLASS_SENSR�RBR�R�R�talgo_hash_to_strR�talgo_comp_to_strR�RNR-R�R�R�R�R1tKEY_FLAGS1_MAY_CERTIFYtKEY_FLAGS1_MAY_SIGNtKEY_FLAGS1_MAY_ENC_COMMtKEY_FLAGS1_MAY_ENC_STRGtKEY_FLAGS1_PRIV_MAYBE_SPLITtKEY_FLAGS1_GROUPR�R�trevoke_reason_to_strtgetR�tPGP_FEATURE_1_MOD_DETECTtrange(
RXtspR3R�tflagstflgs1R�RR�RS((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pytsubpacket_to_str�s�


'








#cCs�t||d�\|_}|jdkr6d|_n|jdkr�t||d�\}}t||d�\|_}t||d�\|_}t|j�|_|||d!|_|d}t||d�\|_}t||d�\|_}nH|jdkr+t||d�\|_}t||d�\|_}t||d�\|_}t||d�\}}||}g|_	x8||kr�|j
||�\}}|j	j|�q�Wt||d�\}}||}g|_xT||kr'|j
||�\}}|jj|�q�Wnt
d|j|f��t||d�\|_}|jtks}|jtkr�t||�\|_}n[|jtkr�t||�\|_}t||�\|_}nt
d|j|f��|S(Niiiiis)unknown signature packet version %d at %ds4unknown public-key algorithm (%d) in signature at %d(R)R]R'R�RRyR�R^R�R�R�RNR�RfR�RlRmR;trsa_sigRnt	dsa_sig_rt	dsa_sig_s(RXR"R#Rzthash_lentsub_paks_lentsub_paks_endR�((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyR~'sJ

	
	cCs,tj�}|jtj|�d�|jdt|j�d�|jdt|jd�|jdkr�|jdt	j
|j�d�|jdt|j
�d�n�|jdkrA|jd�x/|jD]$}|jd	|j|�d�q�W|jd
�x2|jD]$}|jd	|j|�d�qWn|jdt|jd�|jdt|j�d�|jtks�|jtkr�|jd
�|jdt|j�d�n[|jtkr"|jd�|jdt|j�d�|jdt|j�d�n|j�S(Ns
s	version: stype: istimestamp: skey_id: ishashed subpackets:
s    sunhashed subpackets:
shash_algo: shash_frag: s
pk_algo: RSA
s	rsa_sig: s
pk_algo: DSA
sdsa_sig_r: sdsa_sig_s: (RR�R�RUR[ROR]tsig_type_to_strR�R�R�RRBR�R�R�R�R�R�R<R�R^RlRmR�RnR�R�R�(RXR�RS((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyR[Ps0!!
"
%
!
!(
RRRYRjR�R�R�R�R�R�R�R~R[(((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyR�0s							`		_	)tpgp_certificatecBsJeZd�Zd�Zd�Zee�Zd�Zd�Zd�Z	RS(cCs1d|_d|_g|_g|_d|_dS(Ni����(RVR]R\trevocationstuser_idstprimary_user_id(RX((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyRYps
				cCsAtj�}|jd|j�|jdt|jj���|jd|j�|jt|j��xT|j	D]I}|jt|d��x)|dD]}|jdt|��q�WqtWt
|d�r7xd|jD]V}|jd�|jt|d��x)|dD]}|jdt|��qWq�Wn|j�S(	NsPGP Public Key Certificate v%d
sCert ID: %s
sPrimary ID: %s
iis   t
user_attrsR�(
RR�R�R]RBR\RjR�ROR�thasattrR�R�(RXR�tuidtsigtuattr((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyR[ws  
"cCs|j|jdjS(Ni(R�R�R�(RX((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pytget_user_id�scCs�|jdkrE|jjdkr%dS|jj|jjdddS|jd}xK|dD]?}|jtkr]|j�}|dkr�dS|jj|Sq]WdSdS(Niiii<i(R]R\RkRR�R�tSIG_TYPE_PK_USER_GENR�(RXtu_idRStexp((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyR��s 
cCsdS(Ni((RX((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyR_�scCs5|djtkr6tdtt|dj���n|d|_|jj|_|jdkr8d}x�||jtkr||jdkr�td||j��n||jt	kr�tdtt
||j���n|jj||�|d}qjWx�|t
|�kr4||jtkrlt
|j�dkrhtd|tt||j�f��qlPn||g}|d}d}d}x�|t
|�kr ||jtkr ||jtttttfkrtd|tt
||j�f��n|j||�|d}q�W|jj|�qWn�d}g|_g|_g|_g|_|jj�}x�|t
|�krG||jtkrG||jd	kr�td
||j��n||jt	kr�|jj||�nJ||jtkr|jj||�n tdtt
||j���|d}qtWd}x�|t
|�kr�||jtkr�||g}d}d}|d}x�|t
|�kr�||jtkr�||jtttttfkrtd|tt
||j�f��n|j||�||j�|kr�||j�r�||j�}||kr}t
|j�|_|}q}q�n|d}q�W|jj|�qQ||jtkrv||g}	d}|d}x�|t
|�krb||jtkrb||jtttttfkrDtd|tt
||j�f��n|	j||�|d}q�W|jj|	�qQ||jtkr�||g}
|d}d}|t
|�kr||jtkr||jt krd}|
j||�|d}n|t
|�kr+td
|d��n||jtksQ||jt!krztd|tt
||j�f��n|
j||�|d}|r�|jj|
�q�|jj|
�qQ||jtkr�|jj||�|d}qQPqQWt
|j�dkr1tdt"|jj����n|S(s�load(pkts)
Initialize the pgp_certificate with a list of OpenPGP packets. The list of packets will
be scanned to make sure they are valid for a pgp certificate.is6first PGP packet should be a public-key packet, not %siis'version 3 cert has version %d signatures"v3 cert revocation sig has type %ss#pgp packet %d is not user id, is %ss/signature %d doesn't bind user_id to key, is %sis'version 4 cert has version %d signaturesZv4 cert signature has type %s, supposed to be revocation signature or direct key signatures1signature %d doesn't bind user_attr to key, is %ss2subkey at index %d was not followed by a signatures3signature %d doesn't bind subkey to key, type is %ss,no user id packet was present in the cert %s(#RWtCTB_PKT_PK_CERTRRTRZR\R]tCTB_PKT_SIGR�tSIG_TYPE_KEY_REVOKER�R�RNR1tCTB_PKT_USER_IDR�R�tSIG_TYPE_PK_USER_PERtSIG_TYPE_PK_USER_CAStSIG_TYPE_PK_USER_POStSIG_TYPE_CERT_REVOKEtdirect_key_sigstsubkeystrvkd_subkeysR�RjtSIG_TYPE_KEYR�R�R�tCTB_PKT_USER_ATTRtCTB_PKT_PK_SUBtSIG_TYPE_SUBKEY_REVOKEtSIG_TYPE_SUBKEY_BINDRB(RXtpktstpkt_idxR�t
is_revokedR�tcert_idtprim_user_id_sig_timetctt	user_attrtsubkey((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pytload�s�#
#)

(")				( 

(")

(")

8
&)

"(
RRRYR[R�tpropertyR�R�R_R(((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyR�os					cCs�t||d�\}}|t@tkr�d}|t@tkrGd}n|t@tkr`d}n|t@tkryd}n|t@tkr�d}nd}|dkr�t|||�\}}n|t@d?||fS|t@t	kr�t||d�\}}|dkr|t
@||fS|dkr^t||d�\}}|t
@|dd>|d|fS|dkr�t||d�\}}|t
@||fStd	|�ntd
||f�dS(sget_ctb(msg, idx)
extracts a the "cypher type bit" information from message msg at index idx
returns (type, len, new_idx) where type is the enumerated type of the packet,
len is the length of the packet, and new_idx is the index of the next element
in the messageiiiii�i�ii�s=partial message bodies are not supported by this version (%d)s4unknown (not "normal") cypher type bit %d at byte %dN(R)tCTB_76_MASKt
CTB_76_NORMALtCTB_PKT_LEN_MASKt
CTB_PKT_LEN_1t
CTB_PKT_LEN_2t
CTB_PKT_LEN_4tCTB_PKT_LEN_UNDEFtCTB_PKTV2_MASKt
CTB_76_NEWtCTB_PKT_MASKt	Exception(R"R#R&tn_lenRzR6R7((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pytget_ctb^s6				!cCs�d}d}|}xct|�D]U}|t|�d>A}x8tdd�D]'}|d>}|d@rI||A}qIqIWqW|d@S(	Ni��i�L�iiiiii���(RAR2R�(R"t
crc24_initt
crc24_polytcrcRStj((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pytcrc24�s

cCs4g}d}t|�}x||kr/t||�\}}}d}|tks]|tkrit�}nH|tkr�t�}n0|tkr�t	�}n|t
kr�t�}n|r�||_|j
|||�trtj|j�d�qntdtt|�|f��|j|�||}qW|S(Nis
s#unexpected pgp packet type %s at %d(R1RRVR�RR\R�R�R�R�RR�RWR~tdebugR�R[RRTRZRN(R"tpkt_listR#tmsg_lenRWRztpkt((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pytdecode�s.	
cCs�td�|jd��}d}d}tj�}xl|D]d}|sa|dkr:d}q:q:n|s�t|�dkr:d}q:q:n|r�|ddkr�tj|dd!�}d}t||d�\}}tj|j��}	|j	�|t
|	�krtd	�nt|	�}
g}xQt|
�dkrtt
�}||_|j|
�}
|j|�g|
d|
+q$W|s�|s�d
S|dS|S|j|�q:W|s�d
SgS(s�decode_msg(msg) ==> list of OpenPGP "packet" objects
Takes an ascii-armored PGP block and returns a list of objects each of which
corresponds to a PGP "packets".

A PGP message is a series of packets. You need to understand how packets are
to be combined together in order to know what to do with them. For example
a PGP "certificate" includes a public key, user id(s), and signature. 
cSs
|j�S(N(trstrip(R>((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyR?�ss
is$-----BEGIN PGP PUBLIC KEY BLOCK-----it=iisbad checksum on pgp messageN(R@tsplitRR�R1tbase64tdecodestringR'R�tcloseR"RR'R�traw_keyRRNRVR�(R"tmultitpgpkey_linestin_blocktin_datat	block_bufR.tcsumRStcert_msgR$t	cert_listtcertR((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyt
decode_msg�sL
		
		
cCs�g}td�|jd��}d}d}x�|D]�}|si|dkrid}|d|7}q4qin|d|7}|dkr4d}t|d	t�}|r�|j|�nd}q4q4q4W|S(
NcSs
|j�S(N(R((R>((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyR?�ss
iR*s$-----BEGIN PGP PUBLIC KEY BLOCK-----is%s
s"-----END PGP PUBLIC KEY BLOCK-----R/(R@R*R8tTruetextend(R"tcertsR0R1tblockR.t
thesecerts((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pytdecode_multiple_keys�s&
	
t__main__(�RR�RR+RKRtImportErrorRRRVR#RRRRRtCTB_PKT_PK_ENCR�tCTB_PKT_SK_ENCtCTB_PKT_OP_SIGtCTB_PKT_SK_CERTR�tCTB_PKT_SK_SUBtCTB_PKT_COMPRESSEDtCTB_PKT_ENCtCTB_PKT_MARKERtCTB_PKT_LITt
CTB_PKT_TRUSTR�RRtCTB_PKT_SYM_ENC_INTtCTB_PKT_MOD_DETECTRZRRRRRRltALGO_PK_RSA_ENC_ONLYRmRtRntALGO_PK_ELLIPTIC_CURVEt
ALGO_PK_ECDSARst
ALGO_PK_DHR�t
ALGO_SK_PLAINtALGO_SK_IDEAtALGO_SK_3DESt
ALGO_SK_CAST5tALGO_SK_BLOWFISHtALGO_SK_SAFER_SK128tALGO_SK_DES_SKtALGO_SK_AES_128tALGO_SK_AES_192tALGO_SK_AES_256tALGO_SK_TWOFISH_256R�tALGO_COMP_UNCOMPt
ALGO_COMP_ZIPtALGO_COMP_ZLIBtALGO_COMP_BZIP2R�t
ALGO_HASH_MD5tALGO_HASH_SHA1tALGO_HASH_RIPEMD160tALGO_HASH_SHA_DBLt
ALGO_HASH_MD2tALGO_HASH_TIGER192tALGO_HASH_HAVAL_5_160tALGO_HASH_SHA256tALGO_HASH_SHA384tALGO_HASH_SHA512tALGO_HASH_SHA224R�tSIG_TYPE_DOCUMENTtSIG_TYPE_DOCUMENT_CANONtSIG_TYPE_STANDALONER�R�R�R�RRR�RR�tSIG_TYPE_TIMESTAMPR�R�R�R�R�R�R�R�tSIG_SUB_TYPE_PLACEHOLDERR�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�tsig_sub_type_to_strtREVOKE_REASON_NONEtREVOKE_REASON_SUPERtREVOKE_REASON_COMPRtREVOKE_REASON_NOT_USEDtREVOKE_REASON_ID_INVALIDR�R�R�R�R�R�R�tREVOKE_KEY_CLASS_MANDR�R�tpgp_feature_to_strR'R)R0R5R8R:R;RBRHRTtobjectRUR\R�R�R�R�RR"R'tFalseR8R>Rtsystopentargvtreadtpgp_cert(((s./usr/lib/python2.7/site-packages/yum/pgpmsg.pyt<module>s�<











	
											r�@�	$	
	"D	&

Zerion Mini Shell 1.0