Skip to content

fix: enforce X.509 chain validity and CA constraints - #295

Merged
imran-siddique merged 2 commits into
mainfrom
agent/enforce-certificate-chain-constraints
Aug 11, 2026
Merged

fix: enforce X.509 chain validity and CA constraints#295
imran-siddique merged 2 commits into
mainfrom
agent/enforce-certificate-chain-constraints

Conversation

@imran-siddique

Copy link
Copy Markdown
Member

Summary

Harden the shared hardware-attestation certificate-chain verifier beyond signature linkage and root fingerprint pinning.

Every certificate must now be valid at verification time. Every issuer, including the pinned root, must carry BasicConstraints(ca=True). When an issuer declares KeyUsage, it must permit certificate signing. A timezone-aware verification_time hook supports deterministic verification and testing.

Root cause

verify_cert_chain() previously verified only child signatures/issuer names and the final root fingerprint. A cryptographically linked chain could therefore pass even when a certificate was expired or an intermediate was not authorized to act as a CA.

Validation

  • 16 focused certificate-chain tests passed
  • 852 full-suite tests passed, 4 skipped
  • mypy: clean
  • Bandit: clean
  • git diff --check: clean

Regression coverage includes expired leaves, non-CA intermediates, forbidden certificate-signing key usage, and naive verification times.

Documentation

  • Expanded API docstrings with the enforced constraints
  • Added an Unreleased security changelog entry

Signed-off-by: Imran Siddique <imran.siddique@opaque.co>
@imran-siddique
imran-siddique marked this pull request as ready for review August 11, 2026 16:01
@imran-siddique
imran-siddique merged commit f48b96b into main Aug 11, 2026
13 checks passed
@imran-siddique
imran-siddique deleted the agent/enforce-certificate-chain-constraints branch August 11, 2026 16:22
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