diff MoinMoin/action/cache.py @ 6128:561b7a9c2bd9

fix wrong digestmod of hmac.new calls stdlib default is md5, but we need sha1. this bug was introduced when removing python_compatibility module usage in changeset 500f68d3e2fd594b2f4ea4a272b828a07d9eac1d.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 01 Nov 2016 17:56:32 +0100
parents 500f68d3e2fd
children
line wrap: on
line diff
--- a/MoinMoin/action/cache.py	Mon Oct 31 22:58:54 2016 +0100
+++ b/MoinMoin/action/cache.py	Tue Nov 01 17:56:32 2016 +0100
@@ -28,7 +28,7 @@
 """
 
 from datetime import datetime
-import hmac
+import hmac, hashlib
 
 from MoinMoin import log
 logging = log.getLogger(__name__)
@@ -99,7 +99,7 @@
         raise AssertionError('cache_key called with unsupported parameters')
 
     hmac_data = hmac_data.encode('utf-8')
-    key = hmac.new(secret, hmac_data).hexdigest()
+    key = hmac.new(secret, hmac_data, digestmod=hashlib.sha1).hexdigest()
     return key