Repository navigation
test(cms): execute the CMS provider in WebAssembly - #345
Conversation
The cms feature was only compiled for targets without std. wasm-smoke now runs an RFC 3161 token through CmsProvider in the compiled module: the token verifies, and the same token with an altered signature value is an invalid signature rather than an error. The check enumerates all exports, so a missing one fails it. Closes #344
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Alloc-only CMS qualification tests/wasm-smoke/Cargo.toml, docs/features.md, docs/ci-hardening.md |
The WASM smoke manifest enables CMS-related alloc dependencies. The documentation describes CMS lint coverage, the RFC 3161 WASM check, and the distinction between shared-package and root-package alloc-only checks. |
RFC 3161 token check tests/wasm-smoke/src/lib.rs |
The consumer embeds token, certificate, and payload fixtures. It checks the original token and a copy with its final byte altered, returning success only when their signature answers are Valid and Invalid, respectively. |
Export validation tools/xml-sec-tools/src/wasm_smoke.rs, tools/xml-sec-tools/src/wasm_smoke/tests.rs |
The smoke tool adds the CMS export to its required checks. Tests cover successful exports, individual failures, and each missing export. |
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Other
Sequence Diagram(s)
sequenceDiagram
participant WasmSmokeTool
participant xml_sec_wasm_cms
participant check_token
participant CmsProvider
WasmSmokeTool->>xml_sec_wasm_cms: invoke CMS smoke export
xml_sec_wasm_cms->>check_token: check original and altered tokens
check_token->>CmsProvider: parse and check timestamp token
CmsProvider-->>check_token: signature answer and verification evidence
check_token-->>xml_sec_wasm_cms: return signature answer or None
xml_sec_wasm_cms-->>WasmSmokeTool: return 1 only for Valid original and Invalid altered token
Possibly related PRs
- structured-world/xml-sec#295: Changes the alloc-only CI job and its documented lint contract, which this PR extends with CMS coverage.
- structured-world/xml-sec#269: Adds the feature qualification runner and documentation that this PR extends to the CMS WASM execution path.
- structured-world/xml-sec#320: Separates XMLDSig verification from signing and private-key import; this PR selects the CMS feature in the WASM consumer.
Merge Risk: 
Minimal · up to 0b51a
-
No actionable merge-blocking risk was identified; normal CI checks should pass before merging.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Linked Issues check
-
Explanation
Issue
#344requires execution of the CMS check in the compiled WebAssembly module.xml_sec_wasm_cmsusesCmsProviderwith the RFC 3161 fixture, checks a matching imprint and retained evidence, and verifies the valid and tampered answers.wasm_smoke::EXPORTScalls the export and requires return value1. The tool tests cover a missing export and non-1results.
Full details: Out of Scope Changes check
-
Explanation
The manifest changes add the CMS dependencies and features required by the WASM consumer. The documentation updates describe the changed alloc-only gate. The smoke-tool tests verify the new export and remain connected to Issue
#344. No unrelated change is demonstrated.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 4 functions across 3 files. (3 skipped: 3 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Summary
wasm-smokenow runs thecmsfeature in the compiled WebAssembly module, so the provider is executed there and not only compiled.CmsProvider; the same token with an altered signature value is an invalid signature, not an error.Changes
tests/wasm-smokeselectscmsand exportsxml_sec_wasm_cmsover the Ed25519 token fixture.wasm-smokecommand calls the new export; a missing export, or one that does not return 1, fails the check.docs/features.mddescribes the extended alloc-only gate, anddocs/ci-hardening.mdno longer says core XMLDSig requiresstd.Testing
wasm-smoke, its tool tests, lints and formatting pass on macOS; CI runs the alloc-only job and the full gates.Closes #344
Summary by CodeRabbit
Documentation
Tests