fix: strip extraneous \x01 from decrypted secret

This commit is contained in:
ptrcnull 2024-11-06 04:19:27 +01:00
parent d138f10802
commit b51fb6569d

View file

@ -78,4 +78,4 @@ class Session:
aes = algorithms.AES(self.aes_key) aes = algorithms.AES(self.aes_key)
decryptor = Cipher(aes, modes.CBC(aes_iv), default_backend()).decryptor() decryptor = Cipher(aes, modes.CBC(aes_iv), default_backend()).decryptor()
decrypted_secret = decryptor.update(secret) + decryptor.finalize() decrypted_secret = decryptor.update(secret) + decryptor.finalize()
return decrypted_secret.rstrip(b'\x0f') return decrypted_secret.rstrip(b'\x01\x0f')