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`  YFTc@sdZddlZddlZddlZejdZejdZdZdefdYZ dZ e ej dd Z dS( sA collection of utilities that facilitate working with Pyzor accounts. Note that accounts are not necessary (on the client or server), as an "anonymous" account always exists.iNcCsm|jjjd}|}|j||j|jd||fjd|jjS(sConverts the key, timestamp (epoch seconds), and msg into a digest. lower(H(H(M) + ':' T + ':' + K)) M is message T is integer epoch timestamp K is hashed_key H is the hash function (currently SHA1) tutf8s:%d:%s(t as_stringtstriptencodetupdatetdigestt hexdigesttlower(t hashed_keyt timestamptmsgthash_R((s1/usr/lib/python2.7/site-packages/pyzor/account.pytsign_msg s   cCs5d||jfjd}||jjS(sReturns the hash key for this username and password. lower(H(U + ':' + lower(K))) K is key (hex string) U is username H is the hash function (currently SHA1) s%s:%sR(RRR(tkeytuserR tresult((s1/usr/lib/python2.7/site-packages/pyzor/account.pythash_keyscCst|d}|d}|d}ttj|tjkrUtjdnt||}|d=t|||}||krtjdndS(sVerify that the provided message is correctly signed. The message must have "User", "Time", and "Sig" headers. If the signature is valid, then the function returns normally. If the signature is not valid, then a pyzor.SignatureError() exception is raised.tTimetUsertSigs#Timestamp not within allowed range.sInvalid signature.N(tinttabsttimetpyzortMAX_TIMESTAMP_DIFFERENCEtSignatureErrorRR (R tuser_keyR Rtprovided_signaturethashed_user_keytcorrect_signature((s1/usr/lib/python2.7/site-packages/pyzor/account.pytverify_signature(s   tAccountcBseZdZRS(cCs||_||_||_dS(N(tusernametsaltR (tselfR R!R ((s1/usr/lib/python2.7/site-packages/pyzor/account.pyt__init__@s  (t__name__t __module__R#(((s1/usr/lib/python2.7/site-packages/pyzor/account.pyR?scCsCy|jd\}}Wntk r8tdnX||fS(Nt,sdInvalid number of parts for key; perhaps you forgot the comma at the beginning for the salt divider?(tsplitt ValueError(tsR!R ((s1/usr/lib/python2.7/site-packages/pyzor/account.pytkey_from_hexstrFs  t(t__doc__RthashlibRtsha1R RRtobjectRR*tanonymous_usertNonetAnonymousAccount(((s1/usr/lib/python2.7/site-packages/pyzor/account.pyts