diff --git a/rhodecode/lib/encrypt.py b/rhodecode/lib/encrypt.py --- a/rhodecode/lib/encrypt.py +++ b/rhodecode/lib/encrypt.py @@ -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):