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