changeset 4492:b74c7ec6addb

merged main
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 16 Jan 2009 12:55:57 +0100
parents b120d9978144 (current diff) eb377776ca34 (diff)
children af211e2f132c 8f8ba97409da
files
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/user.py	Fri Jan 16 12:55:31 2009 +0100
+++ b/MoinMoin/user.py	Fri Jan 16 12:55:57 2009 +0100
@@ -991,7 +991,6 @@
         return msg + '-' + h
 
     def apply_recovery_token(self, tok, newpass):
-        key = self.recoverpass_key
         parts = tok.split('-')
         if len(parts) != 2:
             return False
@@ -1003,7 +1002,8 @@
         if stamp + 12*60*60 < time.time():
             return False
         # check hmac
-        h = hmac_new(self.recoverpass_key, str(stamp)).hexdigest()
+        # key must be of type string
+        h = hmac_new(str(self.recoverpass_key), str(stamp)).hexdigest()
         if h != parts[1]:
             return False
         self.recoverpass_key = ""