diff options
author | ianb <devnull@localhost> | 2007-12-17 17:42:42 +0000 |
---|---|---|
committer | ianb <devnull@localhost> | 2007-12-17 17:42:42 +0000 |
commit | de72221d6fd4fd8d9f69cd884cdb1a580b0f86b8 (patch) | |
tree | b4b3201f2a8391f9c49f9c615e73b333b1121788 /paste/auth | |
parent | c6c61ceb5e89641236b228db7222c932c505e3e0 (diff) | |
download | paste-de72221d6fd4fd8d9f69cd884cdb1a580b0f86b8.tar.gz |
Use base64.encode|decodestring, for python 2.3 compatibility
Diffstat (limited to 'paste/auth')
-rw-r--r-- | paste/auth/cookie.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/paste/auth/cookie.py b/paste/auth/cookie.py index 99ca331..5c2ab27 100644 --- a/paste/auth/cookie.py +++ b/paste/auth/cookie.py @@ -131,7 +131,7 @@ class AuthCookieSigner(object): need to be escaped and quoted). The expiration of this cookie is handled server-side in the auth() function. """ - cookie = base64.b64encode( + cookie = base64.encodestring( hmac.new(self.secret, content, sha).digest() + make_time(time.time() + 60*self.timeout) + content).replace("/", "_").replace("=", "~") @@ -144,7 +144,7 @@ class AuthCookieSigner(object): Authenticate the cooke using the signature, verify that it has not expired; and return the cookie's content """ - decode = base64.b64decode( + decode = base64.decodestring( cookie.replace("_", "/").replace("~", "=")) signature = decode[:_signature_size] expires = decode[_signature_size:_header_size] |