File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
src/arduino/app_internal/core/peripherals Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 99import secrets
1010import struct
1111from cryptography .hazmat .primitives .ciphers .aead import ChaCha20Poly1305
12+ from cryptography .exceptions import InvalidTag
1213
1314from arduino .app_utils .logger import Logger
1415
@@ -225,8 +226,11 @@ def decode(self, message: bytes) -> bytes | None:
225226 elif mode == MODE_NONE :
226227 return message [HEADER_SIZE :]
227228
229+ except InvalidTag as e :
230+ logger .warning (f"Decryption failed: encryption key or data integrity issue" )
231+ return None
228232 except Exception as e :
229- logger .warning (f"Crypto Error : { e } " )
233+ logger .error (f"Unknown error while decoding : { e } ( { type ( e ) } ) " )
230234 return None
231235
232236 def encode_text (self , data : bytes ) -> str :
You can’t perform that action at this time.
0 commit comments