encrypt-module: fixed str passed to function that expected bytes
This commit is contained in:
parent
158f8ca42e
commit
7486eea956
1 changed files with 2 additions and 2 deletions
|
|
@ -29,7 +29,7 @@ from Crypto.Cipher import AES
|
|||
from Crypto import Random
|
||||
from Crypto.Hash import HMAC, SHA256
|
||||
|
||||
from rhodecode.lib.utils2 import safe_str
|
||||
from rhodecode.lib.str_utils import safe_bytes
|
||||
|
||||
|
||||
class SignatureVerificationError(Exception):
|
||||
|
|
@ -57,7 +57,7 @@ class AESCipher(object):
|
|||
self.hmac_size = 32
|
||||
self.hmac = hmac
|
||||
|
||||
self.key = SHA256.new(safe_str(key)).digest()
|
||||
self.key = SHA256.new(safe_bytes(key)).digest()
|
||||
self.hmac_key = SHA256.new(self.key).digest()
|
||||
|
||||
def verify_hmac_signature(self, raw_data):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue