aboutsummaryrefslogtreecommitdiff
path: root/wqflask/utility
diff options
context:
space:
mode:
authorBonfaceKilz2020-10-28 23:14:35 +0300
committerBonfaceKilz2020-10-28 23:14:35 +0300
commitca22bbfdd36351e2b7d8f346b5a3ab81c94f7203 (patch)
treee53b8e22efab4f4a85e5c078063894a88d32ccfc /wqflask/utility
parent2120392705c6aa652bab280e98c84b9c33bc5902 (diff)
downloadgenenetwork2-ca22bbfdd36351e2b7d8f346b5a3ab81c94f7203.tar.gz
Use latin-1 encoding when converting hmac secret to bytes
* wqflask/utility/hmac.py (hmac_creation): Use latin-1 when serializing the hmac secret. This ensures that the behaviour of *verify_cookie* remains the same as in the python2 tip.
Diffstat (limited to 'wqflask/utility')
-rw-r--r--wqflask/utility/hmac.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/wqflask/utility/hmac.py b/wqflask/utility/hmac.py
index 6623f69a..29891677 100644
--- a/wqflask/utility/hmac.py
+++ b/wqflask/utility/hmac.py
@@ -10,7 +10,7 @@ def hmac_creation(stringy):
"""Helper function to create the actual hmac"""
secret = app.config['SECRET_HMAC_CODE']
- hmaced = hmac.new(bytearray(secret, "utf-8"),
+ hmaced = hmac.new(bytearray(secret, "latin-1"),
bytearray(stringy, "utf-8"),
hashlib.sha1)
hm = hmaced.hexdigest()