403Webshell
Server IP : 61.19.30.66  /  Your IP : 216.73.216.15
Web Server : Apache/2.2.22 (Ubuntu)
System : Linux klw 3.11.0-15-generic #25~precise1-Ubuntu SMP Thu Jan 30 17:39:31 UTC 2014 x86_64
User : www-data ( 33)
PHP Version : 5.3.10-1ubuntu3.48
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : ON  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/lib/python2.7/dist-packages/OpenSSL/test/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyc
ó
¼T@Rc@sdZddlmZddlZddlZddlmZmZddlmZm	Z	ddl
mZmZm
Z
mZmZddl
mZmZmZmZddl
mZmZdd	l
mZmZdd
l
mZmZddl
mZmZmZddl
mZmZdd
l
mZm Z ddl
m!Z!m"Z"ddl
m#Z#m$Z$m%Z%ddl
m&Z&m'Z'm(Z(ddl
m)Z)m*Z*ddl
m+Z+m,Z,ddl-m.Z.m/Z/m0Z0d„Z1d„Z2e0dƒZ3e0dƒZ4e0dƒZ5e2e0dƒƒZ6e0dƒZ7e2e0dƒƒZ8e0dƒZ9e2e0dƒƒZ:e0dƒZ;e0dƒZ<e0dƒZ=e0dƒZ>e0d ƒZ?e0d!ƒZ@d"e.fd#„ƒYZAd$e.fd%„ƒYZBd&e.fd'„ƒYZCd(fd)„ƒYZDd*e.eDfd+„ƒYZEd,e.eDfd-„ƒYZFd.e.fd/„ƒYZGejHd0ƒZIejHd1ƒZJd2„ZKd3„ZLd4„ZMd5e.fd6„ƒYZNd7e.fd8„ƒYZOd9e.eDfd:„ƒYZPd;e.fd<„ƒYZQd=e.fd>„ƒYZRd?e.fd@„ƒYZSeTdAkreƒndS(Bs#
Unit tests for L{OpenSSL.crypto}.
iÿÿÿÿ(tmainN(tPIPEtPopen(tdatetimet	timedelta(tTYPE_RSAtTYPE_DSAtErrortPKeytPKeyType(tX509tX509TypetX509NametX509NameType(tX509ReqtX509ReqType(t
X509ExtensiontX509ExtensionType(tload_certificatetload_privatekey(tFILETYPE_PEMt
FILETYPE_ASN1t
FILETYPE_TEXT(tdump_certificatetload_certificate_request(tdump_certificate_requesttdump_privatekey(t	PKCS7Typetload_pkcs7_data(tPKCS12t
PKCS12Typetload_pkcs12(tCRLtRevokedtload_crl(tNetscapeSPKItNetscapeSPKIType(tsigntverify(tTestCasetbytestbcCstttt|ƒƒS(N(RRR(tpem((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pytnormalize_certificate_pemscCstttt|ƒƒS(N(RRR(R*((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pytnormalize_privatekey_pem!ss2-----BEGIN CERTIFICATE-----
MIIC7TCCAlagAwIBAgIIPQzE4MbeufQwDQYJKoZIhvcNAQEFBQAwWDELMAkGA1UE
BhMCVVMxCzAJBgNVBAgTAklMMRAwDgYDVQQHEwdDaGljYWdvMRAwDgYDVQQKEwdU
ZXN0aW5nMRgwFgYDVQQDEw9UZXN0aW5nIFJvb3QgQ0EwIhgPMjAwOTAzMjUxMjM2
NThaGA8yMDE3MDYxMTEyMzY1OFowWDELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAklM
MRAwDgYDVQQHEwdDaGljYWdvMRAwDgYDVQQKEwdUZXN0aW5nMRgwFgYDVQQDEw9U
ZXN0aW5nIFJvb3QgQ0EwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAPmaQumL
urpE527uSEHdL1pqcDRmWzu+98Y6YHz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CWJJqRStVRHM1koZlJmXNx2BX4vPo6iW
RFEIPQsFZRLrtnCAiEhyT8bC2s/Njlu6ly9gtJZWSV46Q3ZjBL4q9sHKqZQ=
-----END CERTIFICATE-----tX509ExtTestscBs§eZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„Zd
„Zd„Z
d„Zd
„Zd„Zd„Zd„Zd„ZRS(s4
    Tests for L{OpenSSL.crypto.X509Extension}.
    cCstƒ|_|jjtdƒtƒ|_|jj|jƒd|jjƒ_t	ƒ|_
|j
jƒ|_|jjƒj|j_|j
j|jƒ|j
j|jƒt
tjƒjdƒƒ}t
tjƒtddƒjdƒƒ}|j
j|ƒ|j
j|ƒdS(s‡
        Create a new private key and start a certificate request (for a test
        method to finish in one way or another).
        i€sYoda root CAs
%Y%m%d%H%M%SZtdaysidN(Rtpkeytgenerate_keyRRtreqt
set_pubkeytget_subjectt
commonNameR
tx509tsubjectt
set_issuerR)RtnowtstrftimeRt
set_notBeforetset_notAfter(tselfR9texpire((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pytsetUp"s(cCs2|jtttdƒttdƒƒƒdƒdS(sw
        The string representation of L{X509Extension} instances as returned by
        C{str} includes stuff.
        tbasicConstraintssCA:falsesCA:FALSEN(tassertEqualststrRR)tTrue(R=((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_str9s!cCs9|jttƒ|jtdtdƒttdƒƒdS(s“
        L{X509Extension} and L{X509ExtensionType} refer to the same type object
        and can be used to create instances of that type.
        RR@sCA:trueN(tassertIdenticalRRtassertConsistentTypeR)RC(R=((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyt	test_typeEscCs˜ttdƒttdƒƒ}|jt|tƒd|t|ƒtfƒttdƒttdƒƒ}|jt|tƒd|t|ƒtfƒdS(s 
        L{X509Extension} accepts an extension type name, a critical flag,
        and an extension value and returns an L{X509ExtensionType} instance.
        R@sCA:trues%r is of type %r, should be %rt	nsCommentspyOpenSSL unit testN(RR)RCt
assertTruet
isinstanceRttypetFalse(R=tbasictcomment((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_constructionPscCss|jtttdƒttdƒƒ|jtttdƒttdƒƒ|jtttdƒttdƒƒdS(sj
        L{X509Extension} raises something if it is passed a bad extension
        name or value.
        tthisIsMadeUpthiR@s	blah blaht
proxyCertInfos4language:id-ppl-anyLanguage,pathlen:1,policy:text:ABN(tassertRaisesRRR)RLRC(R=((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_invalid_extensioncscCsfttdƒttdƒƒ}|j|jƒƒttdƒttdƒƒ}|j|jƒƒdS(so
        L{X509ExtensionType.get_critical} returns the value of the
        extension's critical flag.
        R@sCA:trueN(RR)RCRItget_criticalRLtassertFalse(R=text((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_get_criticalvscCsxttdƒttdƒƒ}|j|jƒtdƒƒttdƒttdƒƒ}|j|jƒtdƒƒdS(s{
        L{X509ExtensionType.get_short_name} returns a string giving the short
        type name of the extension.
        R@sCA:trueRHsfoo barN(RR)RCtassertEqualtget_short_name(R=RW((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_get_short_namescCs>ttdƒttdƒƒ}|j|jƒtdƒƒdS(sf
        L{X509Extension.get_data} returns a string giving the data of the
        extension.
        R@sCA:trues0ÿN(RR)RCRYtget_data(R=RW((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyt
test_get_dataŒscCsdttdƒttdƒƒ}|jt|jdƒ|jt|jdƒ|jt|jdƒdS(sX
        L{X509Extension.get_data} raises L{TypeError} if passed any arguments.
        R@sCA:truetfooiN(RR)RCRSt	TypeErrorR\tNone(R=RW((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_get_data_wrong_args–scCs˜ttdƒttdƒd|jƒ}|jj|gƒ|jj|jdƒtt|jƒ}|j	tdƒ|kƒ|j	tdƒ|kƒdS(sš
        The C{subject} parameter to L{X509Extension} may be provided for an
        extension which does not use it and is ignored in this case.
        R@sCA:TRUER7tsha1sX509v3 Basic Constraints:N(
RR)RLR6tadd_extensionsR%R0RRRI(R=text1ttext((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_unused_subject s$cCsttdƒttdƒd|jƒ}|jj|gƒ|jj|jdƒtt|jƒ}|j	tdƒ|kƒdS(s~
        If an extension requires a subject, the C{subject} parameter to
        L{X509Extension} provides its value.
        tsubjectKeyIdentifierthashR7RbsX509v3 Subject Key Identifier:N(
RR)RLR6RcR%R0RRRI(R=text3Re((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_subject¯s$cCs)|jtttdƒttdƒƒdS(s
        If an extension requires a subject and the C{subject} parameter is
        given no value, something happens.
        RgRhN(RSRRR)RL(R=((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_missing_subject¼sc	CsFx?ttƒdg|gD]%}|jttdtdd|ƒqWdS(s€
        If the C{subject} parameter is given a value which is not an L{X509}
        instance, L{TypeError} is raised.
        thelloR@sCA:TRUER7N(RCtobjectRSR_RRL(R=tbadObj((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_invalid_subjectÅs
cCs˜ttdƒttdƒd|jƒ}|jj|gƒ|jj|jdƒtt|jƒ}|j	tdƒ|kƒ|j	tdƒ|kƒdS(s™
        The C{issuer} parameter to L{X509Extension} may be provided for an
        extension which does not use it and is ignored in this case.
        R@sCA:TRUEtissuerRbsX509v3 Basic Constraints:N(
RR)RLR6RcR%R0RRRI(R=RdRe((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_unused_issuerÑs$cCs˜ttdƒttdƒd|jƒ}|jj|gƒ|jj|jdƒtt|jƒ}|j	tdƒ|kƒ|j	tdƒ|kƒdS(s|
        If an extension requires a issuer, the C{issuer} parameter to
        L{X509Extension} provides its value.
        tauthorityKeyIdentifiers
issuer:alwaysRpRbs X509v3 Authority Key Identifier:sDirName:/CN=Yoda root CAN(
RR)RLR6RcR%R0RRRI(R=text2Re((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_issuerßscCs)|jtttdƒttdƒƒdS(s}
        If an extension requires an issue and the C{issuer} parameter is given
        no value, something happens.
        Rrskeyid:always,issuer:alwaysN(RSRRR)RL(R=((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_missing_issuerîs
c	CsFx?ttƒdg|gD]%}|jttdtdd|ƒqWdS(s
        If the C{issuer} parameter is given a value which is not an L{X509}
        instance, L{TypeError} is raised.
        RlRrskeyid:always,issuer:alwaysRpN(RCRmRSR_RRL(R=Rn((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_invalid_issuerús(t__name__t
__module__t__doc__R?RDRGRORTRXR[R]RaRfRjRkRoRqRtRuRv(((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyR.s$								
	
		
						t	PKeyTestscBsMeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z	RS(s0
    Unit tests for L{OpenSSL.crypto.PKey}.
    cCs$|jttƒ|jtdƒdS(s
        L{PKey} and L{PKeyType} refer to the same type object and can be used
        to create instances of that type.
        RN(RERR	RF(R=((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyRGscCsL|jttdƒtƒ}|jt|tƒd|t|ƒtfƒdS(sP
        L{PKey} takes no arguments and returns a new L{PKey} instance.
        s%r is of type %r, should be %rN(RSR_RR`RIRJR	RK(R=tkey((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyROs
	cCs9tƒ}|j|jƒdƒ|j|jƒdƒdS(sh
        L{PKeyType.bits} and L{PKeyType.type} return C{0} before the key is
        generated.
        iN(RRYRKtbits(R=R{((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_pregeneration s	cCs tƒ}|jt|jƒ|jt|jdddƒ|jt|jddƒ|jt|jddƒ|jt|jtdƒ|jt|jtdƒdS(	ss
        L{PKeyType.generate_key} takes two arguments, the first giving the key
        type as one of L{TYPE_RSA} or L{TYPE_DSA} and the second giving the
        number of bits to generate.  If an invalid type is specified or
        generation fails, L{Error} is raised.  If an invalid number of bits is
        specified, L{ValueError} or L{Error} is raised.
        iiiR^tbariÿÿÿÿiN(RRSR_R1Rt
ValueErrorR(R=R{((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_failedGeneration*s	cCsOd}tƒ}|jt|ƒ|j|jƒtƒ|j|jƒ|ƒdS(sŠ
        L{PKeyType.generate_key} generates an RSA key when passed
        L{TYPE_RSA} as a type and a reasonable number of bits.
        i€N(RR1RRYRKR|(R=R|R{((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_rsaGenerationMs
	cCsOd}tƒ}|jt|ƒ|j|jƒtƒ|j|jƒ|ƒdS(s‰
        L{PKeyType.generate_key} generates a DSA key when passed
        L{TYPE_DSA} as a type and a reasonable number of bits.
        iN(RR1RRYRKR|(R=R|R{((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_dsaGenerationYs
	cCsrtƒ}xbtdftdfgD]H\}}|j||ƒ|j|jƒ|ƒ|j|jƒ|ƒq"WdS(su
        L{PKeyType.generate_key} can be called multiple times on the same
        key to generate new keys.
        ii@N(RRRR1RYRKR|(R=R{RKR|((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_regenerationhs
	%(
RwRxRyRGROR}R€RR‚Rƒ(((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyRzs				
	#		t
X509NameTestscBsheZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„Zd
„ZRS(s4
    Unit tests for L{OpenSSL.crypto.X509Name}.
    cKsetƒjƒ}t|jƒƒ}d„}|jd|ƒx$|D]\}}t|||ƒqAW|S(NcSs|dS(Ni((tattr((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyR{~sR{(R
R4tlisttitemstsorttsetattr(R=tattrstnameR{tktv((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyt	_x509nameys	cCsu|jttƒ|jtjdƒ|jtttƒƒ|jƒ}|jt|tƒd|t|ƒtfƒdS(sB
        The type of X509Name objects is L{X509NameType}.
        Rs%r is of type %r, should be %rN(	RERR
RYRwRIRJRKRŽ(R=R‹((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyRG†scCsÌ|jƒ}d|_|j|jdƒ|j|jdƒd|_|j|jdƒ|j|jdƒd|_|j|jdƒ|j|jdƒd|_|j|jdƒ|j|jdƒdS(si
        L{X509NameType} instances have attributes for each standard (?)
        X509Name field.
        R^tbazR~tquuxN(RŽR5RYtCN(R=R‹((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_attributes•s				cCs†|jddddƒ}t|ƒ}|j|jdƒ|j|jdƒd|_|j|jdƒd|_|j|jdƒdS(s¯
        L{X509Name} creates a new L{X509NameType} instance with all the same
        attributes as an existing L{X509NameType} instance when called with
        one.
        R5R^temailAddresssbar@example.comRsquux@example.comN(RŽRRYR5R“(R=R‹tcopy((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyt	test_copy©s		cCs2|jddddƒ}|jt|ƒdƒdS(s°
        L{repr} passed an L{X509NameType} instance should return a string
        containing a description of the type and the NIDs which have been set
        on it.
        R5R^R“R~s,<X509Name object '/emailAddress=bar/CN=foo'>N(RŽRYtrepr(R=R‹((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyt	test_repr¾s	csŸd„‰‡‡fd†}ˆjƒ}|||ƒ|ˆjƒˆjƒƒ|ˆjddƒˆjddƒƒ|ˆjddƒˆjddƒƒ|ˆjddddƒˆjddddƒƒ‡‡fd	†}|ˆjddƒˆjddƒƒ|ˆjddƒˆjddƒƒd
„‰‡‡fd†}|ˆjddƒˆjdd
ƒƒ‡‡fd†}|ˆjdd
ƒˆjddƒƒdS(sO
        L{X509NameType} instances should compare based on their NIDs.
        cSsQ|||kd||fƒ|||kƒ|||kƒ|||kƒdS(Ns(%r == %r) --> False((taR)RIRV((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyt	_equalityÎscsˆ||ˆjˆjƒdS(N(RIRV(R˜R)(R™R=(s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyRYÔsR5R^R‘torganizationalUnitNameR~tOUcsˆ||ˆjˆjƒdS(N(RVRI(R˜R)(R™R=(s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pytassertNotEqualìscSs„|||kƒ|||kƒ|||kƒ|||kƒ|||kƒ|||kƒ|||kƒ|||kƒdS(N((R˜R)RIRV((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyt_inequalityøscsˆ||ˆjˆjƒdS(N(RIRV(R˜R)(R=R(s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pytassertLessThanstabctdefcsˆ||ˆjˆjƒdS(N(RVRI(R˜R)(R=R(s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pytassertGreaterThansN(RŽ(R=RYR‹RœRžR¡((R=RR™s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_comparisonÊs.	
	
cCsi|jddƒ}|jddƒ}|j|jƒ|jƒƒd|_|j|jƒ|jƒƒdS(sb
        L{X509Name.hash} returns an integer hash based on the value of the
        name.
        R‘R^R~N(RŽRYRhR‘Rœ(R=R˜R)((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyt	test_hashs
	cCs8|jddddƒ}|j|jƒtdƒƒdS(sK
        L{X509Name.der} returns the DER encoded form of the name.
        R‘R^tCtUSs010	UUS10
UfooN(RŽRYtderR)(R=R˜((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_der!s	cCs£|jƒ}|j|jƒgƒd|_|j|jƒtdƒtdƒfgƒd|_|j|jƒtdƒtdƒftdƒtdƒfgƒdS(sœ
        L{X509Name.get_components} returns a C{list} of two-tuples of C{str}
        giving the NIDs and associated values which make up the name.
        R^R‘R~R›N(RŽRYtget_componentsR‘R)Rš(R=R˜((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_get_components,s	+		cCs2tttƒ}|jƒ}|jd|jƒdS(sÇ
        An :py:class:`OpenSSL.crypto.X509Name` from an
        :py:class:`OpenSSL.crypto.X509` instance loaded from a file can have a
        NUL byte in the value of one of its attributes.
        snull.python.orgexample.orgN(RRtnulbyteSubjectAltNamePEMR4RYR5(R=tcertR7((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_load_nul_byte_attribute;s(
RwRxRyRŽRGR’R•R—R¢R£R§R©R¬(((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyR„us	
					K			t_PKeyInteractionTestsMixincBs;eZdZd„Zd„Zd„Zd„Zd„ZRS(s7
    Tests which involve another thing and a PKey.
    cCs
tƒ‚dS(s[
        Return something with a C{set_pubkey}, C{set_pubkey}, and C{sign} method.
        N(tNotImplementedError(R=((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pytsignableLscCs2|jƒ}tƒ}|jt|j|dƒdS(sY
        L{X509Req.sign} raises L{ValueError} when pass a L{PKey} with no parts.
        tMD5N(R¯RRSRR%(R=trequestR{((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_signWithUngeneratedSs	cCs[|jƒ}tƒ}|jtdƒ|j|ƒ|jƒ}|jt|j|dƒdS(s{
        L{X509Req.sign} raises L{ValueError} when pass a L{PKey} with no
        private part as the signing key.
        iR°N(	R¯RR1RR3t
get_pubkeyRSRR%(R=R±R{tpub((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_signWithPublicKey\s	
cCsB|jƒ}tƒ}|jtdƒ|jt|j|dƒdS(sl
        L{X509Req.sign} raises L{ValueError} when passed a digest name which is
        not known.
        itmonkeysN(R¯RR1RRSRR%(R=R±R{((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_signWithUnknownDigestis	cCs²|jƒ}tƒ}|jtdƒ|j|ƒ|j|dƒt|ddƒdk	r®|jƒ}|j	|j
|ƒƒtƒ}|jtdƒ|jt|j
|ƒndS(s§
        L{X509Req.sign} succeeds when passed a private key object and a valid
        digest function.  C{X509Req.verify} can be used to check the signature.
        iR°R&N(
R¯RR1RR3R%tgetattrR`R³RIR&RSR(R=R±R{R´((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyt	test_signts	
	(RwRxRyR¯R²RµR·R¹(((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyR­Hs				
	tX509ReqTestscBs_eZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„ZRS(
s.
    Tests for L{OpenSSL.crypto.X509Req}.
    cCstƒS(s5
        Create and return a new L{X509Req}.
        (R(R=((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyR¯ŽscCs$|jttƒ|jtdƒdS(s‡
        L{X509Req} and L{X509ReqType} refer to the same type object and can be
        used to create instances of that type.
        RN(RERRRF(R=((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyRG•scCs9tƒ}|jt|tƒd|t|ƒtfƒdS(sW
        L{X509Req} takes no arguments and returns an L{X509ReqType} instance.
        s%r is of type %r, should be %rN(RRIRJRRK(R=R±((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyROžs	cCsitƒ}|j|jƒdƒ|jdƒ|j|jƒdƒ|jdƒ|j|jƒdƒdS(sé
        L{X509ReqType.set_version} sets the X.509 version of the certificate
        request.  L{X509ReqType.get_version} returns the X.509 version of
        the certificate request.  The initial value of the version is 0.
        iiiN(RRYtget_versiontset_version(R=R±((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_version¨s	

cCsetƒ}|jt|jƒ|jt|jdƒ|jt|jddƒ|jt|jdƒdS(sñ
        L{X509ReqType.set_version} raises L{TypeError} if called with the wrong
        number of arguments or with a non-C{int} argument.
        L{X509ReqType.get_version} raises L{TypeError} if called with any
        arguments.
        R^iiN(RRSR_R¼R»R`(R=R±((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_version_wrong_args¶s
	cCs†tƒ}|jƒ}|jt|tƒd|t|ƒtfƒd|_|j|jƒjdƒ~d|_|j|jdƒdS(s¶
        L{X509ReqType.get_subject} returns an L{X509Name} for the subject of
        the request and which is valid even after the request object is
        otherwise dead.
        s%r is of type %r, should be %rR^R~N(RR4RIRJR
RKR5RY(R=R±R7((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_get_subjectÄs			cCs#tƒ}|jt|jdƒdS(sf
        L{X509ReqType.get_subject} raises L{TypeError} if called with any
        arguments.
        N(RRSR_R4R`(R=R±((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_get_subject_wrong_argsÖs	cCs5tƒ}|jttdƒttdƒƒgƒdS(s†
        L{X509Req.add_extensions} accepts a C{list} of L{X509Extension}
        instances and adds them to the X509 request.
        R@sCA:falseN(RRcRR)RC(R=R±((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_add_extensionsßs	cCsntƒ}|jt|jƒ|jt|jtƒƒ|jt|jtƒgƒ|jt|jgdƒdS(s

        L{X509Req.add_extensions} raises L{TypeError} if called with the wrong
        number of arguments or with a non-C{list}.  Or it raises L{ValueError}
        if called with a C{list} containing objects other than L{X509Extension}
        instances.
        N(RRSR_RcRmRR`(R=R±((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_add_extensions_wrong_argsês
	(RwRxRyR¯RGROR½R¾R¿RÀRÁRÂ(((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyRºŠs				
						t	X509TestscBskeZdZeeZdZd„Zd„Zd„Z	d„Z
d„Zd„Zd„Z
d	„Zd
„Zd„Zd„Zd
„Zd„Zd„Zd„Zd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d02rGheb2tj7MX9hG
uZzbwDAZzJPjzDQDD7d3cWsrVcfIdqVU7epHqIadnOF+X0ghJ39pAm6VVadnSXCt
WpOdIpB8KksUTCzV591Nr1wd
-----END CERTIFICATE-----
    cCstƒS(s2
        Create and return a new L{X509}.
        (R
(R=((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyR¯scCs$|jttƒ|jtdƒdS(s
        L{X509} and L{X509Type} refer to the same type object and can be used
        to create instances of that type.
        R
N(RER
RRF(R=((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyRGscCs—tƒ}|jt|tƒd|t|ƒtfƒ|jttƒjdƒ|jt|ƒjdƒ|jt|ƒtƒ|jt|ƒtƒdS(sT
        L{X509} takes no arguments and returns an instance of L{X509Type}.
        s%r is of type %r, should be %rRKR
N(R
RIRJRRKRYRw(R=tcertificate((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyRO#s		cCs#tƒ}|jt|jdƒdS(sX
        L{X509.get_version} raises L{TypeError} if invoked with any arguments.
        N(R
RSR_R»R`(R=R«((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_get_version_wrong_args3s	cCsOtƒ}|jt|jƒ|jt|jdƒ|jt|jddƒdS(s’
        L{X509.set_version} raises L{TypeError} if invoked with the wrong number
        of arguments or an argument not of type C{int}.
        iN(R
RSR_R¼R`(R=R«((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_set_version_wrong_args;s	cCs0tƒ}|jdƒ|j|jƒdƒdS(st
        L{X509.set_version} sets the certificate version number.
        L{X509.get_version} retrieves it.
        iÒN(R
R¼RAR»(R=R«((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyR½Fs	
cCs#tƒ}|jt|jdƒdS(sf
        L{X509.get_serial_number} raises L{TypeError} if invoked with any
        arguments.
        N(R
RSR_tget_serial_numberR`(R=R«((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyt!test_get_serial_number_wrong_argsPs	cCstƒ}|jt|jƒ|jt|jddƒ|jt|jdƒ|jt|jdƒ|j|jƒdƒ|jdƒ|j|jƒdƒ|jdƒ|j|jƒd
ƒ|jdƒ|j|jƒdƒ|jdƒ|j|jƒdƒd	S(s¡
        The serial number of an L{X509Type} can be retrieved and modified with
        L{X509Type.get_serial_number} and L{X509Type.set_serial_number}.
        iit1g@ii i@i€NIIIIlllll	l	l	l	(R
RSR_tset_serial_numberRYRÇ(R=RÄ((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_serial_numberYs	



cCs%tƒ}t|d|ƒ}t|d|ƒ}|j|ƒdƒtdƒ}||ƒ|j|ƒ|ƒtdƒ}||ƒ|j|ƒ|ƒtdƒ}||ƒ|j|ƒ|ƒ|jt|tdƒƒ|jt|ƒ|jt|tdƒtdƒƒ|jt|tdƒƒdS(s¶
        L{X509Type.set_notBefore} takes a string in the format of an ASN1
        GENERALIZEDTIME and sets the beginning of the certificate's validity
        period to it.
        tset_nottget_nott20040203040506Zs20040203040506+0530s20040203040506-0115sfoo barN(R
R¸RYR`R)RSRR_(R=twhichRÄtsettgettwhen((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyt
_setBoundTestns"	


"cCs|jdƒdS(s¶
        L{X509Type.set_notBefore} takes a string in the format of an ASN1
        GENERALIZEDTIME and sets the beginning of the certificate's validity
        period to it.
        tBeforeN(RÓ(R=((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_set_notBefore•scCs|jdƒdS(s¯
        L{X509Type.set_notAfter} takes a string in the format of an ASN1
        GENERALIZEDTIME and sets the end of the certificate's validity period
        to it.
        tAfterN(RÓ(R=((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_set_notAfteržscCs2tt|jƒ}|j|jƒtdƒƒdS(s±
        L{X509Type.get_notBefore} returns a string in the format of an ASN1
        GENERALIZEDTIME even for certificates which store it as UTCTIME
        internally.
        t20090325123658ZN(RRtpemDataRYt
get_notBeforeR)(R=R«((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_get_notBefore§scCs2tt|jƒ}|j|jƒtdƒƒdS(s°
        L{X509Type.get_notAfter} returns a string in the format of an ASN1
        GENERALIZEDTIME even for certificates which store it as UTCTIME
        internally.
        t20170611123658ZN(RRRÙRYtget_notAfterR)(R=R«((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_get_notAfter±scCsOtƒ}|jt|jƒ|jt|jdƒ|jt|jddƒdS(s•
        L{X509Type.gmtime_adj_notBefore} raises L{TypeError} if called with the
        wrong number of arguments or a non-C{int} argument.
        i{N(R
RSR_tgmtime_adj_notBeforeR`(R=R«((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyt$test_gmtime_adj_notBefore_wrong_args»s	cCsatt|jƒ}tjƒtddƒ}|jdƒ|j|jƒt	|j
dƒƒƒdS(s˜
        L{X509Type.gmtime_adj_notBefore} changes the not-before timestamp to be
        the current time plus the number of seconds passed in.
        tsecondsids
%Y%m%d%H%M%SZN(RRRÙRtutcnowRRßRYRÚR)R:(R=R«R9((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_gmtime_adj_notBeforeÆs
cCsOtƒ}|jt|jƒ|jt|jdƒ|jt|jddƒdS(s”
        L{X509Type.gmtime_adj_notAfter} raises L{TypeError} if called with the
        wrong number of arguments or a non-C{int} argument.
        i{N(R
RSR_tgmtime_adj_notAfterR`(R=R«((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyt#test_gmtime_adj_notAfter_wrong_argsÑs	cCsatt|jƒ}tjƒtddƒ}|jdƒ|j|jƒt	|j
dƒƒƒdS(s–
        L{X509Type.gmtime_adj_notAfter} changes the not-after timestamp to be
        the current time plus the number of seconds passed in.
        Ráids
%Y%m%d%H%M%SZN(RRRÙRRâRRäRYRÝR)R:(R=R«R9((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_gmtime_adj_notAfterÜs
cCs#tƒ}|jt|jdƒdS(sc
        L{X509Type.has_expired} raises L{TypeError} if called with any
        arguments.
        N(R
RSR_thas_expiredR`(R=R«((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_has_expired_wrong_argsçs	cCs-tƒ}|jdƒ|j|jƒƒdS(su
        L{X509Type.has_expired} returns C{True} if the certificate's not-after
        time is in the past.
        iÿÿÿÿN(R
RäRIRç(R=R«((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_has_expiredðs	
cCs-tƒ}|jdƒ|j|jƒƒdS(sx
        L{X509Type.has_expired} returns C{False} if the certificate's not-after
        time is in the future.
        iN(R
RäRVRç(R=R«((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_has_not_expiredús	
cCs,tƒ}|j|jdƒtdƒƒdS(s‚
        L{X509.digest} returns a string giving ":"-separated hex-encoded words
        of the digest of the certificate.
        tmd5s/A8:EB:07:F8:53:25:0A:F2:56:05:C5:A5:C4:C4:C7:15N(R
RYtdigestR)(R=R«((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_digests	cCsŒtƒ}|j|ƒd|jƒ_d|jƒ_ttjƒjdƒƒ}|j	|ƒ|j
|ƒ|j|ƒtt
tt
|ƒƒS(Ns
Unit Testss
%Y%m%d%H%M%SZ(R
R3R4R5t
get_issuerR)RR9R:R;R<RcRRR(R=R0t
extensionsR«RÒ((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyt_extcerts	



cCsñtttƒ}ttdƒttdƒƒ}ttdƒttdƒƒ}ttdƒttdƒƒ}|j|gƒ}|j|jƒdƒ|j||gƒ}|j|jƒdƒ|j||||gƒ}|j|jƒd	ƒd
S(s{
        L{X509.get_extension_count} returns the number of extensions that are
        present in the certificate.
        R@sCA:FALSEtkeyUsagetdigitalSignaturetsubjectAltNamesDNS:example.comiiiN(	RRtclient_key_pemRR)RCRðRYtget_extension_count(R=R0tcaR{Rótc((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_extension_countscCsÆtttƒ}ttdƒttdƒƒ}ttdƒttdƒƒ}ttdƒttdƒƒ}|j||||gƒ}|jdƒ}|j	t
|tƒƒ|j	|jƒƒ|j|j
ƒtdƒƒ|jdƒ}|j	t
|tƒƒ|j	|jƒƒ|j|j
ƒtdƒƒ|jd	ƒ}|j	t
|tƒƒ|j|jƒƒ|j|j
ƒtdƒƒ|jt|jd
ƒ|jt|jdƒ|jt|jdƒd
S(sŽ
        L{X509.get_extension} takes an integer and returns an L{X509Extension}
        corresponding to the extension at that index.
        R@sCA:FALSERñRòRósDNS:example.comiiiiÿÿÿÿiRlN(RRRôRR)RCRLRðt
get_extensionRIRJRURYRZRVRSt
IndexErrorR_(R=R0RöR{RóR«RW((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_get_extension5s*cCs`tttƒ}|jdƒ}|j|jƒtdƒƒ|jtdƒtt|ƒƒƒdS(s¿
        The fields of a `subjectAltName` extension on an X509 may contain NUL
        bytes and this value is reflected in the string representation of the
        extension object.
        iRós±DNS:altnull.python.orgexample.com, email:null@python.orguser@example.org, URI:http://null.python.orghttp://example.org, IP Address:192.0.2.1, IP Address:2001:DB8:0:0:0:0:0:1
N(RRRªRùRYRZR)RB(R=R«RW((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_nullbyte_subjectAltNameVs	cCs#tƒ}|jt|jdƒdS(sl
        L{X509.digest} raises L{ValueError} if called with an unrecognized hash
        algorithm.
        R¶N(R
RSRRì(R=R«((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_invalid_digest_algorithmhs	cCs#tƒ}|jt|jdƒdS(sW
        L{X509.get_subject} raises L{TypeError} if called with any arguments.
        N(R
RSR_R4R`(R=R«((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyRÀqs	c	Cs·tt|jƒ}|jƒ}|jt|tƒƒ|j|jƒt	dƒt	dƒft	dƒt	dƒft	dƒt	dƒft	dƒt	dƒft	d	ƒt	d
ƒfgƒdS(sF
        L{X509.get_subject} returns an L{X509Name} instance.
        R¤R¥tSTtILtLtChicagotOtTestingR‘sTesting Root CAN(
RRRÙR4RIRJRRAR¨R)(R=R«tsubj((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyR¿ys	?cCsUtƒ}|jt|jƒ|jt|jdƒ|jt|j|jƒdƒdS(s˜
        L{X509.set_subject} raises a L{TypeError} if called with the wrong
        number of arguments or an argument not of type L{X509Name}.
        N(R
RSR_tset_subjectR`R4(R=R«((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_set_subject_wrong_args†s	cCs~tƒ}|jƒ}d|_d|_|j|ƒ|j|jƒjƒtdƒtdƒftdƒtdƒfgƒdS(sj
        L{X509.set_subject} changes the subject of the certificate to the one
        passed in.
        tAUs
Unit TestsR¤RN(R
R4R¤RRRAR¨R)(R=R«R‹((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_set_subject‘s			
cCs#tƒ}|jt|jdƒdS(sV
        L{X509.get_issuer} raises L{TypeError} if called with any arguments.
        N(R
RSR_RîR`(R=R«((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_get_issuer_wrong_args s	c	Cs½tt|jƒ}|jƒ}|jt|tƒƒ|jƒ}|j|t	dƒt	dƒft	dƒt	dƒft	dƒt	dƒft	dƒt	dƒft	d	ƒt	d
ƒfgƒdS(sE
        L{X509.get_issuer} returns an L{X509Name} instance.
        R¤R¥RþRÿRRRRR‘sTesting Root CAN(
RRRÙRîRIRJRR¨RAR)(R=R«Rtcomp((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_get_issuer¨s?cCsUtƒ}|jt|jƒ|jt|jdƒ|jt|j|jƒdƒdS(s—
        L{X509.set_issuer} raises a L{TypeError} if called with the wrong
        number of arguments or an argument not of type L{X509Name}.
        N(R
RSR_R8R`Rî(R=R«((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_set_issuer_wrong_args¶s	cCs~tƒ}|jƒ}d|_d|_|j|ƒ|j|jƒjƒtdƒtdƒftdƒtdƒfgƒdS(sh
        L{X509.set_issuer} changes the issuer of the certificate to the one
        passed in.
        Rs
Unit TestsR¤RN(R
RîR¤RR8RAR¨R)(R=R«R‹((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_set_issuerÁs			
cCs tƒ}|jt|jƒdS(s}
        When called on a certificate with no public key, L{X509.get_pubkey}
        raises L{OpenSSL.crypto.Error}.
        N(R
RSRR³(R=R«((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_get_pubkey_uninitializedÐs	cCs#tƒ}|jt|jdƒdS(se
        L{X509.subject_name_hash} raises L{TypeError} if called with any
        arguments.
        N(R
RSR_tsubject_name_hashR`(R=R«((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyt!test_subject_name_hash_wrong_argsÙs	cCs2tt|jƒ}|j|jƒddgƒdS(sg
        L{X509.subject_name_hash} returns the hash of the certificate's subject
        name.
        I‚¬­ÇI8VpÃN(RRRÙtassertInR(R=R«((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_subject_name_hashâs
	(,RwRxRytcleartextCertificatePEMtcleartextPrivateKeyPEMRÙtextpemR¯RGRORÅRÆR½RÈRËRÓRÕR×RÛRÞRàRãRåRæRèRéRêRíRðRøRûRüRýRÀR¿RRR	RRR
RRR(((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyRÃùsP
							
				'					
	
							
	
				!					
										tPKCS12TestscBsÕeZdZeeZd„Zd„Zd„Zd„Z	d„Z
ddddd„Zdddddd„Z
d	„Zd
„Zd„Zd„Zd
„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(sN
    Test for L{OpenSSL.crypto.PKCS12} and L{OpenSSL.crypto.load_pkcs12}.
    cCs$|jttƒ|jtdƒdS(s1
        L{PKCS12Type} is a type object.
        RN(RERRRF(R=((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyRGöscCsetƒ}|jd|jƒƒ|jd|jƒƒ|jd|jƒƒ|jd|jƒƒdS(sŒ
        L{PKCS12} returns a new instance of L{PKCS12} with no certificate,
        private key, CA certificates, or friendly name.
        N(RRYR`tget_certificatetget_privatekeytget_ca_certificatestget_friendlyname(R=tp12((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_empty_constructionþs
	cCs$tƒ}|jt|jdƒ|jt|jtƒƒ|jt|jtƒ|jt|jdƒ|jt|jdƒ|jt|jtƒƒ|jt|jdƒ|jt|jtƒƒ|jt|jdƒ|jt|jtƒfƒ|jt|jdƒ|jt|jd	ƒdS(
sä
        The L{PKCS12} setter functions (C{set_certificate}, C{set_privatekey},
        C{set_ca_certificates}, and C{set_friendlyname}) raise L{TypeError}
        when passed objects of types other than those expected.
        itlegboneiiR^R~N(ii(sfoosbar(	RRSR_tset_certificateRR
tset_privatekeytset_ca_certificatestset_friendlyname(R=R((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_type_errors
s	cCsõd}tƒ}tttƒ}|j|ƒ|jd|jƒƒ|j||jƒƒy"|j	d|ddddƒ}Wnt
k
rdSXt||ƒ}|jd|jƒƒ|jd|jƒƒ|j
t|jƒttdƒfƒƒdS(s‹
        A L{PKCS12} with only a private key can be exported using
        L{PKCS12.export} and loaded again using L{load_pkcs12}.
        tblaht
passphrasetiteritmaciteriN(RRRRRRYR`RRtexportRRRRIRJRRK(R=tpasswdRR0t
dumped_p12((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyt
test_key_onlys	
"
cCsd}tƒ}tttƒ}|j|ƒ|j||jƒƒ|jd|jƒƒy"|j	d|ddddƒ}Wnt
k
rdSXt||ƒ}|jd|jƒƒ|jt
|jƒttdƒfƒƒ|jttt|jƒdƒƒdS(	s‹
        A L{PKCS12} with only a certificate can be exported using
        L{PKCS12.export} and loaded again using L{load_pkcs12}.
        R#R$R%iR&iNi(RRRRRRYRR`RR'RRRIRJR
RKRR(R=R(RR«R)((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_cert_only:s 	
"
(cCsËtƒ}|r:|jtt|ƒƒ}|j|dƒn|rk|jtt|ƒƒ}|j|dƒn|rŸ|jtt|ƒfƒ}|j|dƒn|rÇ|j	|ƒ}|j|dƒn|S(sx
        Generate a PKCS12 object with components from PEM.  Verify that the set
        functions return None.
        N(
RRRRRYR`RRR R!(R=tcert_pemtkey_pemtca_pemt
friendly_nameRtret((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyt
gen_pkcs12]s	tc		CsÜ|rFt|ddddd||Œ}|j|t|ƒ|ƒn|rt|ddddd|d|Œ}|j|t|ƒ|ƒn|rØt|ddddd|d|Œ}|j|t|ƒ|ƒnd	S(
so
        Use openssl program to confirm three components are recoverable from a
        PKCS12 string.
        tpkcs12s-nocertss-nodess-passinspass:s-clcertss-nokeyss-cacertsN(t_runopensslRYtlen(	R=tp12_strR{R«RöR(textrat
recovered_keytrecovered_cert((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pytcheck_recoveryrscCs¸d}tt}t|ddddd|ƒ}t||ƒ}|jt|tƒƒtt|j	ƒƒ}|j
|tƒtt|jƒƒ}|j
|tƒ|j
d|jƒƒdS(sŸ
        A PKCS12 string generated using the openssl command line can be loaded
        with L{load_pkcs12} and its components extracted and examined.
        twhateverR3s-exports-clcertss-passoutspass:N(Rôtclient_cert_pemR4RRIRJRRRRRYRRR`R(R=R(R*R6RR,R-((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_load_pkcs12‰s
cCsbd}|jttd|ƒ}|j|jddddƒ|jt|jddƒdƒdS(sx
        L{load_pkcs12} raises L{OpenSSL.crypto.Error} when passed a string
        which is not a PKCS12 dump.
        R;sfruit loopsisasn1 encoding routinesiN(RSRRRYtargsR5(R=R(te((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_load_pkcs12_garbageœscCs|jtttƒ}|jtttƒƒ|jt	tt
ƒƒtttƒ}tttƒ}|j|gƒ|jdt
|jƒƒƒ|j||jƒdƒ|j||gƒ|jdt
|jƒƒƒ|j||jƒdƒ|j||jƒdƒdS(sØ
        L{PKCS12.set_certificate} replaces the certificate in a PKCS12 cluster.
        L{PKCS12.set_privatekey} replaces the private key.
        L{PKCS12.set_ca_certificates} replaces the CA certificates.
        iiiN(R1R<Rôt
root_cert_pemRRRtserver_cert_pemRRtserver_key_pemR RYR5R(R=Rt	root_certtclient_cert((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_replace§scCsÖd}|jtttƒ}x´tdƒd
tdƒgD]—}|j|ƒ|j|jƒ|ƒ|j	d|ddddƒ}t
||ƒ}|j|jƒ|jƒƒ|j|d	td
tdtd|ƒq7Wd
S(sç
        The I{friendlyName} of a PKCS12 can be set and retrieved via
        L{PKCS12.get_friendlyname} and L{PKCS12_set_friendlyname}, and a
        L{PKCS12} with a friendly name set can be dumped with L{PKCS12.export}.
        s$Dogmeat[]{}!@#$%^&*()~`?/.,<>-_+=";:t
Serverliciouss###R$R%iR&iR{R«RöR(N(R1RBRCRAR)R`R!RYRR'RR:(R=R(RR/R)treloaded_p12((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_friendly_name»s"
cCs²|jtttƒ}d}|jddddd|ƒ}|jddddddƒ}|jdddd	ƒ}x<|||gD]+}|j|d
tdtdtd
|ƒqWdS(sf
        Test that missing, None, and '' passphrases are identical for PKCS12
        export.
        R2R%iR&iR$ii	iR{R«RöR(N(R1R<RôRAR'R`R:(R=RR(tdumped_p12_emptytdumped_p12_nonetdumped_p12_nopwR)((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_various_empty_passphrasesÓscCs<|jtttƒ}|jdƒ|jd|jƒƒdS(sg
        Passing C{None} to L{PKCS12.set_ca_certificates} removes all CA
        certificates.
        N(R1RBRCRAR R`RYR(R=R((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_removing_ca_certãs
c
Csbd}|jtttƒ}|jddd|ddƒ}|j|dtdtd	|d
d
ƒdS(sb
        Exporting a PKCS12 with a C{maciter} of C{-1} excludes the MAC
        entirely.
        s
Lake MichiganR&iÿÿÿÿR$R%iR{R«R(R7s	-nomacverN(s	-nomacver(R1RBRCRAR'R:(R=R(RR)((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_export_without_macíscCszd}|jtttƒ}|jddd|ddƒ}y)t||ƒ}|jt|tƒƒWnt	k
runXdS(sQ
        Loading a PKCS12 without a MAC does something other than crash.
        s
Lake MichiganR&iÿÿÿÿR$R%iN(
R1RBRCRAR'RRIRJRR(R=R(RR)t
recovered_p12((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_load_without_macús
cCsvd}|jttƒ}|jgƒ|jd	|jƒƒ|jd|ddƒ}|j|dtdtd|ƒdS(
sN
        A PKCS12 with an empty CA certificates list can be exported.
        sHobie 18R$R%iR{R«R(N((R1RBRCR RYRR'R:(R=R(RR)((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_zero_len_list_for_cas
cCsD|jtttƒ}|jƒ}|j|dtdtddƒdS(sE
        All the arguments to L{PKCS12.export} are optional.
        R{R«R(R2N(R1RBRCRAR'R:(R=RR)((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_export_without_argsscCs,|jtttƒ}|jt|jƒdS(sc
        L{PKCS12.export} raises an exception when a key and certificate
        mismatch.
        N(R1RBRôRARSRR'(R=R((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_key_cert_mismatch'sN((RwRxRyRRRÙRGRR"R*R+R`R1R:R=R@RFRIRMRNRORQRRRSRT(((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyRðs*
					#						
	
			
s(\\*)"s(\\+)\ZcCs&tjdtjd|ƒƒ}d|S(s<
    Internal method for quoting a single command-line argument.

    @type: C{str}
    @param s: A single unquoted string to quote for something that is expecting
        cmd.exe-style quoting

    @rtype: C{str}
    @return: A cmd.exe-style quoted string

    @see: U{http://www.perlmonks.org/?node_id=764004}
    s\1\1s\1\1\\"s"%s"(t_cmdLineQuoteRe2tsubt_cmdLineQuoteRe(ts((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pytcmdLineQuote4s
cCsdjtt|ƒƒS(s©
    Quote an iterable of command-line arguments for passing to CreateProcess or
    a similar API.  This allows the list passed to C{reactor.spawnProcess} to
    match the child process's C{sys.argv} properly.

    @type arguments: C{iterable} of C{str}
    @param arguments: An iterable of unquoted arguments to quote

    @rtype: C{str}
    @return: A space-delimited string containing quoted versions of L{arguments}
    t (tjointmapRY(t	arguments((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pytquoteArgumentsFscGs£tjdkrKddjg|D]}d|jddƒf^qƒ}ndt|ƒ}t|dtdtd	tƒ}|jj	|ƒ|jj
ƒ|jjƒS(
s„
    Run the command line openssl tool with the given arguments and write
    the given PEM to its stdin.  Not safe for quotes.
    tposixsopenssl RZs'%s't's'\''tshelltstdintstdout(
tosR‹R[treplaceR^RRCRRbtwritetcloseRctread(R*R>targtcommandtproc((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyR4Vs	3
t
FunctionTestscBs°eZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„Zd
„Zd„Z
d„Zd
„Zd„Zd„Zd„Zd„Zd„ZRS(sC
    Tests for free-functions in the L{OpenSSL.crypto} module.
    cCs|jttdtƒdS(sX
        L{load_privatekey} raises L{ValueError} if passed an unknown filetype.
        idN(RSRRtroot_key_pem(R=((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyt#test_load_privatekey_invalid_formatlscCs |jtttttƒƒdS(s€
        L{load_privatekey} raises L{TypeError} if passed a passphrase that is
        neither a c{str} nor a callable.
        N(RSR_RRt encryptedPrivateKeyPEMPassphraseRm(R=((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyt,test_load_privatekey_invalid_passphrase_typesscCs|jttƒdS(sn
        L{load_privatekey} raises L{TypeError} if called with the wrong number
        of arguments.
        N(RSR_R(R=((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_load_privatekey_wrong_args~scCs#|jtttttdƒƒdS(s‹
        L{load_privatekey} raises L{OpenSSL.crypto.Error} when it is passed an
        encrypted PEM and an incorrect passphrase.
        tquackN(RSRRRtencryptedPrivateKeyPEMR)(R=((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyt$test_load_privatekey_wrongPassphrase†scCs,ttttƒ}|jt|tƒƒdS(s~
        L{load_privatekey} can create a L{PKey} object from an encrypted PEM
        string if given the passphrase.
        N(RRRsRoRIRJR	(R=R{((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_load_privatekey_passphrases	cs?g‰‡fd†}|jtttt|ƒ|jˆƒdS(s·
        L{load_privatekey} raises L{OpenSSL.crypto.Error} when it is passed an
        encrypted PEM and a passphrase callback which returns an incorrect
        passphrase.
        csˆjdƒdS(NRr(tappendR`(R˜(tcalled(s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pytcb¢s
N(RSRRRRsRI(R=Rx((Rws</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyt,test_load_privatekey_wrongPassphraseCallback›scsTg‰‡fd†}ttt|ƒ}|jt|tƒƒ|jˆtgƒdS(s°
        L{load_privatekey} can create a L{PKey} object from an encrypted PEM
        string if given a passphrase callback which returns the correct
        password.
        csˆj|ƒtS(N(RvRo(twriting(Rw(s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyRx²s
N(RRRsRIRJR	RYRL(R=RxR{((Rws</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyt'test_load_privatekey_passphraseCallback«s
cCs&d„}|jtttt|ƒdS(s
        An exception raised by the passphrase callback passed to
        L{load_privatekey} causes L{OpenSSL.crypto.Error} to be raised.

        This isn't as nice as just letting the exception pass through.  The
        behavior might be changed to that eventually.
        cSstdƒ‚dS(NsThis is not working.(tRuntimeError(tignored((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pytbrokenÂsN(RSRRRRs(R=R~((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyt)test_load_privatekey_passphrase_exceptionºs
	cCs|jttƒdS(sn
        L{dump_privatekey} raises L{TypeError} if called with the wrong number
        of arguments.
        N(RSR_R(R=((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_dump_privatekey_wrong_argsÊscCs9tƒ}|jtdƒ|jttt|ddƒdS(sm
        L{dump_privatekey} raises L{ValueError} if called with an unrecognized
        cipher name.
        itzippersR$N(RR1RRSRRR(R=R{((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyt#test_dump_privatekey_unknown_cipherÒs
	cCs<tƒ}|jtdƒ|jttt|dtƒƒdS(s†
        L{dump_privatekey} raises L{TypeError} if called with a passphrase which
        is neither a C{str} nor a callable.
        itblowfishN(RR1RRSR_RRRm(R=R{((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyt,test_dump_privatekey_invalid_passphrase_typeÞs
	cCs3tƒ}|jtdƒ|jttd|ƒdS(sj
        L{dump_privatekey} raises L{ValueError} if called with an unrecognized
        filetype.
        iidN(RR1RRSRR(R=R{((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyt%test_dump_privatekey_invalid_filetypeês	cCsªtdƒ}tttƒ}tt|d|ƒ}|jt|tƒƒtt||ƒ}|jt|tƒƒ|j	|j
ƒ|j
ƒƒ|j	|jƒ|jƒƒdS(sU
        L{dump_privatekey} writes an encrypted PEM when given a passphrase.
        R^RƒN(R)RRRRRIRJR(R	RYRKR|(R=R$R{R*t	loadedKey((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_dump_privatekey_passphraseôsc
CsÒtt}tt|ƒ}tt|ƒ}|j|tƒtt|ƒ}t|dddƒ}|j||ƒtt|ƒ}tt|ƒ}|j|tƒtt|ƒ}t|dddƒ}	|j||	ƒdS(s@
        L{dump_certificate} writes PEM, DER, and text.
        R6s-outformtDERs-noouts-textN(	RRRRRRYRR4R(
R=RÙR«t
dumped_pemt
dumped_dertgood_dertcert2tdumped_pem2tdumped_textt	good_text((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_dump_certificates
c	CsÈtttƒ}tt|ƒ}|j|tƒtt|ƒ}t|dddƒ}|j||ƒtt|ƒ}tt|ƒ}|j|tƒtt|ƒ}t|dddƒ}|j||ƒdS(sA
        L{dump_privatekey} writes a PEM, DER, and text.
        trsas-outformRˆs-noouts-textN(RRRRRYRR4R(	R=R{R‰RŠR‹tkey2RRŽR((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_dump_privatekeysc	CsÞtttƒ}tt|ƒ}|j|tƒtt|ƒ}t|dddƒ}|j||ƒtt|ƒ}tt|ƒ}|j|tƒtt|ƒ}t|dddƒ}|j||ƒ|jt	td|ƒdS(sJ
        L{dump_certificate_request} writes a PEM, DER, and text.
        R2s-outformRˆs-noouts-textidN(
RRtcleartextCertificateRequestPEMRRYRR4RRSR(	R=R2R‰RŠR‹treq2RRŽR((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_dump_certificate_request(scsÕtdƒ‰g‰‡‡fd†}tttƒ}tt|d|ƒ}|jt|tƒƒ|jˆt	gƒtt|ˆƒ}|jt|t
ƒƒ|j|jƒ|jƒƒ|j|jƒ|jƒƒdS(s€
        L{dump_privatekey} writes an encrypted PEM when given a callback which
        returns the correct passphrase.
        R^csˆj|ƒˆS(N(Rv(Rz(RwR$(s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyRxBs
RƒN(
R)RRRRRIRJR(RYRCR	RKR|(R=RxR{R*R†((R$Rws</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyt'test_dump_privatekey_passphraseCallback;scCs)tttƒ}|jt|tƒƒdS(sm
        L{load_pkcs7_data} accepts a PKCS#7 string and returns an instance of
        L{PKCS7Type}.
        N(RRt	pkcs7DataRIRJR(R=tpkcs7((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_load_pkcs7_dataOs(RwRxRyRnRpRqRtRuRyR{RR€R‚R„R…R‡RR“R–R—Rš(((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyRlgs&				
								
					t
PKCS7TestscBszeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„Zd
„Zd„Z
d„ZRS(
s!
    Tests for L{PKCS7Type}.
    cCs-|jtttƒƒ|jtjdƒdS(s0
        L{PKCS7Type} is a type object.
        tPKCS7N(RIRJRRKRYRw(R=((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyRG]scCs)tttƒ}|jt|jdƒdS(sg
        L{PKCS7Type.type_is_signed} raises L{TypeError} if called with any
        arguments.
        N(RRR˜RSR_ttype_is_signedR`(R=R™((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_type_is_signed_wrong_argsjscCs&tttƒ}|j|jƒƒdS(ss
        L{PKCS7Type.type_is_signed} returns C{True} if the PKCS7 object is of
        the type I{signed}.
        N(RRR˜RIR(R=R™((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_type_is_signedsscCs)tttƒ}|jt|jdƒdS(sj
        L{PKCS7Type.type_is_enveloped} raises L{TypeError} if called with any
        arguments.
        N(RRR˜RSR_ttype_is_envelopedR`(R=R™((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyt!test_type_is_enveloped_wrong_args|scCs&tttƒ}|j|jƒƒdS(s~
        L{PKCS7Type.type_is_enveloped} returns C{False} if the PKCS7 object is
        not of the type I{enveloped}.
        N(RRR˜RVR (R=R™((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_type_is_enveloped…scCs)tttƒ}|jt|jdƒdS(ss
        L{PKCS7Type.type_is_signedAndEnveloped} raises L{TypeError} if called
        with any arguments.
        N(RRR˜RSR_ttype_is_signedAndEnvelopedR`(R=R™((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyt*test_type_is_signedAndEnveloped_wrong_argsŽscCs&tttƒ}|j|jƒƒdS(s’
        L{PKCS7Type.type_is_signedAndEnveloped} returns C{False} if the PKCS7
        object is not of the type I{signed and enveloped}.
        N(RRR˜RVR£(R=R™((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_type_is_signedAndEnveloped—scCs&tttƒ}|j|jƒƒdS(sq
        L{PKCS7Type.type_is_data} returns C{False} if the PKCS7 object is not of
        the type data.
        N(RRR˜RVttype_is_data(R=R™((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_type_is_data scCs)tttƒ}|jt|jdƒdS(se
        L{PKCS7Type.type_is_data} raises L{TypeError} if called with any
        arguments.
        N(RRR˜RSR_R¦R`(R=R™((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_type_is_data_wrong_args©scCs)tttƒ}|jt|jdƒdS(sf
        L{PKCS7Type.get_type_name} raises L{TypeError} if called with any
        arguments.
        N(RRR˜RSR_t
get_type_nameR`(R=R™((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_get_type_name_wrong_args²scCs/tttƒ}|j|jƒtdƒƒdS(sS
        L{PKCS7Type.get_type_name} returns a C{str} giving the type name.
        spkcs7-signedDataN(RRR˜RAR©R)(R=R™((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_get_type_name»scCs)tttƒ}|jtt|dƒdS(sœ
        If an attribute other than one of the methods tested here is accessed on
        an instance of L{PKCS7Type}, L{AttributeError} is raised.
        R^N(RRR˜RStAttributeErrorR¸(R=R™((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_attributeÃs(RwRxRyRGRžRŸR¡R¢R¤R¥R§R¨RªR«R­(((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyR›Ys	
																			tNetscapeSPKITestscBs;eZdZd„Zd„Zd„Zd„Zd„ZRS(s3
    Tests for L{OpenSSL.crypto.NetscapeSPKI}.
    cCstƒS(sJ
        Return a new L{NetscapeSPKI} for use with signing tests.
        (R#(R=((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyR¯ÑscCs$|jttƒ|jtdƒdS(s‘
        L{NetscapeSPKI} and L{NetscapeSPKIType} refer to the same type object
        and can be used to create instances of that type.
        R#N(RER#R$RF(R=((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyRGØscCs#tƒ}|jt|tƒƒdS(sM
        L{NetscapeSPKI} returns an instance of L{NetscapeSPKIType}.
        N(R#RIRJR$(R=tnspki((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyROás	cs&tƒ‰|jt‡fd†ƒdS(s„
        Accessing a non-existent attribute of a L{NetscapeSPKI} instance causes
        an L{AttributeError} to be raised.
        csˆjS(N(R^((R¯(s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyt<lambda>ïsN(R#RSR¬(R=((R¯s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_invalid_attributeés	cCs/tƒ}|jƒ}|jt|tƒƒdS(sV
        L{NetscapeSPKI.b64_encode} encodes the certificate to a base64 blob.
        N(R#t
b64_encodeRIRJR((R=R¯tblob((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_b64_encodeòs	(RwRxRyR¯RGROR±R´(((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyR®Ís						tRevokedTestscBsMeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z	RS(s-
    Tests for L{OpenSSL.crypto.Revoked}
    cCstƒ}|jt|tƒƒ|jt|ƒtƒ|j|jƒtdƒƒ|j|jƒdƒ|j|j	ƒdƒdS(sc
        Confirm we can create L{OpenSSL.crypto.Revoked}.  Check
        that it is empty.
        t00N(
R!RIRJRARKt
get_serialR)tget_rev_dateR`t
get_reason(R=trevoked((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyRO	s	cCs=|jttdƒ|jttdƒ|jttdƒdS(sv
        Calling L{OpenSSL.crypto.Revoked} with any arguments results
        in a L{TypeError} being raised.
        iR^N(RSR_R!R`(R=((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_construction_wrong_args
	scCsýtƒ}|jtdƒƒ}|j|d	ƒ|jƒ}|j|tdƒƒ|jtdƒƒ|jƒ}|j|tdƒƒ|jt|jtdƒƒ|jt|jdƒ|jt|jdƒ|jt|jd	ƒ|jt|jdƒd	S(
s“
        Confirm we can set and get serial numbers from
        L{OpenSSL.crypto.Revoked}.  Confirm errors are handled
        with grace.
        t10bt010Bt31pppt31tpqrstidiR2N(	R!t
set_serialR)RAR`R·RSRR_(R=RºR0tser((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_serial	s	cCstƒ}|jƒ}|j|dƒttjƒjdƒƒ}|j|ƒ}|j	|dƒ|jƒ}|j	||ƒdS(s•
        Confirm we can set and get revocation dates from
        L{OpenSSL.crypto.Revoked}.  Confirm errors are handled
        with grace.
        s
%Y%m%d%H%M%SZN(
R!R¸RAR`R)RR9R:tset_rev_dateRY(R=RºtdateR9R0((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyt	test_date.	s	cCsÛtƒ}x¨|jƒD]š}x‘tdƒD]ƒ}|j|ƒ}|j|dƒ|jƒ}|j|jƒjt	dƒt	dƒƒ|jƒjt	dƒt	dƒƒƒ|}q)WqW|jdƒ|j
|jƒdƒdS(sÄ
        Confirm we can set and get revocation reasons from
        L{OpenSSL.crypto.Revoked}.  The "get" need to work
        as "set".  Likewise, each reason of all_reasons() must work.
        iRZR2N(R!tall_reasonstranget
set_reasonRAR`R¹tlowerReR)RY(R=RºtrtxR0treason((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_reason?	s	!%
cCs?tƒ}|jt|jdƒ|jt|jtdƒƒdS(sÎ
        Calling L{OpenSSL.crypto.Revoked.set_reason} with other than
        one argument, or an argument which isn't a valid reason,
        results in L{TypeError} or L{ValueError} being raised.
        idtblueN(R!RSR_RÉRR)(R=Rº((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_set_reason_wrong_argumentsT	s	cCsOtƒ}|jt|jdƒ|jt|jdƒ|jt|jdƒdS(s
        Calling L{OpenSSL.crypto.Revoked.get_reason} with any
        arguments results in L{TypeError} being raised.
        iR^N(R!RSR_R¹R`(R=Rº((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_get_reason_wrong_arguments_	s	(
RwRxRyROR»RÃRÆRÎRÐRÑ(((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyRµüs	
	
				tCRLTestscBs¡eZdZeeeƒZeeeƒZ	d„Z
d„Zd„Zd„Z
d„Zd„Zd„Zd„Zd	„Zd
„Zd„Zd„Zd
„ZRS(s)
    Tests for L{OpenSSL.crypto.CRL}
    cCs9tƒ}|jt|tƒƒ|j|jƒdƒdS(s^
        Confirm we can create L{OpenSSL.crypto.CRL}.  Check
        that it is empty
        N(R RIRJRYtget_revokedR`(R=tcrl((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyROr	s	cCs=|jttdƒ|jttdƒ|jttdƒdS(s|
        Calling L{OpenSSL.crypto.CRL} with any number of arguments
        results in a L{TypeError} being raised.
        iR2N(RSR_R R`(R=((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyR»|	scCsztƒ}tƒ}ttjƒjdƒƒ}|j|ƒ|jtdƒƒ|jtdƒƒ|j	|ƒ|j
|j|jddƒ}t
|dddƒ}|jtd	ƒƒ|jtd
ƒƒ|jtdƒƒ|j
|j|jtƒ}t
|ddddd
ƒ}|jtd	ƒƒ|jtd
ƒƒ|jtdƒƒ|j
|j|jdtƒ}|j||ƒdS(sÀ
        Use python to create a simple CRL with a revocation, and export
        the CRL in formats of PEM, DER and text.  Those outputs are verified
        with the openssl program.
        s
%Y%m%d%H%M%SZt3abt
sUpErSeDEdR/iRÔs-noouts-textsSerial Number: 03ABt
Supersededs:Issuer: /C=US/ST=IL/L=Chicago/O=Testing/CN=Testing Root CAs-informRˆRKN(R R!R)RR9R:RÄRÁRÉtadd_revokedR'R«R0R4tindexRRRY(R=RÔRºR9t
dumped_crlReRŽ((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_export†	s&		

cCsFtƒ}tƒ}|jd|ƒ|jt|jƒdtƒƒdS(st
        L{OpenSSL.CRL.add_revoked} accepts its single argument as the
        I{revoked} keyword argument.
        RºiN(R R!RØRIRJRÓ(R=RÔRº((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_add_revoked_keyword§	s		cCsétƒ}|jt|jƒ|jt|j|jƒ|jt|j|j|jtddƒ|jt|jd|jtdƒ|jt|j|jdtdƒ|jt|j|j|jddƒ|jt|j|jtdƒdS(s
        Calling L{OpenSSL.CRL.export} with fewer than two or more than
        four arguments, or with arguments other than the certificate,
        private key, integer file type, and integer number of days it
        expects, results in a L{TypeError} being raised.
        i
R^N(R RSR_R'R«R0RR`(R=RÔ((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_export_wrong_args²	s	(""%cCs2tƒ}|jt|j|j|jddƒdS(s»
        Calling L{OpenSSL.CRL.export} with a file type other than
        L{FILETYPE_PEM}, L{FILETYPE_ASN1}, or L{FILETYPE_TEXT} results
        in a L{ValueError} being raised.
        idi
N(R RSRR'R«R0(R=RÔ((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_export_unknown_filetypeÄ	s	cCs[tƒ}tƒ}ttjƒjdƒƒ}|j|ƒ|jtdƒƒ|j|ƒ|jtdƒƒ|j	tdƒƒ|j|ƒ|j
ƒ}|jt|ƒdƒ|jt
|dƒtƒ|jt
|dƒtƒ|j|djƒtdƒƒ|j|djƒtd	ƒƒ|j|djƒ|ƒ|j|djƒ|ƒd
S(s£
        Use python to create a simple CRL with two revocations.
        Get back the L{Revoked} using L{OpenSSL.CRL.get_revoked} and
        verify them.
        s
%Y%m%d%H%M%SZRÕt100RÖiiit03ABt0100N(R R!R)RR9R:RÄRÁRØRÉRÓRYR5RKR·R¸(R=RÔRºR9trevs((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_get_revokedÎ	s"		


  cCsktƒ}|jt|jdƒ|jt|jdƒ|jt|jdƒ|jt|jdddƒdS(sw
        Calling L{OpenSSL.CRL.get_revoked} with any arguments results
        in a L{TypeError} being raised.
        iR2N(R RSR_RÓR`(R=RÔ((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_get_revoked_wrong_argsé	s
	cCsRtƒ}|jt|jƒ|jt|jddƒ|jt|jddƒdS(s
        Calling L{OpenSSL.CRL.add_revoked} with other than one
        argument results in a L{TypeError} being raised.
        iiR^R~N(R RSR_RØ(R=RÔ((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_add_revoked_wrong_argsõ	s	cCsotttƒ}|jƒ}|jt|ƒdƒ|j|djƒtdƒƒ|j|djƒd
ƒ|j|djƒtdƒƒ|j|djƒtdƒƒt
tddd	ƒ}tt|ƒ}|jƒ}|jt|ƒdƒ|j|djƒtdƒƒ|j|djƒd
ƒ|j|djƒtdƒƒ|j|djƒtdƒƒd
S(sm
        Load a known CRL and inspect its revocations.  Both
        PEM and DER formats are loaded.
        iiRàiRáR×RÔs-outformRˆN(R"RtcrlDataRÓRYR5R·R)R¹R`R4R(R=RÔRâR¦((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyt
test_load_crl
s     cCs@|jttƒ|jtttƒ|jttttdƒdS(s‚
        Calling L{OpenSSL.crypto.load_crl} with other than two
        arguments results in a L{TypeError} being raised.
        N(RSR_R"RRæR`(R=((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_load_crl_wrong_args
scCs|jttdtƒdS(sn
        Calling L{OpenSSL.crypto.load_crl} with an unknown file type
        raises a L{ValueError}.
        idN(RSRR"Ræ(R=((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_load_crl_bad_filetype!
scCs|jtttdƒdS(sƒ
        Calling L{OpenSSL.crypto.load_crl} with file data which can't
        be loaded raises a L{OpenSSL.crypto.Error}.
        shello, worldN(RSRR"R(R=((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_load_crl_bad_data)
s(RwRxRyRRRR«RRR0ROR»RÛRÜRÝRÞRãRäRåRçRèRéRê(((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyRÒk	s 	
	
	!			
					
	tSignVerifyTestscBseZdZd„ZRS(sH
    Tests for L{OpenSSL.crypto.sign} and L{OpenSSL.crypto.verify}.
    c	Csðtdƒ}tttƒ}tttƒ}tttƒ}x{ddgD]m}t|||ƒ}t||||ƒ|j	t
t||||ƒ|j	t
t|||tdƒ|ƒqFW|j	tt||dƒ|j	tt|||dƒdS(sX
        L{sign} generates a cryptographic signature which L{verify} can check.
        s6It was a bright cold day in April, and the clocks were striking thirteen. Winston Smith, his chin nuzzled into his breast in an effort to escape the vile wind, slipped quickly through the glass doors of Victory Mansions, though not quickly enough to prevent a swirl of gritty dust from entering along with him.RëRbttaintedsstrange-digestN(R)RRRmRRARBR%R&RSRR(R=tcontenttpriv_keyt	good_certtbad_certRìtsig((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyttest_sign_verify5
s 	(RwRxRyRò(((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyRë1
st__main__(URytunittestRRdtret
subprocessRRRRtOpenSSL.cryptoRRRRR	R
RRR
RRRRRRRRRRRRRRRRRRR R!R"R#R$R%R&tOpenSSL.test.utilR'R(R)R+R,RARmRBRCR<RôRRR”RsRoR˜RæRªR.RzR„R­RºRÃRtcompileRWRURYR^R4RlR›R®RµRÒRëRw(((s</usr/lib/python2.7/dist-packages/OpenSSL/test/test_crypto.pyt<module>sŠ("												ëmÓBoÿøÿC			òt/oÆ-

Youez - 2016 - github.com/yon3zu
LinuXploit