ax(ueps): replace prose comment with usage example on default tag case

AX Principle 2: comments must show usage, not describe intent in prose.
The default switch branch comment was prose-first; rewritten as a
concrete call-site example that shows what the code does and why.

Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
Claude 2026-04-02 10:16:38 +01:00
parent 9a95c8be54
commit 4cd24158eb
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -87,8 +87,7 @@ func ReadAndVerify(reader *bufio.Reader, sharedSecret []byte) (*ParsedPacket, er
case TagHMAC:
signature = tagValue
default:
// Unknown extension tags are included in HMAC coverage to prevent tag-injection attacks.
// signedData.Write(extensionTLV) — forward-compatible: new tags are authenticated, not silently dropped.
// signedData.WriteByte(unknownTag); signedData.Write(tagValue) — unknown tags contribute to HMAC, blocking injection
signedData.WriteByte(tagByte)
signedData.WriteByte(byte(tagLength))
signedData.Write(tagValue)