Skip to content

Deep copy revoked cert entry extensions in DupCRL_Entry() - #11038

Draft
gasbytes wants to merge 1 commit into
wolfSSL:masterfrom
gasbytes:dupcrl_entry-copies-fix
Draft

Deep copy revoked cert entry extensions in DupCRL_Entry()#11038
gasbytes wants to merge 1 commit into
wolfSSL:masterfrom
gasbytes:dupcrl_entry-copies-fix

Conversation

@gasbytes

@gasbytes gasbytes commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

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

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

Copilot AI review requested due to automatic review settings August 3, 2026 15:15
@gasbytes gasbytes self-assigned this Aug 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.extensions buffers during CRL_Entry duplication when CRL_STATIC_REVOKED_LIST + OPENSSL_EXTRA are 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
gasbytes force-pushed the dupcrl_entry-copies-fix branch from b1a40f9 to 93223d3 Compare August 3, 2026 15:21
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.

2 participants