ax(ueps): strip 7 lines of implementation prose from MarshalAndSign
Replaced descriptive rationale with 2-line factual comment + byte layout example. Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
f97975b4c1
commit
e0e80e990b
1 changed files with 2 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue