Skip to content

Commit c05dff2

Browse files
committed
Update __init__.py
hmac.new expects key to be a bytearray
1 parent 77098c5 commit c05dff2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

oauth2/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ def sign(self, request, consumer, token):
903903
"""Builds the base signature string."""
904904
key, raw = self.signing_base(request, consumer, token)
905905

906-
hashed = hmac.new(key, raw, sha)
906+
hashed = hmac.new(key.encode('bytearray'), raw, sha)
907907

908908
# Calculate the digest base 64.
909909
return binascii.b2a_base64(hashed.digest())[:-1]

0 commit comments

Comments
 (0)