Visitar URL original
mtcb: self-verify standalone certificates by jsha · Pull Request #9119 · letsencrypt/boulder · GitHub
Skip to content

mtcb: self-verify standalone certificates - #9119

Open
jsha wants to merge 1 commit into
mainfrom
self-verify
Open

jsha wants to merge 1 commit into
mainfrom
self-verify

Conversation

@jsha

@jsha jsha commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

This factors out the core of verifyStandalone from mtcb_test.go into an exported function verifymtc.Standalone, and calls it from MTCB.

Move body of MTCAID() helper to issuancelog so we don't need an *issuance.Certificate to access it.

Add helper issuancelog.ID.CACosignerName().

Add real signatures to MTCB tests so they can pass the new check.

Code written by me; tests written by LLM (with extensive hacking to make them more readable / sensible).

Part of #9085.

Note: the tests sign cosigned.Message directly rather than use a helper. That's intentional since the helper is landing in a different change stack.

@jsha
jsha added this pull request to stack #9116 October 23, 2026 23:31
@jsha
jsha marked this pull request as ready for review October 23, 2026 23:40
@jsha
jsha requested a review from a team as a code owner October 23, 2026 23:40
@jsha
jsha requested a review from aarongable October 23, 2026 23:40
@aarongable
aarongable force-pushed the self-verify branch 2 times, most recently from 1ef80bb to 8599c13 Compare October 26, 2026 19:18
Base automatically changed from reloid-in-cosignature to main October 26, 2026 19:48
This factors out the core of `verifyStandalone` from `mtcb_test.go` into an
exported function `verifymtc.Standalone`, and calls it from MTCB.

Move body of MTCAID() helper to `issuancelog` so we don't need an
`*issuance.Certificate` to access it.

Add helper issuancelog.ID.CACosignerName().

Add real signatures to MTCB tests so they can pass the new check.

Code written by me; tests written by LLM (with extensive hacking to make them
more readable / sensible).
Comment on lines +33 to +41
if !bytes.Equal(cert.RawIssuer, issuer.RawSubject) {
return fmt.Errorf("end-entity issuer %q does not match issuer's subject %q",
cert.Issuer, issuer.Subject)
}

mtcaID, err := issuancelog.MTCAID(issuer)
if err != nil {
return err
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For the sake of future-proofing this code to support multiple issuers, it seems like these should be in the opposite order: first extract the issuer's MTCAID from the cert being verified, then confirm that this value actually matches the issuer we want to verify with (or use it to look up the issuer from a map).

I think we're going to need both SubjectMTCAID(caCert) and issuerMTCAID(subjectCert), just like we have issuance.SubjectNameID and issuance.IssuerNameID today.


// MTCAID returns the trust anchor ID from this issuer certificate's Subject. It
// returns an error for issuers that are not MTC CAs.
func MTCAID(caCert *x509.Certificate) (*reloid.RelativeOID, error) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's not obvious to me that this package is the right place for this code to live. It's not about the identity of a log, it's about the identity of an issuer. And (as noted in my other comment below) we're going to need two versions of this function: to extract the MTCAID from the Subject field of a CA, and to extract it from the Issuer field of an end-entity cert.

Maybe it belongs in Core along-side Encode/DecodeMTCSerial?


for _, sig := range mtcProof.Signatures {
// Ignore all signatures except the one for the CA we are verifying against.
// TODO: also check mirror signatures for mirrors we recognize.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tie a bug to this TODO

@aarongable
aarongable requested review from a team and beautifulentropy and removed request for a team October 28, 2026 19:32
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