Skip to content

Fix stale subject-hash headers; add verify guard + example.com/.org anchor test#5

Merged
MagicalTux merged 1 commit into
masterfrom
fix-stale-subject-hash-headers
Jun 5, 2026
Merged

Fix stale subject-hash headers; add verify guard + example.com/.org anchor test#5
MagicalTux merged 1 commit into
masterfrom
fix-stale-subject-hash-headers

Conversation

@MagicalTux

Copy link
Copy Markdown
Member

What

Investigating a report that SSL.com TLS ECC Root CA 2022 might be missing, it turned out the root is present and correctly compiled (865fbdf9.0) — but the # OpenSSL subject hash: comment in its PEM header was wrong (8b682d02), which is what made it look absent. Checking the rest of the store, all 117 PEM headers had a wrong subject-hash comment.

These comments are informational only: build.rs recomputes the hash from DER, so the compiled store, the README tables, and the subject_hash_matches_openssl crosscheck were always correct. The headers were written by an older hash implementation and never regenerated.

Changes

  • Rewrite all 117 roots/*.pem headers to the correct computed hash.
  • cacrt-tool verify now fails when a header's declared hash != the computed hash, so the comments can't silently drift again (CI runs verify).
  • Add tests/example_anchor.rs: resolves the SSL.com TLS ECC Root CA 2022 trust anchor by the issuer Name that example.com / example.org's chain points at (captured from the live chain), asserting byte-exact DER identity and reachability via lookup("865fbdf9.0"). example.com/.org now chain to this root, which motivated the investigation.

Verification

  • cargo test — all pass (including the 2 new anchor tests).
  • cacrt-tool verifyverified 117 roots, all pass curation rules; confirmed it now fails on a deliberately corrupted header.
  • No certificate bodies changed — only header comments, plus the tool/test additions.

🤖 Generated with Claude Code

The `# OpenSSL subject hash:` comment in every roots/*.pem was wrong
(written by an older hash implementation and never regenerated). The
headers are informational — build.rs recomputes the hash from DER, so
the compiled store and README were always correct — but the stale
comments were misleading (e.g. SSL.com TLS ECC Root CA 2022 read
`8b682d02` instead of the correct `865fbdf9`).

- Rewrite all 117 headers to the computed hash.
- cacrt-tool verify now fails when a header hash != the computed hash,
  so the comments can't silently rot again (CI runs verify).
- Add tests/example_anchor.rs: resolve the SSL.com TLS ECC Root CA 2022
  trust anchor (865fbdf9.0) by the issuer Name that example.com /
  example.org's chain points at, asserting byte-exact DER identity.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@MagicalTux MagicalTux merged commit 7876a64 into master Jun 5, 2026
3 checks passed
@MagicalTux MagicalTux mentioned this pull request Jun 4, 2026
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