Skip to content

fix(tsp-js): refuse an XSCS/XCTL body that is not exactly one Bytes primitive - #249

Merged
stormer78 merged 1 commit into
feat/tsp-rev2-rev3-dual-handlerfrom
fix/tsp-js-app-payload-single-bytes
Sep 16, 2026
Merged

stormer78 merged 1 commit into
feat/tsp-rev2-rev3-dual-handlerfrom
fix/tsp-js-app-payload-single-bytes

Conversation

@stormer78

Copy link
Copy Markdown
Contributor

This PR targets feat/tsp-rev2-rev3-dual-handler, where Rev 3 lives; it isn't on main yet.

decodePayloadFrame read an XSCS/XCTL body as its first primitive. It dropped anything else in the -A## stream without an error and ignored data after the stream.

The body must now be an -A## stream that ends the payload frame and holds exactly one Bytes primitive. That is the form used by the spec's vectors and the ToIP reference (tsp_sdk 0.11). Everything else throws: an -H## group, a second primitive, or trailing data.

Context: tswg-tsp-specification#77. Found by the cross-implementation TSP Rev 3 conformance suite.

  • New tests/payload.app-stream.mjs covers the single-primitive body and all three refusals.
  • npm test: 110 pass.
  • CHANGELOG.md has an Unreleased entry.

…rimitive

Signed-off-by: Glenn Gore <glenn.g@affinidi.com>
@stormer78
stormer78 merged commit 4f583a5 into feat/tsp-rev2-rev3-dual-handler Sep 16, 2026
4 checks passed
@stormer78
stormer78 deleted the fix/tsp-js-app-payload-single-bytes branch September 16, 2026 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant