Skip to content

Add SPDM 1.2 CHUNK_GET message chunking and enable ML-DSA-87 over the wire#17

Merged
aidangarske merged 8 commits into
mainfrom
chunk-get-mldsa87
Jun 11, 2026
Merged

Add SPDM 1.2 CHUNK_GET message chunking and enable ML-DSA-87 over the wire#17
aidangarske merged 8 commits into
mainfrom
chunk-get-mldsa87

Conversation

@aidangarske

@aidangarske aidangarske commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Adds the SPDM 1.2 large-response chunking engine (CHUNK_GET reassembly) and turns ML-DSA-87 on over the wire — the second item of #10. ML-DSA-87's KEY_EXCHANGE_RSP / CHALLENGE_AUTH / signed MEASUREMENTS (~4.7–4.8 KB) exceed the common DataTransferSize (spdm-emu = 4608 B), so the responder splits them; this reassembles them.

Design (per the lightweight / zero-alloc / fine-grained-macro brief)

  • Transparent reassembly hooked into the two transport functions — wolfSPDM_SendReceive (cleartext KEY_EXCHANGE / CHALLENGE) and wolfSPDM_SecuredExchange (encrypted MEASUREMENTS) — so every parser sees a complete logical message and the transcript stays correct.
  • Zero dynamic allocation: one fixed chunkBuf[WOLFSPDM_CHUNK_BUF_SIZE] in the context holds a single CHUNK_RESPONSE; the reassembled message lands in the caller's existing buffer (no new buffers grow; ctx 72496 B < the 73728 B cap).
  • Fine-grained gates: WOLFSPDM_HAVE_CHUNK (--disable-chunking), WOLFSPDM_CHUNK_BUF_SIZE (MTU/transport size — lower it for constrained devices), WOLFSPDM_CHUNK_NO_SECURED (drop just the encrypted path), WOLFSPDM_CHUNK_MAX_CHUNKS.
  • Authoritative wire values (DSP0274 Sec. 10.27, cross-checked vs libspdm): CHUNK_GET=0x86, CHUNK_RESPONSE=0x06, CHUNK_CAP=0x00020000, ERROR(LargeResponse)=0x0F, Handle at byte 4, u16-vs-u32 ChunkSeqNo by version.

Testing

  • make check: 70 (ML-DSA + chunk) / 65 (chunk, no ML-DSA) / 64 (both disabled) — the gates compile cleanly in/out. New test_chunk_reassemble drives the reassembler with a mock multi-chunk transport and a negative (oversized) case.
  • Full strict build clean (-Wall -Wextra -Wpedantic -Werror -Wconversion -Wshadow); zero allocations in src/spdm_chunk.c; no bare-scope blocks.
  • CI: the PQC interop matrix now runs ML-DSA-44/65/87 × session/measurements/challenge × (ubuntu 22.04/24.04 x64 + 24.04 aarch64) × dynamic-mem — 87 exercises both the cleartext and secured chunk paths.

New file / docs

  • src/spdm_chunk.c (the reassembler) + a Message Chunking wiki page; ML-DSA-87 docs updated (no longer "follow-on").

Comment thread src/spdm_chunk.c Fixed
@aidangarske aidangarske merged commit 89c4465 into main Jun 11, 2026
44 checks passed
@aidangarske aidangarske deleted the chunk-get-mldsa87 branch June 11, 2026 14:46
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.

2 participants