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:
parent
9a95c8be54
commit
4cd24158eb
1 changed files with 1 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue