Skip to content

feat(dsse): extract DSSE into a no_std wsc-dsse crate (#218, REQ-24) - #232

Open
avrabe wants to merge 3 commits into
mainfrom
feat/wsc-dsse-crate
Open

feat(dsse): extract DSSE into a no_std wsc-dsse crate (#218, REQ-24)#232
avrabe wants to merge 3 commits into
mainfrom
feat/wsc-dsse-crate

Conversation

@avrabe

@avrabe avrabe commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Closes #218 (REQ-24). Extracts wsc::dsse into a new standalone no_std wsc-dsse crate so embedded/offline consumers (varve, #187's Cortex-M on-target verifier) verify DSSE with just base64/serde/serde_json/ed25519-compact — not wsc's 179-crate registry/TLS/X.509 tree.

Verified

  • no_std / embedded: builds for thumbv7em-none-eabi (Embedded: no_std on-target verifier + signed WCMC/size manifest for the kiln on-board interpreter trust chain #187's target). ed25519-compact with default-features=false pulls no getrandom/std — verify + deterministic sign are ungated; tests use deterministic seeds.
  • Compat: wsc re-exports pub use wsc_dsse as dsse; typed DsseError + From<DsseError> for WSError so composition/mod.rs compiles byte-unchanged. Full public API preserved (0 items dropped, verified by comm).
  • Oracles: wsc-dsse 13/0, wsc 606/0 (=619−13 moved tests), thumbv7em + workspace builds clean.

Publish / CI wiring (advisor's catches)

  • scripts/publish.rs: wsc-dsse added before wsc (dependency order — same class of bug as the missing verify-core). Note: the wsc-dsse name isn't claimed on crates.io yet — the first publish claims it, and Trusted Publishing can't bootstrap a nonexistent crate, so it'll need the same one-time token bootstrap as wsc-verify-core did.
  • src/dsse/BUILD.bazel added; MODULE.bazel needs no edit (crate.from_cargo picks up the member).
  • The kani dsse matrix entry was pkg: wsc — after the move that matches zero harnesses (vacuous green), so repointed to pkg: wsc-dsse. Its tolerate_failure (unwind-bound WIP) is pre-existing on main, carried over unchanged.

Design

Separate crate, not into wsc-verify-core (DD-13): verify-core is the witness-MC/DC-instrumented crate whose gaps are REQ-25 in this same release — adding DSSE there would add decisions to the crate we're closing gaps in.

Follow-up (not this PR)

Unmasking the dsse/format/wasm_module kani harnesses (they need per-harness #[kani::unwind]) is pre-existing WIP tolerated on main.

🤖 Generated with Claude Code

wsc::dsse (DSSE envelope sign/verify) lived only in the 179-crate wsc crate, so
an embedded/offline consumer that just wants DSSE had to pull ring/rustls/ureq/
x509-parser/p256/webpki-roots. Move src/lib/src/dsse.rs into a new standalone
`wsc-dsse` crate whose only deps are base64/serde/serde_json/ed25519-compact,
all no_std+alloc.

- **no_std + embedded-proven:** `#![no_std]` + alloc; builds for
  thumbv7em-none-eabi (#187's Cortex-M target). ed25519-compact with
  default-features=false pulls NO getrandom/std — verify + deterministic sign are
  ungated; only keygen needs RNG, and tests use deterministic seeds.
- **Compat preserved:** wsc re-exports `pub use wsc_dsse as dsse` so wsc::dsse::*
  still resolves; a typed DsseError replaces the WSError coupling, with
  `From<DsseError> for WSError` so composition/mod.rs compiles BYTE-UNCHANGED.
  Full public API preserved (0 items dropped).
- **Publish/CI wired:** wsc-dsse added to scripts/publish.rs (before wsc,
  dependency order) + src/dsse/BUILD.bazel; the kani `dsse` matrix entry
  repointed pkg wsc->wsc-dsse (leaving it at wsc would match ZERO harnesses =
  vacuous green — the harnesses moved). Its pre-existing tolerate_failure (unwind
  WIP, same as format/wasm_module) is carried over unchanged, not newly added.

wsc::dsse (this) and wsc_attestation::dsse (in-toto ResourceDescriptor) are
distinct concerns; only the former moved. Oracles: wsc-dsse 13/0, wsc 606/0
(=619-13 moved), thumbv7em build + workspace build clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012aR3Md1h46K9wAUWMQiESH
@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.22917% with 13 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/lib/src/error.rs 0.00% 9 Missing ⚠️
src/dsse/src/lib.rs 97.81% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

avrabe and others added 2 commits August 8, 2026 17:36
The coverage job ran `cargo llvm-cov -p wsc`; after DSSE moved to its own crate,
those lines are no longer in wsc, so codecov/patch flagged the moved code as
uncovered even though its 13 tests moved with it. Add `-p wsc-dsse`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012aR3Md1h46K9wAUWMQiESH
Raise wsc-dsse coverage 86% -> 97% lines by testing the paths the moved code
never exercised: Ed25519DsseSigner/Verifier::from_bytes (positive + malformed),
verify/verify_all error branches (empty signatures, bad base64 payload/sig,
one-bad-among-many), and DsseError Display. Each asserts the specific DsseError
variant. 24 tests, all no_std deterministic-seed based (no getrandom).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012aR3Md1h46K9wAUWMQiESH
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.

dsse: pure-offline DSSE verify drags in the full 179-crate wsc dependency tree

1 participant