Repository navigation
feat(cms): add CMS signature provider - #343
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 3 minutes. View limit details
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 |
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2f248881cd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- The optional `cms` feature adds `xmldsig::cms::CmsProvider`, which implements the structured-cms provider contract over one CryptoProvider and one compiled VerificationPolicy; `VerifiedSession::cms_provider` binds it to the operation that verified the XML signature. - Digests start through SessionDigest under the digest policy; ASN.1 digest identifiers resolve through the shared PKIX resolver. - Signature identifiers resolve through the shared PKIX mapping under the certificate-signature permissions, provider capability and RSA/DSA key policy. rsaEncryption takes its hash from digestAlgorithm (RFC 3370 3.2); an ECDSA identifier must name digestAlgorithm's hash (RFC 5753 2.1.1). - The provider verifies contiguous signed bytes, so every signature uses raw mode with the signed octets admitted against the operation memory. - Plain `xmldsig` still compiles no CMS processor; the new cms-xmloxide profile checks its graph and runs real RFC 3161 tokens from OpenSSL (RSA, RSA-PSS, ECDSA P-256, Ed25519). Closes #332
- Raw verification never reads digestAlgorithm, so a signer naming the wrong digest passed. RSA-PSS now requires its hash (RFC 4056 section 3), Ed25519 requires SHA-512 and Ed448 refuses every resolvable digest, since it requires SHAKE256 (RFC 8419 sections 3.1 and 3.2). - Each signer resolution opened a new certificate account, so repeated key checks could exceed the cumulative max_x509_work. One CmsProvider now holds one account for its processing session. Regression tests cover both, on two new certificate fixtures.
2f24888 to
248194c
Compare
Summary
cmsfeature addsxmldsig::cms::CmsProvider, which implements thestructured-cmsprovider contract over oneCryptoProviderand one compiledVerificationPolicy.VerifiedSession::cms_providerbinds it to the operation that verified the XML signature, so RFC 3161 tokens are checked with the same provider, policy and budgets.xmldsigstill compiles no CMS processor, andcmsbuilds withoutstd.Changes
SessionDigestunder the digest policy; ASN.1 digest identifiers resolve through the shared PKIX resolver.rsaEncryptiontakes its hash fromdigestAlgorithm(RFC 3370 3.2); ECDSA and RSA-PSS identifiers must name the same hash (RFC 5753 2.1.1, RFC 4056 3), Ed25519 requires SHA-512 and Ed448 requires SHAKE256, which is not a supported digest (RFC 8419 3).CmsProviderholds one certificate account for its processing session, so signer key checks sharemax_x509_work.cms-xmloxideprofile ofcheck-featuresrefuses signing and import crates in its dependency graph and runs real tokens from OpenSSL (RSA, RSA-PSS, ECDSA P-256, Ed25519). The verification-only profiles now also refusestructured-cms.scripts/generate-cms-timestamp-fixtures.shregenerates those tokens.Testing
Feature profiles, all-feature tests with the xmlsec1 oracle and PKCS#11, lints and the
thumbv7em-none-eabihfcheck pass on macOS; CI runs the full gates on all platforms.Closes #332