Files
corescope-rx/test
efiten 6847e9ca30 fix: trim AES block padding from a regions reply
The ANON_REQ reply payload is encrypted with a block cipher
(Utils::encryptThenMAC -> AES), so the plaintext arrives NUL-padded to a 16-byte
boundary, and the firmware's own length is not carried through to us. We stored
the padding verbatim.

Measured in production: 48 of 65 stored rows carry it. The padding lands inside
the LAST region name, so "belml" is stored as "belml\0\0\0..." — which matches no
observed scope and therefore reads as a region the repeater declares but never
forwards. A systematic false finding, on the last entry of nearly every list.

A wildcard-only answer is the worst shape: 0x2A plus seven NULs is exactly one
block, so even `regions_csv = '*'` compares false in SQL, and the audit can miss
the wildcard entirely and report a contradiction that is not there.

Trim before splitting. Padding is also excluded from the truncation measure — it
is not part of the repeater's answer and must not count toward the byte ceiling.
2026-08-19 15:20:26 +02:00
..