refactor: carve verification core into wsc-verify-core (wasm-buildable)#129
Open
avrabe wants to merge 1 commit into
Open
refactor: carve verification core into wsc-verify-core (wasm-buildable)#129avrabe wants to merge 1 commit into
avrabe wants to merge 1 commit into
Conversation
The `wsc` crate transitively required `ring` (via rustls/ureq/rcgen/
rustls-webpki/x509-parser), which does not build for `wasm32-*` with
the default LLVM toolchain. The classic verification path itself
(`PublicKey::verify`, `verify_multi`, the WASM module parser, the
signature-section parser) needs none of that — those deps live in the
keyless / Sigstore / provisioning machinery.
This commit splits the network-free verification core into a new
workspace crate `wsc-verify-core`, which builds cleanly for both
`wasm32-wasip2` and `wasm32-unknown-unknown` with plain cargo (no
`ring`, no TLS, no X.509). `wsc` depends on the new crate and
re-exports its public API, so the `wsc::*` surface is unchanged.
Moved into `src/verify-core/`:
- `wasm_module/` (module parsing — varint, component, mod)
- `signature/{hash,info,keys,matrix,multi,sig_sections,simple}.rs`
- `split.rs` (inherent `impl Module` methods)
- `secure_file.rs` (key file IO, needed by `KeyPair::from_file`)
A minimal `CoreError` lives in the new crate so the orphan rule on
`From<X509Error> for WSError` doesn't drag x509-parser back into core.
`From<CoreError> for WSError` in the outer crate makes the boundary
transparent under `?`.
Verified:
- `cargo build --workspace` — clean
- `cargo test --workspace --lib` — 754 tests pass
(588 wsc + 166 wsc-verify-core + 18 wsc-attestation)
- `cargo build -p wsc-verify-core --target wasm32-wasip2` — clean
- `cargo build -p wsc-verify-core --target wasm32-unknown-unknown` — clean
Local Bazel validation was blocked by missing Nix / network in this
environment; CI will validate the Bazel side end-to-end.
Unblocks #128 (witness MC/DC harness): the verification core can now
be instrumented directly via `witness instrument` + plain cargo, with
no Bazel pipeline detour. Also tightens the verification core's audit
surface — it no longer carries the keyless/TLS dependency closure.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Summary
Splits the network-free verification core out of
wscinto a new workspace cratewsc-verify-coreso it builds forwasm32-*with plain cargo. Closes the blocker recorded on #128.wsctransitively requiredring(viarustls/ureq/rcgen/rustls-webpki/x509-parser) —ringdoes not build forwasm32-*with the default LLVM toolchain. The classic verification path itself (PublicKey::verify,verify_multi, the WASM module parser, the signature-section parser) needs none of those; they belong to the keyless/Sigstore/provisioning machinery. The carve separates the two so MC/DC coverage tools (witness) and any future wasm consumer can instrument the verification core directly withcargo build --target wasm32-*.What moved
Into
src/verify-core/:wasm_module/— varint, component, modsignature/{hash,info,keys,matrix,multi,sig_sections,simple}.rssplit.rs(inherentimpl Module {…}methods)secure_file.rs(key file IO — needed byKeyPair::from_file)CoreError(avoids theFrom<X509Error> for WSErrororphan-rule trap)wsc:wsc-verify-corewsc::PublicKey,wsc::Module,wsc::SIGNATURE_*, etc. — unchanged)From<CoreError> for WSErrorso the boundary is transparent under?signature/keyless/,composition/,airgapped/,sct/,provisioning/,http/,runtime/— the layers that need the heavy depsVerification
Local checks (this branch, this commit):
cargo build --workspacecargo test --workspace --libcargo build -p wsc-verify-core --target wasm32-wasip2ringcargo build -p wsc-verify-core --target wasm32-unknown-unknownringcargo tree -p wsc-verify-core -i ringrustls,ureq,rcgen,rustls-webpki,x509-parserA clean-room verification subagent independently re-validated all 8 of the above against the actual branch state with no access to my reasoning — every claim CONFIRMED.
Bazel
src/verify-core/BUILD.bazel(rust_librarywith only the 7 lightweight deps)src/lib/BUILD.bazeladds//src/verify-core:wsc-verify-coreas a depLocal Bazel was blocked by the sandbox (no Nix in PATH, network unreachable for the wizer fetch). CI will validate end-to-end.
Why this matters beyond #128
The verification core no longer carries the keyless / TLS / X.509 dependency closure. That's a real reduction in the audit and supply-chain surface of the actual verification code — useful in itself, separate from the witness MC/DC goal it unblocks.
Test plan
cargo build --workspace,cargo test --workspace --libcargo build -p wsc-verify-core --target wasm32-wasip2cargo build -p wsc-verify-core --target wasm32-unknown-unknown🤖 Generated with Claude Code