Deep copy revoked cert entry extensions in DupCRL_Entry() - #11038
Draft
gasbytes wants to merge 1 commit into
Draft
Deep copy revoked cert entry extensions in DupCRL_Entry()#11038gasbytes wants to merge 1 commit into
gasbytes wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes an ownership/aliasing bug when duplicating CRLs in configurations that use a static revoked list and OpenSSL-compat behavior: revoked-entry extension DER buffers are now deep-copied in DupCRL_Entry() to avoid duplicated CRLs sharing the same extensions pointers. It also adds a regression test that exercises the wolfSSL_X509_CRL_dup() path and asserts the duplicated CRL owns distinct extension buffers.
Changes:
- Deep-copy
RevokedCert.extensionsbuffers duringCRL_Entryduplication whenCRL_STATIC_REVOKED_LIST+OPENSSL_EXTRAare enabled. - Add a regression test for
wolfSSL_X509_CRL_dup()ensuring revoked-entry extension buffers are not aliased. - Register the new test in the cert manager API test list.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/crl.c |
Fixes DupCRL_Entry() to allocate/copy per-entry extension buffers to prevent pointer aliasing/double-free risks. |
tests/api/test_certman.c |
Adds regression test covering X509_CRL_dup for static revoked list extension ownership. |
tests/api/test_certman.h |
Declares and registers the new regression test in the certman test group. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ATIC_REVOKED_LIST and OPENSSL_EXTRA are enabled, and add a regression test for the X509_CRL_dup path.
gasbytes
force-pushed
the
dupcrl_entry-copies-fix
branch
from
August 3, 2026 15:21
b1a40f9 to
93223d3
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
Deep copy revoked cert entry extensions in DupCRL_Entry() when CRL_STATIC_REVOKED_LIST and OPENSSL_EXTRA are enabled, and add a regression test for the X509_CRL_dup path.
Fixes zd#
Testing
Added regression test test_wolfSSL_CRL_static_revoked_list_dup in the testsuite;
Checklist