Commit f7095caf authored by Laurent Peuch's avatar Laurent Peuch
Browse files

fix(hmac): you need to explicitly pass digestmod to hmac.new in python 3.28

parent d24836491477
......@@ -183,7 +183,7 @@ def authenticate_user(session, tokenid, signed_content, signature):
assert len(rset) == 1
user_eid, secret_key = rset[0]
expected_signature = hmac.new(secret_key.encode('utf-8'),
signed_content).hexdigest()
signed_content, digestmod="md5").hexdigest()
if compare_digest(expected_signature, signature):
return user_eid
else:
......
......@@ -66,7 +66,7 @@ class SignedRequestBaseTC(object):
{'id': id})
assert rset
return hmac.new(rset[0][0].encode('utf-8'),
string_to_sign).hexdigest()
string_to_sign, digestmod="md5").hexdigest()
def _test_header_format(self, method, login, http_method='GET',
signature=None, headers=None,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment