Skip to content

Add X.509 path length rollover regression test - #542

Open
jacob-hughes wants to merge 1 commit into
cloudflare:masterfrom
jacob-hughes:x509-path-len-tests
Open

jacob-hughes wants to merge 1 commit into
cloudflare:masterfrom
jacob-hughes:x509-path-len-tests

Conversation

@jacob-hughes

Copy link
Copy Markdown

Covers valid and invalid certificate chains around path length constraint handling.

Covers valid and invalid certificate chains around path length
constraint handling.
@nox
nox force-pushed the x509-path-len-tests branch from 6f3e40b to 92c3863 Compare December 4, 2026 21:43
@nox

nox commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

I rebased this onto current master and updated the fixture handling. The rollover chain is now generated by scripts/generate-cert.sh with deterministic dates and serials, reuses the existing test keys, and verifies at the shared fixture time. The standalone generator and four additional private key files were removed; the three regression cases remain unchanged.

@nox
nox marked this pull request as ready for review December 4, 2026 21:51
@clanky-the-clanker

clanky-the-clanker Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

This pull request's reviews are posted as pull request reviews: see the review of 92c38631.

@nox

nox commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

@clanky-the-clanker review

@clanky-the-clanker clanky-the-clanker Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approved — This is a test-only change. The fixture generation and the expected results for the valid and invalid path length cases are consistent, and no issues were found.

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


✅ All checks passed

🔒 Security: ✅ LGTM

The certificates and keys are test-only fixtures. The change reuses existing test keys and adds no new secrets.


📖 AGENTS.md: ✅ LGTM

This pull request does not change tooling or architecture in a way that needs AGENTS.md updates.


📋 Code Quality: ✅ LGTM

  • Chain wiring: In scripts/generate-cert.sh, each certificate's issuer and subject keys and identifiers line up. Int2 and the self-issued rollover share a subject name, but each chain still builds to exactly one path.
  • Test expectations: The expected result for each case in boring/src/x509/tests/path_len.rs is correct:
    • The valid chain verifies, because the self-issued rollover does not count toward the path length.
    • A rollover with pathlen 0 fails with PATH_LENGTH_EXCEEDED.
    • An Int2 with pathlen 0 also fails with PATH_LENGTH_EXCEEDED.
  • Verify helper and fixtures: The helper follows the existing trusted_first.rs pattern and checks the shared fixture time. The new serials do not collide with existing ones, and the new PEM files are registered.

📝 Documentation: ✅ LGTM

No documentation changes are needed.


Reviewed commit: 92c38631

This branch has not been deployed

No deployments
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.

2 participants