Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add interface types for TimestampingAuthority and CertificateAuthority #300

Merged
merged 10 commits into from
Oct 22, 2024

Conversation

codysoyland
Copy link
Member

This PR modifies the TrustedMaterial interface with interface types for CertificateAuthority and TimestampingAuthority. This decouples the original CertificateAuthority struct from the verifier and allows clients to have more control over the verification of certificates and timestamps.

Additionally, this PR modifies the verifier to output the chains of certificates that were used to verify the certificate, which has the added benefit of improving performance of the SCT verifier by only attempting SCT verification on the chain that was used to verify the certificate.

This is a breaking change to the TrustedMaterial interface, so clients that directly modify TrustedMaterial must be updated to use the new interface types.

Fixes #293

Summary

Release Note

Documentation

@codysoyland codysoyland requested a review from a team as a code owner September 28, 2024 19:23
Signed-off-by: Cody Soyland <[email protected]>
Copy link
Member

@kommendorkapten kommendorkapten left a comment

Choose a reason for hiding this comment

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

Nice work!

Copy link
Contributor

@haydentherapper haydentherapper left a comment

Choose a reason for hiding this comment

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

Thanks! Just a few comments about testing and some clean up.

pkg/root/trusted_root.go Outdated Show resolved Hide resolved
pkg/root/certificate_authority.go Outdated Show resolved Hide resolved
pkg/root/certificate_authority.go Show resolved Hide resolved
pkg/verify/sct.go Outdated Show resolved Hide resolved
pkg/verify/tsa.go Outdated Show resolved Hide resolved
pkg/verify/tsa.go Show resolved Hide resolved
Copy link
Member

@steiza steiza left a comment

Choose a reason for hiding this comment

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

One small suggested change, otherwise LGTM!

pkg/verify/sct.go Outdated Show resolved Hide resolved
@@ -564,7 +566,7 @@ func (v *SignedEntityVerifier) Verify(entity SignedEntity, pb PolicyBuilder) (*V
// > Unless performing online verification (see §Alternative Workflows), the Verifier MUST extract the SignedCertificateTimestamp embedded in the leaf certificate, and verify it as in RFC 9162 §8.1.3, using the verification key from the Certificate Transparency Log.

if v.config.weExpectSCTs {
err = VerifySignedCertificateTimestamp(leafCert, v.config.ctlogEntriesThreshold, v.trustedMaterial)
err = VerifySignedCertificateTimestamp(chains, v.config.ctlogEntriesThreshold, v.trustedMaterial)
Copy link
Member

Choose a reason for hiding this comment

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

I love this change - that we're actually verifying the SCT against the chain the leaf cert verified with!

codysoyland and others added 3 commits October 14, 2024 15:32
Signed-off-by: Cody Soyland <[email protected]>
Co-authored-by: Zach Steindler <[email protected]>
Signed-off-by: Cody Soyland <[email protected]>
@codysoyland codysoyland requested a review from a team October 15, 2024 20:20
steiza
steiza previously approved these changes Oct 17, 2024
Copy link
Member

@steiza steiza left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@steiza steiza left a comment

Choose a reason for hiding this comment

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

Still LGTM!

Copy link
Contributor

@haydentherapper haydentherapper left a comment

Choose a reason for hiding this comment

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

fantastic work!

@haydentherapper haydentherapper merged commit f29b7f4 into main Oct 22, 2024
11 checks passed
@haydentherapper haydentherapper deleted the trusted-material-interface-types branch October 22, 2024 22:16
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.

Proposal: TrustedMaterial Interface Refinement
4 participants