Skip to content

Commit

Permalink
fix: correct data length check
Browse files Browse the repository at this point in the history
  • Loading branch information
Ernst79 committed Jan 24, 2023
1 parent 9a12dad commit aed08c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bthome_ble/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ def _decrypt_bthome(self, data: bytes, bthome_mac: bytes, sw_version: int) -> by
raise ValueError

# check for minimum length of encrypted advertisement
if len(data) < (15 if sw_version == 1 else 14):
if len(data) < (12 if sw_version == 1 else 11):
_LOGGER.debug("Invalid data length (for decryption), adv: %s", data.hex())
raise ValueError

Expand Down

0 comments on commit aed08c4

Please sign in to comment.