Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
  • Loading branch information...
commit d81b3aa73945496b3061e6db7659b3c9e6ce1296 1 parent 7f5698d
Luke Plant authored

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. 4  django/utils/crypto.py
4  django/utils/crypto.py
@@ -4,7 +4,7 @@
4 4
 import hmac
5 5
 
6 6
 from django.conf import settings
7  
-from django.utils.hashcompat import sha_constructor
  7
+from django.utils.hashcompat import sha_constructor, sha_hmac
8 8
 
9 9
 
10 10
 def salted_hmac(key_salt, value, secret=None):
@@ -28,7 +28,7 @@ def salted_hmac(key_salt, value, secret=None):
28 28
     # the hmac module does the same thing for keys longer than the block size.
29 29
     # However, we need to ensure that we *always* do this.
30 30
 
31  
-    return hmac.new(key, msg=value, digestmod=sha_constructor)
  31
+    return hmac.new(key, msg=value, digestmod=sha_hmac)
32 32
 
33 33
 
34 34
 def constant_time_compare(val1, val2):

0 notes on commit d81b3aa

Please sign in to comment.
Something went wrong with that request. Please try again.