feat(dsse): extract DSSE into a no_std wsc-dsse crate (#218, REQ-24) - #232
Open
avrabe wants to merge 3 commits into
Open
feat(dsse): extract DSSE into a no_std wsc-dsse crate (#218, REQ-24)#232avrabe wants to merge 3 commits into
avrabe wants to merge 3 commits into
Conversation
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 Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #218 (REQ-24). Extracts
wsc::dsseinto a new standaloneno_stdwsc-dssecrate so embedded/offline consumers (varve, #187's Cortex-M on-target verifier) verify DSSE with justbase64/serde/serde_json/ed25519-compact— notwsc's 179-crate registry/TLS/X.509 tree.Verified
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-compactwithdefault-features=falsepulls no getrandom/std — verify + deterministic sign are ungated; tests use deterministic seeds.wscre-exportspub use wsc_dsse as dsse; typedDsseError+From<DsseError> for WSErrorsocomposition/mod.rscompiles byte-unchanged. Full public API preserved (0 items dropped, verified bycomm).wsc-dsse13/0,wsc606/0 (=619−13 moved tests), thumbv7em + workspace builds clean.Publish / CI wiring (advisor's catches)
scripts/publish.rs:wsc-dsseadded beforewsc(dependency order — same class of bug as the missing verify-core). Note: thewsc-dssename 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 aswsc-verify-coredid.src/dsse/BUILD.bazeladded;MODULE.bazelneeds no edit (crate.from_cargopicks up the member).dssematrix entry waspkg: wsc— after the move that matches zero harnesses (vacuous green), so repointed topkg: wsc-dsse. Itstolerate_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_modulekani harnesses (they need per-harness#[kani::unwind]) is pre-existing WIP tolerated on main.🤖 Generated with Claude Code