Show More
@@ -29,7 +29,7 b' from Crypto.Cipher import AES' | |||
|
29 | 29 | from Crypto import Random |
|
30 | 30 | from Crypto.Hash import HMAC, SHA256 |
|
31 | 31 | |
|
32 |
from rhodecode.lib.utils |
|
|
32 | from rhodecode.lib.str_utils import safe_bytes | |
|
33 | 33 | |
|
34 | 34 | |
|
35 | 35 | class SignatureVerificationError(Exception): |
@@ -57,7 +57,7 b' class AESCipher(object):' | |||
|
57 | 57 | self.hmac_size = 32 |
|
58 | 58 | self.hmac = hmac |
|
59 | 59 | |
|
60 |
self.key = SHA256.new(safe_ |
|
|
60 | self.key = SHA256.new(safe_bytes(key)).digest() | |
|
61 | 61 | self.hmac_key = SHA256.new(self.key).digest() |
|
62 | 62 | |
|
63 | 63 | def verify_hmac_signature(self, raw_data): |
General Comments 0
You need to be logged in to leave comments.
Login now