/usr/lib/python2.6/site-packages/pyzor-1.0.0-py2.6.egg/pyzor
NameSizeModeActions
engines/-0755rm
hacks/-0755rm
account.py25460755editdlrm
account.pyc34320644editdlrm
client.py108140755editdlrm
client.pyc138220644editdlrm
config.py91670755editdlrm
config.pyc86650644editdlrm
digest.py58790755editdlrm
digest.pyc68260644editdlrm
forwarder.py25680755editdlrm
forwarder.pyc31150644editdlrm
message.py40230755editdlrm
message.pyc96410644editdlrm
server.py157770755editdlrm
server.pyc173190644editdlrm
__init__.py14100755editdlrm
__init__.pyc26530644editdlrm
Edit: /usr/lib/python2.6/site-packages/pyzor-1.0.0-py2.6.egg/pyzor/account.pyc (3432B)
Ñò H<Vc@s‰dZddkZddkZddkZeid„Zeid„Zd„Zdefd„ƒYZ d„Z e ei dd ƒZ dS( s°A 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.iÿÿÿÿNcCsm|iƒiƒidƒ}|ƒ}|i||ƒiƒƒ|id||fidƒƒ|iƒiƒS(sàConverts 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((sG/usr/lib/python2.6/site-packages/pyzor-1.0.0-py2.6.egg/pyzor/account.pytsign_msg s   cCs5d||iƒfidƒ}||ƒiƒiƒS(s³Returns 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((sG/usr/lib/python2.6/site-packages/pyzor-1.0.0-py2.6.egg/pyzor/account.pythash_keyscCs£t|dƒ}|d}|d}ttiƒ|ƒtijotidƒ‚nt||ƒ}|d=t|||ƒ}||jotidƒ‚ndS(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((sG/usr/lib/python2.6/site-packages/pyzor-1.0.0-py2.6.egg/pyzor/account.pytverify_signature(s    tAccountcBseZd„ZRS(cCs||_||_||_dS(N(tusernametsaltR (tselfR R!R ((sG/usr/lib/python2.6/site-packages/pyzor-1.0.0-py2.6.egg/pyzor/account.pyt__init__@s  (t__name__t __module__R#(((sG/usr/lib/python2.6/site-packages/pyzor-1.0.0-py2.6.egg/pyzor/account.pyR?scCsEy|idƒ\}}Wntj otdƒ‚nX||fS(Nt,sdInvalid number of parts for key; perhaps you forgot the comma at the beginning for the salt divider?(tsplitt ValueError(tsR!R ((sG/usr/lib/python2.6/site-packages/pyzor-1.0.0-py2.6.egg/pyzor/account.pytkey_from_hexstrFs t(t__doc__RthashlibRtsha1R RRtobjectRR*tanonymous_usertNonetAnonymousAccount(((sG/usr/lib/python2.6/site-packages/pyzor-1.0.0-py2.6.egg/pyzor/account.pyts