From e0e80e990ba43a560efa2d004b05ce5910691026 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Apr 2026 08:29:22 +0100 Subject: [PATCH] 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 --- pkg/ueps/packet.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/pkg/ueps/packet.go b/pkg/ueps/packet.go index ff68fec..f6111f3 100644 --- a/pkg/ueps/packet.go +++ b/pkg/ueps/packet.go @@ -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, , 0xFF, ] 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