changeset 3631:6907fd1613a5

fix the second hmac use for python 2.4
author Johannes Berg <johannes AT sipsolutions DOT net>
date Wed, 21 May 2008 22:05:40 +0200
parents a53307694ba3
children f00bf7ef6ee8
files MoinMoin/user.py
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/user.py	Tue May 20 23:17:24 2008 +0200
+++ b/MoinMoin/user.py	Wed May 21 22:05:40 2008 +0200
@@ -22,8 +22,7 @@
 # add names here to hide them in the cgitb traceback
 unsafe_names = ("id", "key", "val", "user_data", "enc_password", "recoverpass_key")
 
-import os, time, sha, codecs
-import hmac, sha
+import os, time, sha, codecs, hmac
 
 from MoinMoin import config, caching, wikiutil, i18n, events
 from MoinMoin.util import timefuncs, filesys, random_string
@@ -1039,7 +1038,7 @@
         if stamp + 12*60*60 < time.time():
             return False
         # check hmac
-        h = hmac.new(self.recoverpass_key, str(stamp), sha.new).hexdigest()
+        h = hmac.new(self.recoverpass_key, str(stamp), sha).hexdigest()
         if h != parts[1]:
             return False
         self.recoverpass_key = ""