summaryrefslogtreecommitdiff
path: root/django/utils/crypto.py
diff options
context:
space:
mode:
authorLuke Plant <L.Plant.98@cantab.net>2010-10-15 11:11:08 +0000
committerLuke Plant <L.Plant.98@cantab.net>2010-10-15 11:11:08 +0000
commitd81b3aa73945496b3061e6db7659b3c9e6ce1296 (patch)
tree37c05d51570add52754802e64d5ca947d2a2a6d7 /django/utils/crypto.py
parent7f5698de1d73399e5e0b9cb0950e964c61046c30 (diff)
Fixed Python 2.4 incompatibility introduced in [14218]
sha_constructor was incorrectly used instead of sha_hmac (which only made a difference under 2.4). Thanks to Steffan Kaminski for report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14233 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/utils/crypto.py')
-rw-r--r--django/utils/crypto.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/utils/crypto.py b/django/utils/crypto.py
index 719dd33d1c..87cd0b9fb0 100644
--- a/django/utils/crypto.py
+++ b/django/utils/crypto.py
@@ -4,7 +4,7 @@ Django's standard crypto functions and utilities.
import hmac
from django.conf import settings
-from django.utils.hashcompat import sha_constructor
+from django.utils.hashcompat import sha_constructor, sha_hmac
def salted_hmac(key_salt, value, secret=None):
@@ -28,7 +28,7 @@ def salted_hmac(key_salt, value, secret=None):
# the hmac module does the same thing for keys longer than the block size.
# However, we need to ensure that we *always* do this.
- return hmac.new(key, msg=value, digestmod=sha_constructor)
+ return hmac.new(key, msg=value, digestmod=sha_hmac)
def constant_time_compare(val1, val2):