Skip to content

Conversation

@aarongable
Copy link
Contributor

@aarongable aarongable commented Oct 2, 2025

The issuePrecertificate, issuePrecertificateInner, and issueCertificateForPrecertificate helpers were originally necessary because the RA made two separate gRPC calls to the CA, before and after acquiring SCTs. Now, the CA handles acquiring SCTs itself, and there's only one gRPC entrypoint: ca.IssueCertficate. This means that the layers of abstraction represented by those old helpers are no longer necessary, and we can significantly simplify the CA's core logic.

Inline the contents of issuePrecertificate, issuePrecertificateInner, and issueCertificateForPrecertificate directly into IssueCertificate. Remove the sa.GetCertificate check, because it is now impossible for the final-certificate issuance code to have been reached except by progressing through the precert issuance code. Remove the need to derive an issuer and a profile from the precert, because we are still holding onto the exact same issuer and profile that were used to issue the precert.

Delete the unit tests which were only testing the underlying issuePrecertificate and issueCertificateForPrecertificate helpers. As of #8422, those tests were redundant. Move some helpers which were shared by the old and new tests to new homes closer to their now-sole callers.

Part of #8390


Warning

Do not merge before #8422

Copy link
Contributor

@jsha jsha left a comment

Choose a reason for hiding this comment

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

This is a very nice improvement!

Base automatically changed from issue-certificate-tests to main October 6, 2025 18:38
@aarongable aarongable marked this pull request as ready for review October 7, 2025 22:21
@aarongable aarongable requested a review from a team as a code owner October 7, 2025 22:21
@aarongable aarongable requested a review from jsha October 7, 2025 22:21
Copy link
Member

@beautifulentropy beautifulentropy left a comment

Choose a reason for hiding this comment

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

This change is wonderful! I really appreciate having all of this logic inlined, it's just so much cleaner and easier to reason about.

Just one question and a whitespace nit, but otherwise it's good to go.

// an error. If multiple such issuers exist, it selects one at random.
func (ca *certificateAuthorityImpl) pickIssuer(keyAlg x509.PublicKeyAlgorithm) (*issuance.Issuer, error) {
pool, ok := ca.issuers.byAlg[keyAlg]

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since I've got two approvals, I'm going to land this change, and then I'll remove this extra blank line in #8409.

@beautifulentropy beautifulentropy requested review from beautifulentropy and Copilot and removed request for Copilot October 15, 2025 23:42
@aarongable aarongable merged commit 74c95b7 into main Oct 16, 2025
12 checks passed
@aarongable aarongable deleted the ca-refactor branch October 16, 2025 17:17
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.

4 participants