Skip to content
Browse files

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...
1 parent dc397ec commit a8192d2fecc79b72cd94e4155568e3ac90f2b853 lukeplant committed Oct 15, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/utils/crypto.py
View
4 django/utils/crypto.py
@@ -4,7 +4,7 @@
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):

0 comments on commit a8192d2

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