Skip to content

Fix ciphertext length handling in BLE advertisement - #2

Open
catsimple wants to merge 1 commit into
dz0ny:mainfrom
catsimple:fix_encrpyt
Open

Fix ciphertext length handling in BLE advertisement#2
catsimple wants to merge 1 commit into
dz0ny:mainfrom
catsimple:fix_encrpyt

Conversation

@catsimple

Copy link
Copy Markdown

The current implementation appends the 4-byte Counter after the MIC. The resulting structure was [DeviceInfo] + [Ciphertext] + [MIC] + [Counter].
According to the BTHomeV2 specification and the official Python implementation, the Counter must precede the MIC. The correct structure for the Service Data should be [DeviceInfo] + [Ciphertext] + [Counter] + [MIC].

@pnposch

pnposch commented Mar 25, 2026

Copy link
Copy Markdown

exactly the problem i ran into. confirm @catsimple fix to work now. until merged you can use:

external_components:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants