ax(ueps): strip 7 lines of implementation prose from MarshalAndSign
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run

Replaced descriptive rationale with 2-line factual comment + byte layout example.

Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
Claude 2026-04-02 08:29:22 +01:00
parent f97975b4c1
commit e0e80e990b
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -99,16 +99,9 @@ func (builder *PacketBuilder) MarshalAndSign(sharedSecret []byte) ([]byte, error
return nil, err
}
// 4. Write Payload TLV (0xFF)
// Note: 0xFF length is variable. For simplicity in this specialized reader,
// we might handle 0xFF as "read until EOF" or use a varint length.
// Implementing standard 1-byte length for payload is risky if payload > 255.
// Assuming your spec allows >255 bytes, we handle 0xFF differently.
// 4. Write Payload TLV (0xFF) — tag byte only; payload appended length-prefixless.
// buffer.Bytes() → [...headerTLVs..., 0x06, 0x20, <hmac32>, 0xFF, <payload...>]
buffer.WriteByte(TagPayload)
// We don't write a 1-byte length for payload here assuming stream mode,
// but if strict TLV, we'd need a multi-byte length protocol.
// For this snippet, simply appending data:
buffer.Write(builder.Payload)
return buffer.Bytes(), nil