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

ceremony: Add support for CRL onlyContainsCACerts #7064

Merged
merged 38 commits into from
Oct 3, 2023

Conversation

pgporada
Copy link
Member

@pgporada pgporada commented Aug 31, 2023

  • Allows the ceremony tool to add the onlyContainsCACerts flag to the IssuingDistributionPoint extension[1] for CRLs.
  • Add a lint to detect basic usage of this new flag.
  • Add a helper function which doesn't (yet) exist in golang x/crypto/cryptobyte named ReadOptionalASN1BooleanWithTag which searches for an optional DER-encoded ASN.1 element tagged with a given tag e.g. onlyContainsUserCerts and reports values back to the caller.
  • Each revoked certificate in the CRL config is checked for is IsCA to maintain conformance with RFC 5280 Section 6.3.3 b.2.iii [2].

    (iii) If the onlyContainsCACerts boolean is asserted in the
    IDP CRL extension, verify that the certificate
    includes the basic constraints extension with the cA
    boolean asserted.

Fixes #7047

  1. https://datatracker.ietf.org/doc/html/rfc5280#section-5.2.5
  2. https://datatracker.ietf.org/doc/html/rfc5280#section-6.3.3

@pgporada pgporada changed the title ceremony: Add support for CRL OnlyContainsCACerts ceremony: Add support for CRL onlyContainsCACerts Sep 5, 2023
@pgporada pgporada marked this pull request as ready for review September 5, 2023 18:45
@pgporada pgporada requested a review from a team as a code owner September 5, 2023 18:45
@pgporada pgporada requested review from aarongable and removed request for beautifulentropy September 5, 2023 18:53
cmd/ceremony/crl.go Outdated Show resolved Hide resolved
cmd/ceremony/crl_test.go Outdated Show resolved Hide resolved
@pgporada pgporada marked this pull request as draft September 7, 2023 21:23
… lints into subscriber cert and subordinate CA
Copy link
Contributor

@aarongable aarongable left a comment

Choose a reason for hiding this comment

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

Ceremony code LGTM! Just iterating on the lints.

cmd/ceremony/crl.go Outdated Show resolved Hide resolved
linter/lints/cpcps/lint_crl_has_idp_subscriber_cert.go Outdated Show resolved Hide resolved
@pgporada
Copy link
Member Author

pgporada commented Sep 7, 2023 via email

@pgporada pgporada marked this pull request as ready for review September 14, 2023 18:42
@pgporada pgporada requested a review from aarongable September 14, 2023 18:42
@pgporada
Copy link
Member Author

pgporada commented Sep 14, 2023

Tomorrow turned out to take a whole week, but 🤷🏼‍♂️.

Copy link
Contributor

@aarongable aarongable left a comment

Choose a reason for hiding this comment

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

Just a few small comments on the lints. This looks so good!

linter/lints/cabf_br/lint_crl_validity_period.go Outdated Show resolved Hide resolved
linter/lints/cabf_br/lint_crl_validity_period.go Outdated Show resolved Hide resolved
linter/lints/cabf_br/lint_crl_validity_period.go Outdated Show resolved Hide resolved
linter/lints/cabf_br/lint_crl_validity_period.go Outdated Show resolved Hide resolved
linter/lints/cpcps/lint_crl_has_idp.go Outdated Show resolved Hide resolved
linter/lints/cpcps/lint_crl_has_idp.go Show resolved Hide resolved
linter/lints/cpcps/lint_crl_has_idp.go Outdated Show resolved Hide resolved
linter/lints/cpcps/lint_crl_has_idp.go Outdated Show resolved Hide resolved
linter/lints/common.go Outdated Show resolved Hide resolved
linter/lints/common.go Outdated Show resolved Hide resolved
linter/lints/cabf_br/lint_crl_validity_period.go Outdated Show resolved Hide resolved
linter/lints/common.go Outdated Show resolved Hide resolved
linter/lints/common.go Outdated Show resolved Hide resolved
linter/lints/common.go Outdated Show resolved Hide resolved
linter/lints/common.go Outdated Show resolved Hide resolved
linter/lints/common.go Outdated Show resolved Hide resolved
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 looking really nice now. In particular, you've now split out the parsing of the ASN.1 from validating the parsed contents. One final step if you'd like to take it: you could factor out the parsing of the ASN.1 into a helper function that returns an issuingDistributionPoint struct:

type issuingDistributionPoint struct {
  distributionPointURI *url.URL
  onlyContainsUserCerts bool
  onlyContainsCACerts bool
}

This would allow you to reuse some code between cpcps and the cabf_br lifetime check.

linter/lints/common.go Outdated Show resolved Hide resolved
linter/lints/common.go Outdated Show resolved Hide resolved
linter/lints/common.go Outdated Show resolved Hide resolved
linter/lints/cpcps/lint_crl_has_idp.go Outdated Show resolved Hide resolved
linter/lints/cpcps/lint_crl_has_idp.go Outdated Show resolved Hide resolved
linter/lints/common.go Outdated Show resolved Hide resolved
linter/lints/cpcps/lint_crl_has_idp.go Outdated Show resolved Hide resolved
linter/lints/cpcps/lint_crl_has_idp.go Outdated Show resolved Hide resolved
linter/lints/cpcps/testdata/crl_idp_https.pem Outdated Show resolved Hide resolved
linter/lints/cabf_br/lint_crl_validity_period.go Outdated Show resolved Hide resolved
linter/lints/cabf_br/lint_crl_validity_period.go Outdated Show resolved Hide resolved
linter/lints/cabf_br/lint_crl_validity_period.go Outdated Show resolved Hide resolved
@pgporada pgporada requested review from aarongable and jsha October 2, 2023 19:52
@aarongable aarongable merged commit 5c98bf6 into main Oct 3, 2023
12 checks passed
@aarongable aarongable deleted the crl-only-contains-ca-certs-flag branch October 3, 2023 00:03
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.

crl ceremony: include "onlyContainsCACerts" flag
3 participants