django4 fixes

This commit is contained in:
smile 2022-06-11 21:10:41 +02:00
parent 4bd1b62e64
commit e8fa8f6d13
5 changed files with 9 additions and 9 deletions

View file

@ -26,7 +26,7 @@ def encrypt_ldap_password(cleartext_pw):
# do the encryption
aes = AES.new(key, AES.MODE_CFB, iv)
message = iv + aes.encrypt(cleartext_pw)
message = iv + aes.encrypt(cleartext_pw.encode())
return base64.b64encode(message).decode(), base64.b64encode(key).decode()
@ -46,7 +46,7 @@ def decrypt_ldap_password(message, key):
# decrypt it
aes = AES.new(decoded_key, AES.MODE_CFB, iv)
cleartext_pw = aes.decrypt(ciphertext)
cleartext_pw = aes.decrypt(ciphertext).decode()
return cleartext_pw