Skip to content

x509: close the Tier 2 gaps (empty NameConstraints, empty-subject SAN rule, clean-room spki + equivalence) - #200

Open
atiernan wants to merge 11 commits into
mainfrom
claude/x509-tier2-gaps
Open

atiernan wants to merge 11 commits into
mainfrom
claude/x509-tier2-gaps

Conversation

@atiernan

@atiernan atiernan commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Closes the remaining gaps between clazel-x509 and Tier 2. The last commit (ae7505a) raises tier to 2. That claim holds only once CI's full verification on this PR is green; the PR must not merge before then.

What changed

  • Empty NameConstraints is refused at decode. RFC 5280 §4.2.1.10 requires at least one of permittedSubtrees/excludedSubtrees. Spec first, then exec and proofs, plus the mutation name-constraints-one-field-present-at-decode.
  • A target with an empty subject and a non-critical SAN is now refused (RFC 5280 §4.2.1.6). Spec first, then exec. Mutations: profile-leaf-empty-subject-needs-critical-san, -reads-criticality. Example: lemma_leaf_empty_subject.
    • Verdict change: webpki accepts these targets, so this is a new listed difference in the webpki differential.
    • This is not reported upstream: there is no attacker gain, and filing would be public.
  • Three unenforced X.509 clauses are now listed as modelling choices in the spec headers.
  • Clean-room SubjectPublicKeyInfo transcription (independent/spki.rs, 13 compute_only examples). Its author never read src/spki/.
  • Equivalence proof (independent/equivalence_spki.rs). I wrote the theorem statements; a different author wrote the proofs. They show the crate's key classification agrees with the transcription in both directions, for every key the crate classifies.
    • The header lists the divergences: keys the crate leaves Unsupported, and the RFC 8017 validity checks the crate does not make.
  • Limbo pins updated to the new counts. #[verifier::spinoff_prover] added on lemma_p15_equivalence.

Known gaps

  • subject_rule in the transcription is not yet proven to match the new empty-subject enforcement in path/profile.rs.
  • docs/phases/phase-3.md still quotes the old limbo counts (9,736/66). The new counts are 9,737/65.

Local verification

cargo xtask check passed.

cargo xtask verify --changed ended in FAILED, for two reasons:

  1. Clippy indexing_slicing in path/exec.rs: fixed in 1906c9d. Clippy is clean afterwards, the focused Verus run on leaf_profile verifies, and all 22 x509 test binaries pass.
  2. Two Verus rlimit timeouts in clazel-tls: lemma_retry_accepted (transcription_equivalence/client.rs) and lemma_hello_alert (driver.rs). The clazel-crypto steps after them were reported failed too.
    • clazel-tls depends only on vstd and is unchanged from main, whose CI is green. These look specific to this machine (macOS), but that is not confirmed.

The rest of that run passed:

  • clazel-x509 Verus: 1,462 verified, 0 errors.
  • Mutations: 276 killed, 0 survived.
  • x509-limbo: 9,737 pass, 65 expected failures, 0 fail.
  • webpki differential: 9,768 pass, 23 expected failures.
  • Real certificates: 868/868. Real chains: 760/760.

I did not rerun the whole verify --changed after the clippy fix.

CI's full verification has not run yet. The proof jobs need approval from a full-verification reviewer.

🤖 Generated with Claude Code

atiernan and others added 10 commits November 19, 2026 18:45
RFC 5280 §4.2.1.10: either permittedSubtrees or excludedSubtrees MUST be
present; X.509 §9.4.2.2: at least one shall be present. The spec now
refuses the empty SEQUENCE in parse_name_constraints_fields, as
policy_constraints already does for its own. A new mutation is certified
by lemma_empty_name_constraints_are_rejected; the trailing-bytes
mutation's witness moves to a non-empty value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The exec decoder follows the spec. The independent transcription's
equivalence no longer excludes the empty value (both now refuse it), the
unit test flips, and limbo's both-null case is now refused because the
intermediate does not decode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
basicConstraints' criticality (path/spec.rs: two NSS roots are
non-critical; Chrome and webpki do not read it), policyConstraints on
the target (path/profile.rs: RFC 5280 §6.1.5 (b) processes it), and
X.501 §9.3's distinct types within an RDN (name/spec.rs: RFC 5280 does
not ask it). Comments only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pec)

RFC 5280 §4.1.2.6: if the subject is an empty sequence, the
subjectAltName extension MUST be critical. A new (R) step 4 in
profile::leaf_profile refuses the target as PathError::Leaf, as Chrome
does (BoringSSL ParsedCertificate::Create). lemma_leaf_empty_subject
gives both directions; two mutations are certified by it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…xec, tests)

path::exec::leaf_profile follows the spec's step 4. x509-limbo's
rfc5280::san::noncritical-with-empty-subject now agrees (65 expected
failures, from 66) and becomes a rustls-webpki difference (LEAF).
equivalence_requirements.rs records subject_rule as enforced on the
target, not yet proven against the predicate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…equivalence

One more limbo certificate's nameConstraints does not decode (the
empty-NameConstraints intermediate), and one case leaves "accepted by
both" in the webpki differential (the empty-subject target).
lemma_p15_equivalence ran out of rlimit with the profile's new
definitions in the crate; it needs none of them, and verifies in its
own prover context.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Written from RFC 5280, 3279, 4055, 5480, 8410, 8017 §3.1, 7748 §5 and
8032 §5 without reading src/spki/. Its header lists what the author read
and every modelling choice. 13 compute_only examples, including a real
RSA-2048 and P-256 key and RFC 8410 §4's Ed25519 example. No equivalence
proof covers it yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
theorem_spki_classification_fwd/back: on RSA and uncompressed P-256 and
P-384 keys, spki/spec.rs and independent/spki.rs classify the same keys,
with the same RSAPublicKey octets and integer values or the same point.
The header lists where they differ (keys the crate leaves Unsupported,
RFC 8017 validity checks) and why. Statements by one author, proofs by
another; neither wrote the transcription.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ippy)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The claim stands only if CI's full verification on this pull request is
green; until then it is unproven.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@atiernan
atiernan deployed to full-verification November 20, 2026 04:49 — with GitHub Actions Active

This branch was successfully deployed

1 active deployment
full-verification — ae7505a0 Deployed Nov 20, 2026 by atiernan via Approve the proofs #605
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