aboutsummaryrefslogtreecommitdiff
path: root/wqflask/utility/hmac.py
diff options
context:
space:
mode:
authorzsloan2020-10-29 14:35:09 -0500
committerzsloan2020-10-29 14:35:09 -0500
commit7c1c9e2a519ba662e9f293eea73eb7922b2160e4 (patch)
treef6d4db465d338c1433bbb126e911062a6c31748b /wqflask/utility/hmac.py
parent5a1f69aa85809768577069ae63d92c9ef6aecc02 (diff)
parent6e6911b466c2727b16a190d8b714f55d7842d7e2 (diff)
downloadgenenetwork2-7c1c9e2a519ba662e9f293eea73eb7922b2160e4.tar.gz
Merge branch 'testing' of github.com:genenetwork/genenetwork2 into reaper_bootstrap_fix
Diffstat (limited to 'wqflask/utility/hmac.py')
-rw-r--r--wqflask/utility/hmac.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/wqflask/utility/hmac.py b/wqflask/utility/hmac.py
index fd75803e..29891677 100644
--- a/wqflask/utility/hmac.py
+++ b/wqflask/utility/hmac.py
@@ -1,5 +1,3 @@
-from __future__ import print_function, division, absolute_import
-
import hmac
import hashlib
@@ -12,7 +10,9 @@ def hmac_creation(stringy):
"""Helper function to create the actual hmac"""
secret = app.config['SECRET_HMAC_CODE']
- hmaced = hmac.new(secret, stringy, hashlib.sha1)
+ hmaced = hmac.new(bytearray(secret, "latin-1"),
+ bytearray(stringy, "utf-8"),
+ hashlib.sha1)
hm = hmaced.hexdigest()
# ZS: Leaving the below comment here to ask Pjotr about
# "Conventional wisdom is that you don't lose much in terms of security if you throw away up to half of the output."