Skip to content

Update certificates used in handlers_test.go #218

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

Merged
merged 5 commits into from
Mar 27, 2025

Conversation

phbnf
Copy link
Collaborator

@phbnf phbnf commented Mar 26, 2025

Towards #103, #217.

This PR:

  1. create a new issuance chain with an intermediate, chaining to the root introduced by gen.go
  2. uses that issuance chain in handlers_test.go, rather than a different chain, thus ensuring that all chains in this file chain up to the same root
  3. defines TestAddChainWhitespace requests programmatically rather than hardcoding them.

@phbnf phbnf requested a review from roger2hk March 26, 2025 15:14
@phbnf phbnf marked this pull request as ready for review March 26, 2025 15:24
@@ -287,6 +287,160 @@ var PreCertFromPreIntermediate string

// Issuance chain 3
// ================
// The next section holds:
// - an intermediate with signed with the root above.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// - an intermediate with signed with the root above.
// - an intermediate signed with the root above.

}
leafPreCert, err := chainGenerator.certificate(200, true, notBefore)
if err != nil {
klog.Fatalf("Failed to generate leaf certificate: %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
klog.Fatalf("Failed to generate leaf certificate: %v", err)
klog.Fatalf("Failed to generate leaf pre-certificate: %v", err)

klog.Fatalf("Failed to generate leaf certificate: %v", err)
}
if err := saveCertificatePEM(leafPreCert, path.Join(*outputPath, "test_leaf_pre_cert_signed_by_intermediate.pem")); err != nil {
klog.Fatalf("Failed to save leaf cert: %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
klog.Fatalf("Failed to save leaf cert: %v", err)
klog.Fatalf("Failed to save leaf pre-cert: %v", err)

@phbnf phbnf merged commit f47a591 into transparency-dev:main Mar 27, 2025
6 checks passed
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