Skip to content

Fix deferred codebase review items#105

Merged
gvonness-apolitical merged 7 commits intomainfrom
fix/deferred-review-items
Mar 13, 2026
Merged

Fix deferred codebase review items#105
gvonness-apolitical merged 7 commits intomainfrom
fix/deferred-review-items

Conversation

@gvonness-apolitical
Copy link
Collaborator

Summary

  • Correctness: clear stale security ref on write, map ZIP errors by variant, improve freeze lineage error message
  • Consistency: update modified timestamp in all document mutation paths (extension macro, encryption setters)
  • Security: add zeroize for encryptor keys and PBES2/ML-DSA secrets, enforce PBKDF2 iteration bounds (10k–10M), fix permissions_for to check specific grants before Everyone wildcard
  • Validation: validate subfigure blocks/IDs, clamp heading level to 1–6 on deserialization, add PartialDate month/day validation with fallible constructors
  • CLI quality: fix misleading decrypt message, return non-zero exit from unimplemented commands, replace process::exit(1) with bail!, fix truncate_token UTF-8 safety
  • API: implement recursive get_mut for CommentThread replies, add merge_styles regression test covering all Style fields, fix OTS verify valid and Ethereum offline hash_matches to false
  • Review inline fixes: correct error variants across 7 security modules (invalid_manifestSignatureError), propagate revocation checker errors, encrypt command stub warning, matches_document doc fix

Breaking change

Pbes2KeyWrapper::new now returns Result (validates iteration bounds).

Test plan

  • cargo build --workspace --all-features
  • cargo test --workspace --all-features — 1082 tests pass
  • cargo clippy --workspace --all-features -- -D warnings

Correctness: clear stale security ref on write, map ZIP errors
properly, improve lineage error message.

Consistency: update modified timestamp in extension/encryption
mutation methods and the define_extension_accessors macro.

Security: add zeroize for encryptor keys and PBES2/ML-DSA secrets,
enforce PBKDF2 iteration bounds (10k-10M), fix permissions_for to
check specific grants before Everyone wildcard.

Validation: validate subfigure blocks and IDs, clamp heading level
to 1-6 on deserialization, add PartialDate month/day validation.

CLI: fix misleading decrypt message, return non-zero exit from
unimplemented commands, replace process::exit with bail, fix
truncate_token UTF-8 safety.

API: implement recursive get_mut for CommentThread replies, add
merge_styles regression test covering all Style fields, fix OTS
verify to return valid=false and Ethereum offline hash_matches=false.

Breaking: Pbes2KeyWrapper::new now returns Result.
Codebase review inline fixes that were applied during the review
session itself:

- Add signature_error() helper and switch 7 security modules from
  invalid_manifest() to the correct SignatureError variant
- Revocation checker: propagate OCSP/CRL errors instead of silently
  falling through
- Encrypt command: warn that content-level encryption is not yet
  implemented
- matches_document: update doc to clarify it only checks token
  presence, not cryptographic validity
- Minor fixes in archive, validation, and writer modules
- Bump cdx-core and cdx-cli from 0.7.0 to 0.7.1
- Add 0.7.1 changelog entry with all fixes from this PR
- Update SECURITY.md to support >= 0.7.1 only
- Fix README.md install example (was 0.4, now 0.7)
- Commit Cargo.lock to pin dependency resolution (fixes hkdf/hmac
  pre-release incompatibility when resolved fresh on CI)
- Remove Cargo.lock from .gitignore
- Apply rustfmt formatting
- Gate freeze lineage test on signatures feature (test needs a
  signature to pass the earlier check before reaching lineage)
- Downgrade cargo-deny yanked policy to "warn" — RustCrypto RC
  ecosystem has transiently yanked digest/cipher/crypto-common and
  non-yanked replacements break downstream crates
- Fix doc link syntax for try_year_month and try_full (Self:: prefix)
- Update Cargo.lock
@gvonness-apolitical gvonness-apolitical force-pushed the fix/deferred-review-items branch from 4b08c6f to ed09d39 Compare March 13, 2026 23:14
@gvonness-apolitical gvonness-apolitical merged commit 93c200c into main Mar 13, 2026
15 of 16 checks passed
@gvonness-apolitical gvonness-apolitical deleted the fix/deferred-review-items branch March 13, 2026 23:17
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.

1 participant