From 7486eea9568bb4fb255a1b3075037b21cf0eac5c Mon Sep 17 00:00:00 2001 From: RhodeCode Admin Date: Wed, 8 Mar 2023 14:56:09 +0100 Subject: [PATCH] encrypt-module: fixed str passed to function that expected bytes --- rhodecode/lib/encrypt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rhodecode/lib/encrypt.py b/rhodecode/lib/encrypt.py index 3e64caa4..06964533 100644 --- 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):