PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB` giddlmZmZmZmZddlZddlZddlZddlm Z ddl m Z m Z m Z mZmZmZmZmZmZmZddlmZmZmZmZddlmZd d gZd Zdd Zd Zy))unicode_literalsdivisionabsolute_importprint_functionN) Certificate) array_from_pointerbuffer_from_bytesbytes_from_buffercastderefis_nullnewnullstruct_from_bufferunwrap)crypt32 Crypt32Const get_error handle_error)str_clsextract_from_system system_pathcy)NrI/opt/nydus/tmp/pip-target-bkdi07qp/lib/python/oscrypto/_win/trust_list.pyrrs rc i}i}tjj}dD]}tjt |}t |t } tj ||}t|rnXt|}d} d} d} |jtjk7rSt|jt|j} t!j"| j%} | |vrd|| <t|j&} t)| j*} tjj-| }||kDr |r|t/j0| d t)| j6} tjj-|}||kr |r|t/j0| ds t=}t=}t?td d}tj@|tjBt |}tE\}}|s|tjFk7r t ||tjFk(rd} ntItK|}tj@|tjBtMtd ||}t |tOtd |}t|}|jPdk(r |r|t/j0| d tStd|jT|jP}|D]"}|jW|jYd$d}| sTt/j0| }|jZr3|jZD]$}|j\}||vs|jW|&|r"|s |t/j0| }||d| ||f|| <{tj^|d} t | d}|jaS#t2t4f$rYwxYw#t2t4f$rH}|dkr8|j8ddzt;|z}|f|j8d dz|_|Yd}~d}~wwxYw)a Extracts trusted CA certificates from the Windows certificate store :param cert_callback: A callback that is called once for each certificate in the trust store. It should accept two parameters: an asn1crypto.x509.Certificate object, and a reason. The reason will be None if the certificate is being exported, otherwise it will be a unicode string of the reason it won't. :param callback_only_on_failure: A boolean - if the callback should only be called when a certificate is not exported. :raises: OSError - when an error is returned by the OS crypto library :return: A list of 3-element tuples: - 0: a byte string of a DER-encoded certificate - 1: a set of unicode strings that are OIDs of purposes to trust the certificate for - 2: a set of unicode strings that are OIDs of purposes to reject the certificate for )ROOTCATFNz not yet validzno longer validrz - rzDWORD *zCERT_ENHKEY_USAGE *CERT_ENHKEY_USAGEzexplicitly distrustedLPCSTRascii)1datetimeutcnowrCertOpenSystemStoreWrrCertEnumCertificatesInStorerrdwCertEncodingTyperX509_ASN_ENCODINGr pbCertEncodedint cbCertEncodedhashlibsha1digest pCertInfo_convert_filetime_to_timestamp NotBefore fromtimestamprload ValueErrorOSErrorNotAfterargsrsetrCertGetEnhancedKeyUsage%CERT_FIND_PROP_ONLY_ENHKEY_USAGE_FLAGrCRYPT_E_NOT_FOUNDr r r rcUsageIdentifierr rgpszUsageIdentifieradddecodeextended_key_usage_valuedottedCertCloseStorevalues)! cert_callbackcallback_only_on_failure certificates processednowstore store_handlecontext_pointercontext trust_alldatar0 cert_infonot_before_seconds not_beforenot_after_seconds not_afteremessage trust_oids reject_oidsto_readres error_code_ usage_bufferkey_usage_pointer key_usageoidsoidcertcert_oidresults! rrr#sA4LI    " " $CE33DFEB \"&%AA,P_`O'_-GIDF))\-K-KK$W%:%:C@U@UOP#J%K'9a0G11BB C&KMJ:)G)GGS!\;;; 0w@ 55# FF"7F  S!$6w@SUa$b!"#45 --2$%k&6&6t&<>UV)22..   8CNN3::g#678D "''-00$($A$A1&ooj0'OOC01 %=<&++D1DdD)$(*k#BL y|'' a8V KEN     M(   (  %q(ffQi%/':K2LLG%Z!&&*4AFG) s,0AP AP$P! P!$Q;3=Q66Q;ctjdtjd|j|jd}|dz }|dz S)a Windows returns times as 64-bit unsigned longs that are the number of hundreds of nanoseconds since Jan 1 1601. This converts it to a datetime object. :param filetime: A FILETIME struct object :return: An integer unix timestamp s>Qs>LLril!l )structunpackpackdwHighDateTime dwLowDateTime)filetimehundreds_nano_secondsseconds_since_1601s rr2r2sY#MM    # #  " "  /9  ++r)NF) __future__rrrrr%r.rg_asn1r_ffir r r r r rrrrr_crypt32rrrr_typesr__all__rrr2rrrrusRRR    ED  f!R,r