changeset 232:e3bbbcb9aded

crypto: fix missing import / data type
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 15 May 2011 01:32:23 +0200
parents 6f2dc5677639
children 8bfab90d4621
files MoinMoin/util/crypto.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/util/crypto.py	Sun May 15 01:26:22 2011 +0200
+++ b/MoinMoin/util/crypto.py	Sun May 15 01:32:23 2011 +0200
@@ -30,6 +30,7 @@
 import hashlib
 import hmac
 import random
+import time
 
 # Note: have the (strong) method that crypt_password() uses at index 0:
 METHODS = ['{SSHA256}', '{SSHA}', '{SHA}', ]
@@ -179,7 +180,7 @@
     if stamp is None:
         stamp = int(time.time())
     h = hmac.new(str(key), str(stamp), digestmod=hashlib.sha1).hexdigest()
-    token = stamp + '-' + h
+    token = str(stamp) + '-' + h
     return key, token