%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/self/root/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/
Upload File :
Create Path :
Current File : //proc/self/root/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/der.pyo

�
�ac@ s;ddlmZddlZddlZddlZddlmZddlmZm	Z	m
Z
ddlmZde
fd��YZd	�Zd
�Ze�Zed�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zed�Z d�Z!d�Z"dS(i����(tdivisionN(tchain(tint2bytetbt	text_typei(tstr_idx_as_intt
UnexpectedDERcB seZRS((t__name__t
__module__(((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/der.pyRscC s"td|�tt|��|S(Ni�(Rt
encode_lengthtlen(ttagtvalue((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/der.pytencode_constructedscC s�d|j�}t|�dr3td�|}ntj|�}t|d�}|dkr{td�tt|��|Std�tt|�d�td�|SdS(	Ns%xit0iisis(tencodeR
Rtbinasciit	unhexlifyRR	(trthtstnum((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/der.pytencode_integerscC s�d}d}|tkr+tjdt�n�|dk	r�d|koNdknsbtd��n|r�|s}td��nt|d�}|d|d	@r�td
��q�nt|�}d	}ntd�t	t
|�|�||S(Ntis:Legacy call convention used, unused= needs to be specifiedis&unused must be integer between 0 and 7s!unused is non-zero but s is emptyi����iis unused bits must be zeros in DERs(t_sentrytwarningstwarntDeprecationWarningtNonet
ValueErrorRRRR	R
(Rtunusedtencoded_unusedt	len_extratlast((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/der.pytencode_bitstring(s"$	
	cC std�tt|��|S(Ns(RR	R
(R((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/der.pytencode_octet_string`scG sKdjttd||�gd�|D���}dtt|��|S(NRi(cs s|]}t|�VqdS(N(t
encode_number(t.0tp((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/der.pys	<genexpr>gss(tjoinRR$R	R
(tfirsttsecondtpiecestbody((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/der.pyt
encode_oiddscG sLtg|D]}t|�^q
�}td�t|�td�j|�S(NRR(tsumR
RR	R'(tencoded_piecesR&t	total_len((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/der.pytencode_sequenceks%cC s�g}x,|r4|jd|d@dB�|d?}q	W|sK|jd�n|dcdM<td�jg|D]}t|�^qn�S(Niii�ii����R(tinserttappendRR'R(tntb128_digitstd((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/der.pyR$ps	cC s�t|d�}|d@dkr2td|��n|d@}t|d�\}}|d|d||!}|d||}|||fS(Nii�i�s5wanted type 'constructed tag' (0xa0-0xbf), got 0x%02xii(RRtread_length(tstringts0RtlengthtllenR+trest((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/der.pytremove_constructed{s

cC s�|std��n|d dkrGt|d�}td|��nt|d�\}}|t|�d|kr�td��nd||}|d||!||fS(Ns'Empty string does not encode a sequenceiRis)wanted type 'sequence' (0x30), got 0x%02xs&Length longer than the provided buffer(RRR6R
(R7R3R9tlengthlengthtendseq((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/der.pytremove_sequence�scC s}|d dkr2t|d�}td|��nt|d�\}}|d|d||!}|d||}||fS(Nisis,wanted type 'octetstring' (0x04), got 0x%02x(RRR6(R7R3R9R:R+R;((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/der.pytremove_octet_string�scC sf|std��n|d dkrGt|d�}td|��nt|d�\}}|d|d||!}|d||}|s�td��nt|�|kr�td��ng}x3|r�t|�\}}|j|�||}q�W|jd�}|dkr"|d	}	nd
}	|d	|	}
|jd|	�|jd|
�t|�|fS(Ns1Empty string does not encode an object identifierisis'wanted type 'object' (0x06), got 0x%02xsEmpty object identifiers;Length of object identifier longer than the provided bufferiPi(i(	RRR6R
tread_numberR2tpopR1ttuple(R7R3R9R=R+R;tnumberstlltn0R(R)((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/der.pyt
remove_object�s6	

cC sR|std��n|d dkrGt|d�}td|��nt|d�\}}|t|�d|kr�td��n|dkr�td��n|d|d||!}|d||}t|d�}|dks�td	��n|dkr6|r6t|d�}|dkr6td
��q6nttj|�d�|fS(Ns1Empty string is an invalid encoding of an integerisis(wanted type 'integer' (0x02), got 0x%02xs"Length longer than provided buffers0-byte long encoding of integeri�s#Negative integers are not supporteds;Invalid encoding of integer, unnecessary zero padding bytesi(RRR6R
tintRthexlify(R7R3R9R:tnumberbytesR;tmsbtsmsb((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/der.pytremove_integer�s(cC s�d}d}t|d�dkr0td��nxjtr�|t|�krZtd��n|d>}t||�}||d@7}|d7}|d@s3Pq3q3W||fS(Nii�s)Non minimal encoding of OID subidentifiersran out of length bytesiii(RRtTrueR
(R7tnumberR:R5((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/der.pyRA�s	


cC sv|dkrt|�Sd|j�}t|�drItd�|}ntj|�}t|�}td|B�|S(Ni�s%xiR(RRR
RRR(tlRR:((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/der.pyR	�s
cC s�|std��nt|d�}|d@s<|d@dfS|d@}|s[td��n|t|�dkr�td��nt|d�}|s�|dkr�|dkr�td��nttj|dd|!�d	�d|fS(
Ns,Empty string can't encode valid length valueii�iis.Invalid length encoding, length of length is 0s,Length of length longer than provided buffersNot minimal encoding of lengthi(RRR
RHRRI(R7RR:RK((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/der.pyR6�s

c	C s�|std��n|tkr4tjdt�nt|d�}|d dkrftd|��nt|d�\}}|s�td��n|d|d||!}|d||}|tk	r�t|d�}d|ko�dknstd	��n|dk	r)||kr)td
��n|d}|r�|sNtd��nt|d�}|d
|d@r�td��q�n|dkr�||f}q�n||fS(Ns(Empty string does not encode a bitstringsALegacy call convention used, expect_unused= needs to be specifiediiss#wanted bitstring (0x03), got 0x%02xs(Invalid length of bit string, can't be 0isInvalid encoding of unused bitss Unexpected number of unused bitss$Invalid encoding of empty bit stringi����is#Non zero padding bits in bit string(RRRRRRR6R(	R7t
expect_unusedRR9R:R+R;RR!((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/der.pytremove_bitstring
s:'	

cC s�t|t�r|j�}ntd�jg|jtd��D].}|r@|jtd��r@|j�^q@�}tj	|�S(NRs
s-----(
t
isinstanceRRRR'tsplitt
startswithtstriptbase64t	b64decode(tpemRPR5((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/der.pytunpemqs
(1cC s�tj|�}d|j�g}|jgtdt|�d�D]!}|||d!td�^qA�|jd|j��td�j|�S(Ns-----BEGIN %s-----
ii@s
s-----END %s-----
R(	RWt	b64encodeRtextendtrangeR
RR2R'(tdertnametb64tlineststart((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/der.pyttopemzs	>(#t
__future__RRRWRt	itertoolsRtsixRRRt_compatRt	ExceptionRR
RtobjectRR"R#R,R0R$R<R?R@RGRMRAR	R6RRRZRc(((s>/opt/plesk/python/2.7/lib/python2.7/site-packages/ecdsa/der.pyt<module>s4			8						
	
					d		

Zerion Mini Shell 1.0