From 1c543e3a848f514cc548116897002e8046ea4b79 Mon Sep 17 00:00:00 2001 From: dni Date: Tue, 26 Jul 2022 09:56:46 +0200 Subject: [PATCH] ignore macaroon type errors --- lnbits/wallets/macaroon/macaroon.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lnbits/wallets/macaroon/macaroon.py b/lnbits/wallets/macaroon/macaroon.py index 84c4909d1..1c69ca0b1 100644 --- a/lnbits/wallets/macaroon/macaroon.py +++ b/lnbits/wallets/macaroon/macaroon.py @@ -76,7 +76,7 @@ class AESCipher(object): def decrypt(self, encrypted: str) -> str: #type: ignore """Decrypts a string using AES-256-CBC.""" passphrase = self.passphrase - encrypted = base64.b64decode(encrypted) + encrypted = base64.b64decode(encrypted) #type: ignore assert encrypted[0:8] == b"Salted__" salt = encrypted[8:16] key_iv = self.bytes_to_key(passphrase.encode(), salt, 32 + 16) @@ -84,7 +84,7 @@ class AESCipher(object): iv = key_iv[32:] aes = AES.new(key, AES.MODE_CBC, iv) try: - return self.unpad(aes.decrypt(encrypted[16:])).decode() + return self.unpad(aes.decrypt(encrypted[16:])).decode() #type: ignore except UnicodeDecodeError: raise ValueError("Wrong passphrase")