/usr/lib64/python2.6/site-packages/OpenSSL/test
NameSizeModeActions
test_crypto.py597380644editdlrm
test_crypto.pyc575600644editdlrm
test_crypto.pyo575600644editdlrm
test_rand.py22640644editdlrm
test_rand.pyc28530644editdlrm
test_rand.pyo28530644editdlrm
test_ssl.py307970644editdlrm
test_ssl.pyc292630644editdlrm
test_ssl.pyo291720644editdlrm
util.py48340644editdlrm
util.pyc55130644editdlrm
util.pyo55130644editdlrm
__init__.py1170644editdlrm
__init__.pyc2160644editdlrm
__init__.pyo2160644editdlrm
Edit: /usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyc (57560B)
|Jc@sdZddklZddkZddkZddklZddklZlZddkl Z l Z l Z l Z l Z ddklZlZlZlZddklZlZdd klZlZdd klZlZdd klZlZlZdd klZlZdd klZlZddklZl Z ddkl!Z!l"Z"l#Z#ddkl$Z$l%Z%ddk&l'Z'dZ(dZ)dZ*dZ+dZ,dZ-dZ.dZ/dZ0dZ1dZ2dZ3de'fdYZ4de'fdYZ5d e'fd!YZ6d"fd#YZ7d$e'e7fd%YZ8d&e'e7fd'YZ9d(e'fd)YZ:ei;d*Z<ei;d+Z=d,Z>d-Z?d.Z@d/e'fd0YZAd1e'fd2YZBd3e'fd4YZCeDd5jo endS(6s# Unit tests for L{OpenSSL.crypto}. i(tmainN(tpopen2(tdatetimet timedelta(tTYPE_RSAtTYPE_DSAtErrortPKeytPKeyType(tX509tX509TypetX509Namet X509NameType(tX509Reqt X509ReqType(t X509ExtensiontX509ExtensionType(tload_certificatetload_privatekey(t FILETYPE_PEMt FILETYPE_ASN1t FILETYPE_TEXT(tdump_certificatetload_certificate_request(tdump_certificate_requesttdump_privatekey(t PKCS7Typetload_pkcs7_data(t PKCS12Typet load_pkcs12tPKCS12(t NetscapeSPKItNetscapeSPKIType(tTestCases2-----BEGIN CERTIFICATE----- MIIC7TCCAlagAwIBAgIIPQzE4MbeufQwDQYJKoZIhvcNAQEFBQAwWDELMAkGA1UE BhMCVVMxCzAJBg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Bvc3QxLmNv bYIBADANBgkqhkiG9w0BAQQFAAOBgQA7/CqT6PoHycTdhEStWNZde7M/2Yc6BoJu VwnW8YxGO8Sn6UJ4FeffZNcYZddSDKosw8LtPOeWoK3JINjAk5jiPQ2cww++7QGG /g5NDjxFZNDJP1dGiLAxPW6JXwov4v0FmdzfLOZ01jDcgQQZqEpYlgpuI5JEWUQ9 Ho4EzbYCOaEAMQA= -----END PKCS7----- t X509ExtTestscBseZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZRS(s4 Tests for L{OpenSSL.crypto.X509Extension}. cCst|_|iitdt|_|ii|id|ii_t |_ |i i|_ |iii|i _|i i |i |i i|it iid}t itddid}|i i||i i|dS(s Create a new private key and start a certificate request (for a test method to finish in one way or another). is Yoda root CAs %Y%m%d%H%M%SZtdaysidN(Rtpkeyt generate_keyRR treqt set_pubkeyt get_subjectt commonNameR tx509tsubjectt set_issuerRtnowtstrftimeRt set_notBeforet set_notAfter(tselfR.texpire((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pytsetUps   "cCs-|itt|itddtddS(s L{X509Extension} and L{X509ExtensionType} refer to the same type object and can be used to create instances of that type. RtbasicConstraintssCA:trueN(tassertIdenticalRRtassertConsistentTypetTrue(R2((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyt test_typescCstdtd}|it|td|t|tftdtd}|it|td|t|tfdS(s L{X509Extension} accepts an extension type name, a critical flag, and an extension value and returns an L{X509ExtensionType} instance. R5sCA:trues%r is of type %r, should be %rt nsCommentspyOpenSSL unit testN(RR8t assertTruet isinstanceRttypetFalse(R2tbasictcomment((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_construction s  cCsO|ittdtd|ittdtd|ittdtddS(sj L{X509Extension} raises something if it is passed a bad extension name or value. t thisIsMadeUpthiR5s blah blaht proxyCertInfos4language:id-ppl-anyLanguage,pathlen:1,policy:text:ABN(t assertRaisesRRR>R8(R2((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_invalid_extensions cCsNtdtd}|i|itdtd}|i|idS(so L{X509ExtensionType.get_critical} returns the value of the extension's critical flag. R5sCA:trueN(RR8R;t get_criticalR>t assertFalse(R2text((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_get_critical1scCsTtdtd}|i|idtdtd}|i|iddS(s{ L{X509ExtensionType.get_short_name} returns a string giving the short type name of the extension. R5sCA:trueR:sfoo barN(RR8t assertEqualtget_short_name(R2RI((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_get_short_name<scCstdtdd|i}|ii|g|ii|idtt|i}|id|j|id|jdS(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. R5sCA:TRUER,tsha1sX509v3 Basic Constraints:N( RR>R+tadd_extensionstsignR%RRR;(R2text1ttext((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_unused_subjectGs cCsmtdtdd|i}|ii|g|ii|idtt|i}|id|jdS(s~ If an extension requires a subject, the C{subject} parameter to L{X509Extension} provides its value. tsubjectKeyIdentifierthashR,RNsX509v3 Subject Key Identifier:N( RR>R+RORPR%RRR;(R2text3RR((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyt test_subjectUs cCs|ittdtddS(s If an extension requires a subject and the C{subject} parameter is given no value, something happens. RTRUN(RERRR>(R2((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_missing_subjectasc CsFx?ttdg|gD]%}|ittdtdd|qWdS(s If the C{subject} parameter is given a value which is not an L{X509} instance, L{TypeError} is raised. thelloR5sCA:TRUER,N(R8tobjectREt TypeErrorRR>(R2tbadObj((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_invalid_subjectjs cCstdtdd|i}|ii|g|ii|idtt|i}|id|j|id|jdS(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. R5sCA:TRUEtissuerRNsX509v3 Basic Constraints:N( RR>R+RORPR%RRR;(R2RQRR((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_unused_issuervs cCstdtdd|i}|ii|g|ii|idtt|i}|id|j|id|jdS(s| If an extension requires a issuer, the C{issuer} parameter to L{X509Extension} provides its value. tauthorityKeyIdentifiers issuer:alwaysR^RNs X509v3 Authority Key Identifier:sDirName:/CN=Yoda root CAN( RR>R+RORPR%RRR;(R2text2RR((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyt test_issuers  cCs|ittdtddS(s} If an extension requires an issue and the C{issuer} parameter is given no value, something happens. R`skeyid:always,issuer:alwaysN(RERRR>(R2((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_missing_issuersc CsFx?ttdg|gD]%}|ittdtdd|qWdS(s If the C{issuer} parameter is given a value which is not an L{X509} instance, L{TypeError} is raised. RYR`skeyid:always,issuer:alwaysR^N(R8RZRER[RR>(R2R\((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_invalid_issuers (t__name__t __module__t__doc__R4R9RARFRJRMRSRWRXR]R_RbRcRd(((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyR#s      t PKeyTestscBsMeZdZdZdZdZdZdZdZdZ RS(s0 Unit tests for L{OpenSSL.crypto.PKey}. cCs$|itt|itddS(s L{PKey} and L{PKeyType} refer to the same type object and can be used to create instances of that type. RN(R6RRR7(R2((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyR9scCsL|ittdt}|it|td|t|tfdS(sP L{PKey} takes no arguments and returns a new L{PKey} instance. s%r is of type %r, should be %rN(RER[RtNoneR;R<RR=(R2tkey((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyRAs   cCs9t}|i|id|i|iddS(sh L{PKeyType.bits} and L{PKeyType.type} return C{0} before the key is generated. iN(RRKR=tbits(R2Rj((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_pregenerations cCst}|it|i|it|iddd|it|idd|it|idd|it|itd|it|itddS( 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. iiitfootbariiN(RRER[R&Rt ValueErrorR(R2Rj((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_failedGenerations cCsOd}t}|it||i|it|i|i|dS(s L{PKeyType.generate_key} generates an RSA key when passed L{TYPE_RSA} as a type and a reasonable number of bits. iN(RR&RRKR=Rk(R2RkRj((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_rsaGenerations  cCsOd}t}|it||i|it|i|i|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(RR&RRKR=Rk(R2RkRj((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_dsaGenerations  cCsrt}xbtdftdfgD]H\}}|i|||i|i||i|i|q"WdS(su L{PKeyType.generate_key} can be called multiple times on the same key to generate new keys. ii@N(RRRR&RKR=Rk(R2RjR=Rk((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_regeneration s   ( ReRfRgR9RARlRpRqRrRs(((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyRhs # t X509NameTestscBs_eZdZdZdZdZdZdZdZdZ dZ d Z RS( s4 Unit tests for L{OpenSSL.crypto.X509Name}. cKsVti}|i}|idx$|D]\}}t|||q2W|S(NcSs%|\}}|\}}t||S((tcmp(t.0t.1tk1tv1tk2tv2((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyt!s(R R)titemstsorttsetattr(R2tattrstnametktv((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyt _x509names  cCsu|itt|itid|ittt|i}|it|td|t|tfdS(sB The type of X509Name objects is L{X509NameType}. R s%r is of type %r, should be %rN( R6R R RKReR;R<R=R(R2R((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyR9's  cCs|i}d|_|i|id|i|idd|_|i|id|i|idd|_|i|id|i|idd|_|i|id|i|iddS(si L{X509NameType} instances have attributes for each standard (?) X509Name field. RmtbazRntquuxN(RR*RKtCN(R2R((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_attributes6s     cCs|idddd}t|}|i|id|i|idd|_|i|idd|_|i|iddS(s L{X509Name} creates a new L{X509NameType} instance with all the same attributes as an existing L{X509NameType} instance when called with one. R*Rmt emailAddresssbar@example.comRsquux@example.comN(RR RKR*R(R2Rtcopy((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyt test_copyJs   cCs2|idddd}|it|ddS(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. R*RmRRns,N(RRKtrepr(R2R((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyt test_repr_s c sdfd}i}||||ii|iddidd|iddidd|iddddiddddfd }|iddidd|iddiddd fd }|idd idd fd}|idd idd dS(sO L{X509NameType} instances should compare based on their NIDs. cSsQ|||jd||f|||j|||j|||jdS(Ns(%r == %r) --> False((tatbR;RH((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyt _equalityoscs||iidS(N(R;RH(RR(RR2(s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyRKusR*RmRtorganizationalUnitNameRntOUcs||iidS(N(RHR;(RR(RR2(s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pytassertNotEqualscSs|||j|||j|||j|||j|||j|||j|||j|||jdS(N((RRR;RH((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyt _inequalityscs||iidS(N(R;RH(RR(R2R(s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pytassertLessThanstabctdefcs||iidS(N(RHR;(RR(R2R(s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pytassertGreaterThansN(R(R2RKRRRR((R2RRs>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_comparisonks.    cCsi|idd}|idd}|i|i|id|_|i|i|idS(sb L{X509Name.hash} returns an integer hash based on the value of the name. RRmRnN(RRKRURR(R2RR((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyt test_hashs  cCs2|idddd}|i|iddS(sK L{X509Name.der} returns the DER encoded form of the name. RRmtCtUSs01 0 UUS1 0 UfooN(RRKtder(R2R((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_ders cCsm|i}|i|igd|_|i|idgd|_|i|iddgdS( 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. RmRRnRN(sCNsfoo(sCNsfoo(sOUsbar(RRKtget_componentsRR(R2R((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_get_componentss    ( ReRfRgRR9RRRRRRR(((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyRts    K t_PKeyInteractionTestsMixincBs)eZdZdZdZdZRS(s7 Tests which involve another thing and a PKey. cCs tdS(s[ Return something with a C{set_pubkey}, C{set_pubkey}, and C{sign} method. N(tNotImplementedError(R2((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pytsignablescCs2|i}t}|it|i|ddS(sY L{X509Req.sign} raises L{ValueError} when pass a L{PKey} with no parts. tMD5N(RRRERoRP(R2trequestRj((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_signWithUngenerateds  cCs[|i}t}|itd|i||i}|it|i|ddS(s{ L{X509Req.sign} raises L{ValueError} when pass a L{PKey} with no private part as the signing key. iRN( RRR&RR(t get_pubkeyRERoRP(R2RRjtpub((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_signWithPublicKeys     (ReRfRgRRR(((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyRs  t X509ReqTestscBs;eZdZdZdZdZdZdZRS(s. Tests for L{OpenSSL.crypto.X509Req}. cCstS(s5 Create and return a new L{X509Req}. (R (R2((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyRscCs$|itt|itddS(s L{X509Req} and L{X509ReqType} refer to the same type object and can be used to create instances of that type. R N(R6R RR7(R2((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyR9 scCs9t}|it|td|t|tfdS(sW L{X509Req} takes no arguments and returns an L{X509ReqType} instance. s%r is of type %r, should be %rN(R R;R<RR=(R2R((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyRAs  cCsit}|i|id|id|i|id|id|i|iddS(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(R RKt get_versiont set_version(R2R((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyt test_versions    cCst}|i}|it|td|t|tfd|_|i|iid~d|_|i|iddS(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 %rRmRnN(R R)R;R<R R=R*RK(R2RR,((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_get_subject*s     (ReRfRgRR9RARR(((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyRs   t X509TestscBsreZdZeeZdZdZdZdZ dZ dZ dZ dZ d Zd ZRS( s+ Tests for L{OpenSSL.crypto.X509}. cCstS(s2 Create and return a new L{X509}. (R (R2((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyRCscCs$|itt|itddS(s L{X509} and L{X509Type} refer to the same type object and can be used to create instances of that type. R N(R6R R R7(R2((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyR9JscCst}|it|td|t|tf|ittid|it|id|it|t|it|tdS(sT L{X509} takes no arguments and returns an instance of L{X509Type}. s%r is of type %r, should be %rR=R N(R R;R<R R=RKRe(R2t certificate((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyRASs    cCst}|it|i|it|idd|it|id|it|id|i|id|id|i|id|id |i|id |id|i|id|id|i|idd 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@iNIIIIlllll l l l (R RER[tset_serial_numberRKtget_serial_number(R2R((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_serial_numbercs     cCst}t|d|}t|d|}|i|dd}|||i||d}|||i||d}|||i|||it|ddS(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 tgetattrRKRiRERo(R2twhichRtsettgettwhen((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyt _setBoundTestxs    cCs|iddS(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(R2((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_set_notBeforescCs|iddS(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(R2((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_set_notAfterscCs,tt|i}|i|iddS(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(RRtpemDataRKt get_notBefore(R2tcert((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_get_notBeforescCs,tt|i}|i|iddS(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(RRRRKt get_notAfter(R2R((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_get_notAfterscCs&t}|i|idddS(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 RKtdigest(R2R((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyt test_digests  (ReRfRgtcleartextCertificatePEMtcleartextPrivateKeyPEMRRR9RARRRRRRR(((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyR=s     t PKCS12TestscBseZdZeeZdZdZdZdZ dZ dddddZ ddddddZ d Zd Zd Zd Zd ZdZdZdZdZdZdZRS(sN Test for L{OpenSSL.crypto.PKCS12} and L{OpenSSL.crypto.load_pkcs12}. cCs$|itt|itddS(s1 L{PKCS12Type} is a type object. RN(R6RRR7(R2((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyR9scCset}|id|i|id|i|id|i|id|idS(s L{PKCS12} returns a new instance of L{PKCS12} with no certificate, private key, CA certificates, or friendly name. N(RRKRitget_certificatetget_privatekeytget_ca_certificatestget_friendlyname(R2tp12((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_empty_constructions  cCs$t}|it|id|it|it|it|it|it|id|it|id|it|it|it|id|it|it|it|id|it|itf|it|id|it|id 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. itlegboneiiRmRnN(ii(sfoosbar( RRER[tset_certificateRR tset_privatekeytset_ca_certificatestset_friendlyname(R2R((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_type_errorss c Csd}t}ttt}|i||id|i|i||iy"|i d|dddd}Wnt j odSXt ||}|id|i |id|i|i t|ittdfdS(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(RRRRRRKRiRRtexportRRRR;R<RR=(R2tpasswdRR%t dumped_p12((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyt test_key_onlys  "c Csd}t}ttt}|i||i||i|id|iy"|i d|dddd}Wnt j odSXt ||}|id|i|i t |ittdf|ittt|iddS( s A L{PKCS12} with only a certificate can be exported using L{PKCS12.export} and loaded again using L{load_pkcs12}. RRRiRiNi(RRRRRRKRRiRRRRR;R<R R=RR(R2RRRR((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_cert_onlys   "(cCst}|o,|itt|}|i|dn|o,|itt|}|i|dn|o/|itt|f}|i|dn|o#|i |}|i|dn|S(sx Generate a PKCS12 object with components from PEM. Verify that the set functions return None. N( RRRRRKRiRRRR(R2tcert_pemtkey_pemtca_pemt friendly_nameRtret((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyt gen_pkcs127s tc Cs|oAt|ddddd||}|i|t| |n|oDt|ddddd|d|}|i|t| |n|oDt|ddddd|d|}|i|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 _runopensslRKtlen( R2tp12_strRjRtcaRtextrat recovered_keytrecovered_cert((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pytcheck_recoveryLscCsd}tt}t|ddddd|}t||}|it|ttt|i }|i |tt t|i }|i |t|i d|idS(s A PKCS12 string generated using the openssl command line can be loaded with L{load_pkcs12} and its components extracted and examined. twhateverRs-exports-clcertss-passoutspass:N(tclient_key_pemtclient_cert_pemRRR;R<RRRRRKRRRiR(R2RtpemRRRR((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_load_pkcs12cs cCs\d}|ittd|}|i|dddd|it|ddddS(sx L{load_pkcs12} raises L{OpenSSL.crypto.Error} when passed a string which is not a PKCS12 dump. Rs fruit loopsisasn1 encoding routinesiN(RERRRKR(R2Rte((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_load_pkcs12_garbagevscCs |ittt}|ittt|it tt ttt}ttt}|i |g|i dt |i|i ||id|i ||g|i dt |i|i ||id|i ||iddS(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(RRRt root_cert_pemRRRtserver_cert_pemRRtserver_key_pemRRKRR(R2Rt root_certt client_cert((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyt test_replacesc Csd}|ittt}xdd dgD]}|i||i|i||id|dddd}t ||}|i|i|i|i |d td td td |q+Wd 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###RRiRiRjRRRN( RRRRRiRRKRRRR(R2RRRRt reloaded_p12((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_friendly_names c Cs|ittt}d}|iddddd|}|idddddd}|idddd }x<|||gD]+}|i|d td td td |qWdS(sf Test that missing, None, and '' passphrases are identical for PKCS12 export. RRiRiRii iRjRRRN(RRRRRRiR(R2RRtdumped_p12_emptytdumped_p12_nonetdumped_p12_nopwR((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_various_empty_passphrasesscCs<|ittt}|id|id|idS(sg Passing C{None} to L{PKCS12.set_ca_certificates} removes all CA certificates. N(RRRRRRiRKR(R2R((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_removing_ca_certs c Csbd}|ittt}|iddd|dd}|i|dtdtd |d d d S(sb Exporting a PKCS12 with a C{maciter} of C{-1} excludes the MAC entirely. s Lake MichiganRiRRiRjRRRs -nomacverN(s -nomacver(RRRRRR(R2RRR((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_export_without_macs cCs|d}|ittt}|iddd|dd}y)t||}|it|tWnt j onXdS(sQ Loading a PKCS12 without a MAC does something other than crash. s Lake MichiganRiRRiN( RRRRRRR;R<RR(R2RRRt recovered_p12((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_load_without_macscCsvd}|itt}|ig|id |i|id|dd}|i|dtdtd|dS( sN A PKCS12 with an empty CA certificates list can be exported. sHobie 18RRiRjRRN((RRRRRKRRR(R2RRR((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_zero_len_list_for_cas cCsD|ittt}|i}|i|dtdtdddS(sE All the arguments to L{PKCS12.export} are optional. RjRRRN(RRRRRR(R2RR((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_export_without_argss cCs,|ittt}|it|idS(sc L{PKCS12.export} raises an exception when a key and certificate mismatch. N(RRRRRERR(R2R((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_key_cert_mismatchsN((ReRfRgRRRR9RRRRRiRRRRRRRR R R R RR(((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyRs*     #         s(\\*)"s(\\+)\ZcCs&tidtid|}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/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyt cmdLineQuotes cCsditt|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 (tjointmapR(t arguments((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pytquoteArguments s c GstidjoEddig}|D] }|d|iddfq$~}ndt|}t|d\}}|i||i|iS(s Run the command line openssl tool with the given arguments and write the given PEM to its stdin. Not safe for quotes. tposixsopenssl Rs'%s't's'\''R( tosRRtreplaceRRtwritetclosetread(Rtargst_[1]targtcommandRR ((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyR/sE  t FunctionTestscBsheZdZdZdZdZdZdZdZdZ dZ d Z d Z RS( sC Tests for free-functions in the L{OpenSSL.crypto} module. cCs|ittttddS(s L{load_privatekey} raises L{OpenSSL.crypto.Error} when it is passed an encrypted PEM and an incorrect passphrase. tquackN(RERRRtencryptedPrivateKeyPEM(R2((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyt$test_load_privatekey_wrongPassphraseCscCs,tttt}|it|tdS(s~ L{load_privatekey} can create a L{PKey} object from an encrypted PEM string if given the passphrase. N(RRR't encryptedPrivateKeyPEMPassphraseR;R<R(R2Rj((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_load_privatekey_passphraseMs cs?gfd}|itttt||idS(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. csiddS(NR&(tappendRi(R(tcalled(s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pytcb_s N(RERRRR'R;(R2R-((R,s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyt,test_load_privatekey_wrongPassphraseCallbackXs csTgfd}ttt|}|it|t|itgdS(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. csi|tS(N(R+R)(twriting(R,(s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyR-ns N(RRR'R;R<RRKR>(R2R-Rj((R,s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyt'test_load_privatekey_passphraseCallbackgs cCsd}ttt}tt|d|}|it|ttt||}|it|t|i|i |i |i|i |i dS(sU L{dump_privatekey} writes an encrypted PEM when given a passphrase. RmtblowfishN( RRRRR;R<tstrRRKR=Rk(R2RRjRt loadedKey((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_dump_privatekey_passphrasevsc Cstt}tt|}tt|}|i|ttt|}t|ddd}|i||tt|}tt|}|i|ttt|}t|ddd} |i|| dS(s@ L{dump_certificate} writes PEM, DER, and text. R+s-outformtDERs-noouts-textN( RRRRRRKRRR( R2RRt dumped_pemt dumped_dertgood_dertcert2t dumped_pem2t dumped_textt good_text((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_dump_certificates c Csttt}tt|}|i|ttt|}t|ddd}|i||tt|}tt|}|i|ttt|}t|ddd}|i||dS(sA L{dump_privatekey} writes a PEM, DER, and text. trsas-outformR5s-noouts-textN(RRRRRKRRR( R2RjR6R7R8tkey2R:R;R<((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_dump_privatekeysc Csttt}tt|}|i|ttt|}t|ddd}|i||tt|}tt|}|i|ttt|}t|ddd}|i||dS(sJ L{dump_certificate_request} writes a PEM, DER, and text. R's-outformR5s-noouts-textN(RRtcleartextCertificateRequestPEMRRKRRR( R2R'R6R7R8treq2R:R;R<((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_dump_certificate_requestscsdgfd}ttt}tt|d|}|it|t|itgtt|}|it|t |i|i |i |i|i |i dS(s L{dump_privatekey} writes an encrypted PEM when given a callback which returns the correct passphrase. Rmcsi|S(N(R+(R/(R,R(s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyR-s R1N( RRRRR;R<R2RKR8RR=Rk(R2R-RjRR3((RR,s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyt'test_dump_privatekey_passphraseCallbackscCs)ttt}|it|tdS(sm L{load_pkcs7_data} accepts a PKCS#7 string and returns an instance of L{PKCS7Type}. N(RRt pkcs7DataR;R<R(R2tpkcs7((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyttest_load_pkcs7_datas( ReRfRgR(R*R.R0R4R=R@RCRDRG(((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyR%?s       t PKCS7TestscBseZdZdZRS(s! Tests for L{PKCS7Type}. cCs-|ittt|itiddS(s0 L{PKCS7Type} is a type object. tPKCS7N(R;R<RR=RKRe(R2((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyR9s(ReRfRgR9(((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyRHstNetscapeSPKITestscBs eZdZdZdZRS(s3 Tests for L{OpenSSL.crypto.NetscapeSPKI}. cCs$|itt|itddS(s L{NetscapeSPKI} and L{NetscapeSPKIType} refer to the same type object and can be used to create instances of that type. RN(R6RR R7(R2((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyR9scCs#t}|it|tdS(sM L{NetscapeSPKI} returns an instance of L{NetscapeSPKIType}. N(RR;R<R (R2tnspki((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyRAs (ReRfRgR9RA(((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyRJs t__main__(ERgtunittestRRtreRRRtOpenSSL.cryptoRRRRRR R R R R RRRRRRRRRRRRRRRRRRR tOpenSSL.test.utilR!Rt root_key_pemRRRRRRRAR'R)RER#RhRtRRRRtcompileRRRRRR%RHRJRe(((s>/usr/lib64/python2.6/site-packages/OpenSSL/test/test_crypto.pyts\("m"?C