-
Notifications
You must be signed in to change notification settings - Fork 51
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
revocation: more sophisticated revocation checking. #138
Conversation
Codecov Report
@@ Coverage Diff @@
## main #138 +/- ##
==========================================
+ Coverage 96.08% 96.21% +0.13%
==========================================
Files 15 15
Lines 4108 4304 +196
==========================================
+ Hits 3947 4141 +194
- Misses 161 163 +2
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
3b56bf9
to
78cdafa
Compare
I rebased this branch and addressed the first round of feedback but I've left is a draft because it's still missing test coverage. Will land that coverage ASAP and then flip this out of draft. |
cf06c99
to
c1e0045
Compare
Rebased and added some initial test coverage. I'm going to keep this as a draft for a little bit longer, the coverage isn't 100% there yet and the Python is getting pretty messy. Closer to its final form if someone is feeling eager to review :-) |
1705ddd
to
782aaa8
Compare
I think this branch is now ready for review. It's freshly rebased & there's now sufficient test coverage. |
782aaa8
to
64386d0
Compare
Messed up my rebase and over-squashed. Fixing that up now. |
ed1684f
to
ce94f2a
Compare
Done. |
ce94f2a
to
9ed69c4
Compare
Looks like a network flake:
Going to kick that task. |
This commit reworks the CRL revocation checking interface to allow specifying more policy for how CRLs should be used with a builder-based API. In particular: * The depth of revocation checking can be controlled, allowing users to only check the revocation status of end entity certificates. * Handling of unknown revocation status can be controlled, allowing users to decide if unknown status should be treated as an error or not. * We can ensure that when revocation options are provided, there is always at least one CRL to use.
This commit updates the CRL validation process so that when selecting a CRL we consider more than just whether the cert issuer matches the CRL issuer. As of this commit we consider a CRL authoritative for a certificate when: * The certificate issuer matches the CRL issuer and, * The certificate has no CRL distribution points, and the CRL has no issuing distribution point extension. * Or, the certificate has no CRL distribution points, but the the CRL has an issuing distribution point extension with a scope that includes the certificate. * Or, the certificate has CRL distribution points, and the CRL has an issuing distribution point extension with a scope that includes the certificate, and at least one distribution point full name is a URI type general name that can also be found in the CRL issuing distribution point full name general name sequence. In all other circumstances the CRL is not considered authoritative. If we can't find an authoritative CRL from the set of loaded CRLs the certificate will be considered as having unknown revocation status. Whether this is an error or not is controlled by the user provided revocation policy.
Extends existing integration tests for new revocation logic. Also de-duplicates the owned/borrowed test generation.
9ed69c4
to
3b4f7ad
Compare
This branch resolves the issues highlighted in #121, enforcing that certificate CRL coverage is handled properly, and unknown revocation status can be treated as an error condition when appropriate.
revocation: policy for unknown revocation status.
This commit reworks the CRL revocation checking interface to allow specifying more policy for how CRLs should be used with a builder-based API.
In particular:
revocation: use cert CRL DP and CRL IDP extensions.
This commit updates the CRL validation process so that when selecting a CRL we consider more than just whether the cert issuer matches the CRL issuer.
As of this commit we consider a CRL authoritative for a certificate when:
In all other circumstances the CRL is not considered authoritative. If we can't find an authoritative CRL from the set of loaded CRLs the certificate will be considered as having unknown revocation status. Whether this is an error or not is controlled by the user provided revocation policy.
tests: integration tests for new revocation logic.
Extends existing integration tests for new revocation logic. Also de-duplicates the owned/borrowed test generation.
misc: clippy fixes
Addresses some
clippy
findings that bubbled up while working on this branch.