Skip to content

refactor(pkix)!: use shared spki framing - #283

Merged
polaz merged 1 commit into
mainfrom
refactor/#280-shared-effective-spki
Oct 23, 2026
Merged

polaz merged 1 commit into
mainfrom
refactor/#280-shared-effective-spki

Conversation

@polaz

@polaz polaz commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Adopt the coordinated registry primitives 0.11.0 throughout the workspace.
  • Replace local effective-SPKI encoding with shared framing, preserving original key provenance, source/current work limits and accounted output ownership.
  • Keep ordinary provider keys borrowed and reject invalid written DSA parameters rather than repairing them through inheritance.

Testing

Workspace build, test, doctest and lint matrices on macOS with stable/MSRV, both XML backends, FIPS and PKCS#11; alloc-only thumb/WASM, native interoperability, fuzz and benchmark smoke, documentation and dependency gates pass. Canonical coverage exceeds the 85% gate.

BREAKING CHANGE: public structured PKIX types use primitives 0.11.

Closes #280

Related

Summary by CodeRabbit

  • Bug Fixes
    • Key verification now handles inherited public-key parameters through an effective key representation, while preserving the original key data.
    • Written DSA NULL parameters are rejected rather than silently repaired through parameter inheritance.
    • Temporary key projections are subject to allocation and work limits, and retained memory remains accounted for until released.
  • Documentation
    • Clarified how inherited parameters, key projections, and resource accounting work during key handling.

Upgrade the coordinated primitives to 0.11.0 and replace local effective-key DER encoding with shared framing and source-aware accounted copies. Preserve the borrowed ordinary-key path and reject written DSA NULL rather than repairing it through inheritance.

BREAKING CHANGE: public structured PKIX types now use primitives 0.11.

Closes #280
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between d742a1b and 4b2669f.

📒 Files selected for processing: 6
  • Cargo.toml
  • crates/xml-sec-xades/Cargo.toml
  • docs/key-management.md
  • src/xmldsig/pkix.rs
  • tools/xmlsec1/Cargo.toml
  • vendor/sxd-document-no-unsafe/Cargo.toml

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The pull request upgrades structured-* dependencies to 0.11.0 and changes XMLDSig to use EffectiveSpki for inherited key parameters. Tests cover projected SPKI bytes, unchanged source data, resource accounting, and DSA parameter handling.

Changes: Effective SPKI framing

Layer / File(s) Summary
Adopt shared SPKI framing
Cargo.toml, crates/xml-sec-xades/Cargo.toml, tools/xmlsec1/Cargo.toml, vendor/sxd-document-no-unsafe/Cargo.toml, src/xmldsig/pkix.rs, docs/key-management.md
The structured-* dependencies now use version 0.11.0. XMLDSig uses WorkingKey and the shared projection helper to materialize inherited parameters. The documentation describes framing and resource accounting.
Test projection behavior and resource limits
src/xmldsig/pkix.rs
Tests cover projected bytes, unchanged certificate data, workspace release, DSA NULL rejection, borrowed original DER, and work and capacity limits for the source and current execution.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Refactor

Merge Risk: ⚪ Minimal · up to 4b266

No identified issue blocks merging after the normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 58.82% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 17 functions across 1 files. (5 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "refactor(pkix)!: use shared spki framing" names the primary change: the PKIX code now uses the shared SPKI framing from structured-pkix 0.11 (EffectiveSpki) in place of the local effective-…
Linked Issues check Passed Issue #280 is the active directly linked target. The dependency diffs upgrade the existing structured-asn1, structured-pkix, structured-cms, structured-ltv, and structured-xades packages to 0.11.0. `s…
Out of Scope Changes check Passed The changed files are limited to the #280 dependency upgrades, shared effective-SPKI implementation, related resource-accounting and DSA tests, and documentation. The dependency changes retain existin…
Full details: Title check

Explanation

The title "refactor(pkix)!: use shared spki framing" names the primary change: the PKIX code now uses the shared SPKI framing from structured-pkix 0.11 (EffectiveSpki) in place of the local effective-SPKI encoding. The raw summary confirms the src/xmldsig/pkix.rs change and the docs update, and the objectives describe the same replacement. The title also uses the conventional type(scope)! form and flags the breaking change to public structured PKIX types, which the objectives mention. It omits the dependency upgrade to 0.11.0 across the workspace, but that is a secondary aspect of the change. The title is concise and specific.

Full details: Linked Issues check

Explanation

Issue #280 is the active directly linked target. The dependency diffs upgrade the existing structured-asn1, structured-pkix, structured-cms, structured-ltv, and structured-xades packages to 0.11.0. src/xmldsig/pkix.rs replaces local SPKI encoding with structured_pkix::key::effective::EffectiveSpki. The implementation preserves source and current resource accounting, retained capacity, original certificate bytes, and the borrowed path for ordinary keys. It rejects written DSA NULL parameters before provider execution. Added tests cover source preservation, retained capacity, inherited parameters, capacity refusal, DSA NULL rejection, and ordinary-key borrowing. The reported workspace, feature, platform, lint, documentation, and coverage matrices satisfy the remaining #280 coding requirements. The PR does not add a CMS dependency to core XMLDSig.

Full details: Out of Scope Changes check

Explanation

The changed files are limited to the #280 dependency upgrades, shared effective-SPKI implementation, related resource-accounting and DSA tests, and documentation. The dependency changes retain existing optional and feature settings. No PKCS#12 implementation or higher XAdES integration is introduced, which is consistent with the separate #281 and #282 scope.

Full details: Docstring Coverage

Explanation

Docstring coverage is 58.82% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 17 functions across 1 files. (5 skipped: 5 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T01:16:22.785011Z 4b2669f PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@polaz
polaz enabled auto-merge (squash) October 23, 2026 01:37
@polaz
polaz merged commit 834c463 into main Oct 23, 2026
72 checks passed
@polaz
polaz deleted the refactor/#280-shared-effective-spki branch October 23, 2026 01:40
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.

refactor: adopt shared effective SPKI framing

1 participant