From b51fb6569d02923b6a173fa4bdb5ad176d58e7b1 Mon Sep 17 00:00:00 2001 From: ptrcnull Date: Wed, 6 Nov 2024 04:19:27 +0100 Subject: [PATCH] fix: strip extraneous \x01 from decrypted secret --- kakushi/dhcrypto.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kakushi/dhcrypto.py b/kakushi/dhcrypto.py index 860dbff..e3c946e 100644 --- a/kakushi/dhcrypto.py +++ b/kakushi/dhcrypto.py @@ -78,4 +78,4 @@ class Session: aes = algorithms.AES(self.aes_key) decryptor = Cipher(aes, modes.CBC(aes_iv), default_backend()).decryptor() decrypted_secret = decryptor.update(secret) + decryptor.finalize() - return decrypted_secret.rstrip(b'\x0f') + return decrypted_secret.rstrip(b'\x01\x0f')