Skip to content

Conversation

jschanck
Copy link
Collaborator

@jschanck jschanck commented Jul 1, 2025

Add a new CRL audit entry type for when a Partitioned CRL's issuingDistributionPoint extension does not match the URL that the CRL was fetched from.

Resolves #356.

@jschanck jschanck requested a review from mozkeeler July 1, 2025 23:32
Copy link
Collaborator

@mozkeeler mozkeeler left a comment

Choose a reason for hiding this comment

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

LGTM! Just a couple of comments.

@@ -233,7 +234,7 @@ func (mi *MozIssuers) LoadEnrolledIssuers(filePath string) error {
if err != nil {
return err
}
mi.InsertIssuerFromCertAndPem(cert, ei.Pem, nil)
mi.InsertIssuerFromCertAndPem(cert, ei.Pem, nil, false)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does go have a maybe/option type? It would be nice to ensure we're not accidentally using the value of usesPartitionedCrls when we don't load from the ccadb.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I updated this so now we pipe the usesPartitionedCrls flag through the enrolled.json file for use here.

crl, _ := x509.ParseCertificateListDER(crlBlock.Bytes)

fetchUrl := "http://example.com/1.crl"
if !crlIssuingDPMatches(crl, fetchUrl) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Am I missing something? I'm not seeing where this is defined... (is the review UI messing me up?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Whoops, refactored and forgot to update this test.

@jschanck jschanck force-pushed the validate-issuing-dp branch from a374df0 to c320747 Compare July 3, 2025 18:13
@jschanck jschanck requested a review from mozkeeler July 7, 2025 20:04
Copy link
Collaborator

@mozkeeler mozkeeler left a comment

Choose a reason for hiding this comment

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

LGTM!

for _, url := range crl.TBSCertList.IssuingDPFullNames.URIs {
urls = append(urls, url)
_, exists := aPartitionedCrlUrlSet[url]
if exists {
Copy link
Collaborator

Choose a reason for hiding this comment

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

If I'm understanding correctly, the effect of this check is that there could be a completely unrelated URL in the issuingDistributionPoints, but as long as it's not listed in aPartitionedCrlUrlSet, that's okay?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Right, it's ok for there to be multiple URLs for the same CRL in issuingDistributionPoints. But only one URL from issuingDistributionPoints should appear in aPartitionedCrlUrlSet since the URLs in that set must point to distinct CRLs.

@jschanck jschanck merged commit 053adf0 into mozilla:main Jul 7, 2025
4 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.

Check CRL Issuing Distribution Point extension of partitioned CRLs
2 participants