##// END OF EJS Templates
encrypt-module: fixed str passed to function that expected bytes
super-admin -
r4946:6cad5217 default
parent child Browse files
Show More
@@ -29,7 +29,7 b' from Crypto.Cipher import AES'
29 from Crypto import Random
29 from Crypto import Random
30 from Crypto.Hash import HMAC, SHA256
30 from Crypto.Hash import HMAC, SHA256
31
31
32 from rhodecode.lib.utils2 import safe_str
32 from rhodecode.lib.str_utils import safe_bytes
33
33
34
34
35 class SignatureVerificationError(Exception):
35 class SignatureVerificationError(Exception):
@@ -57,7 +57,7 b' class AESCipher(object):'
57 self.hmac_size = 32
57 self.hmac_size = 32
58 self.hmac = hmac
58 self.hmac = hmac
59
59
60 self.key = SHA256.new(safe_str(key)).digest()
60 self.key = SHA256.new(safe_bytes(key)).digest()
61 self.hmac_key = SHA256.new(self.key).digest()
61 self.hmac_key = SHA256.new(self.key).digest()
62
62
63 def verify_hmac_signature(self, raw_data):
63 def verify_hmac_signature(self, raw_data):
General Comments 0
You need to be logged in to leave comments. Login now