Fix CRL selection by cRLNumber and scope#491
Open
xyzzyz wants to merge 1 commit into
Open
Conversation
Previously, we used the first CRL with applicable scope on the passed list, without checking that it's the newest one we have. In the new logic, once we find a CRL with applicable scope, we find the newest available CRL in the same scope, and use that for revocation check.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #491 +/- ##
==========================================
- Coverage 97.01% 96.92% -0.10%
==========================================
Files 20 20
Lines 3950 3996 +46
==========================================
+ Hits 3832 3873 +41
- Misses 118 123 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Fixes the issue in #488.
Previously, we used the first CRL with applicable scope on the passed list, without checking that it's the newest one we have.
In the new logic, once we find a CRL with applicable scope, we find the newest available CRL in the same scope, and use that for revocation check. We decide which is newest by CRL number, as RFC 5280 explicitly requires these to be present, and offers them for exactly this purpose:
There are some design considerations for handling scenarios when multiple scopes are applicable, and when some CRLs are invalid. These apply to pre-existing code too, so I'm not resolving these in this fix, and instead I'll open a separate issue to discuss them.
I used Codex GPT-5.5 on xhigh while working on this change, but I must say that it while it was very helpful with writing tests, it didn't do a good job on implementing the actual logic: its implementation was overly complicated, with extra unnecessary variables and unnecessarily nested match cases. I basically entirely rewrote it.