Invalidate cached STACK_OF(X509_REVOKED) when the CRL list head changes - #11427
Open
gasbytes wants to merge 1 commit into
Open
Invalidate cached STACK_OF(X509_REVOKED) when the CRL list head changes#11427gasbytes wants to merge 1 commit into
gasbytes wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Pull request overview
This PR fixes a stale-cache issue where crl->revokedStack (the cached STACK_OF(X509_REVOKED)) can remain built from an old CRL after the CRL list head is updated/replaced.
Changes:
- Invalidate
crl->revokedStackinAddCRL()andSwapLists()when CRL list updates occur. - Add a regression test that loads a CRL, builds the revoked cache, then updates the CRL and verifies the revoked serial changes.
- Register the new regression test in the API test suite.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
tests/api.c |
Adds and registers a regression test to ensure revoked-stack caching is refreshed after a CRL update. |
src/crl.c |
Clears the cached revoked stack when CRL head/list swaps occur to avoid returning stale revoked entries. |
Suppressed comments (1)
tests/api.c:1
- This assertion checks the raw ASN.1 integer encoding (
length/data) rather than the integer value, which can make the test more brittle if the underlying representation changes (even if the value is the same). If there is an accessor to retrieve the integer value (e.g., anASN1_INTEGER_get-style API in wolfSSL), prefer asserting on the numeric value instead of encoding details.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
gasbytes
force-pushed
the
crl-revoked-list-compat-api-fix
branch
from
September 10, 2026 15:07
92b3127 to
d9ae528
Compare
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.
Description
Clear crl->revokedStack in AddCrl() and SwpLists(), under the write lock they already hold.
Testing
Added a regression test that reproduces the behaviour (
test_wolfSSL_X509_CRL_get_REVOKED_after_update), which loads a newer CRL over it, and checks the second read reports the new serial.Checklist