Skip to content

fix to free CRL reason extension#9974

Open
JacobBarthelmeh wants to merge 1 commit intowolfSSL:masterfrom
JacobBarthelmeh:oss-fuzz
Open

fix to free CRL reason extension#9974
JacobBarthelmeh wants to merge 1 commit intowolfSSL:masterfrom
JacobBarthelmeh:oss-fuzz

Conversation

@JacobBarthelmeh
Copy link
Contributor

@JacobBarthelmeh JacobBarthelmeh self-assigned this Mar 13, 2026
Copilot AI review requested due to automatic review settings March 13, 2026 22:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a memory leak reported by OSS-Fuzz when parsing CRLs that contain per-revoked-entry reason extensions, and adds a regression test plus test fixtures to exercise the affected cleanup path.

Changes:

  • Free revoked-entry extensions during FreeDecodedCRL() teardown under OPENSSL_EXTRA.
  • Add an API test that loads a CRL containing a revoked-entry reason extension to validate cleanup.
  • Add/generate and distribute a new CRL fixture (crl_reason.pem) used by the test.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
wolfcrypt/src/asn.c Frees revoked certificate extensions during CRL decode cleanup to address a leak.
tests/api/test_certman.h Registers a new CRL cleanup regression test in the certman test group.
tests/api/test_certman.c Adds a regression test that loads a CRL with reason-code entry extensions.
certs/renewcerts.sh Documents the newly added CRL fixture in the cert renewal script header comment.
certs/crl/include.am Distributes the new CRL fixture as part of EXTRA_DIST.
certs/crl/gencrls.sh Adds steps to generate the new “reason extension” CRL fixture.
certs/crl/crl_reason.pem Adds the CRL fixture used by the new regression test.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +1 to +4
Certificate Revocation List (CRL):
Version 2 (0x1)
Signature Algorithm: sha256WithRSAEncryption
Issuer: C=US, ST=Montana, L=Bozeman, O=Sawtooth, OU=Consulting, CN=www.wolfssl.com, emailAddress=info@wolfssl.com
Comment on lines +284 to +297
echo "Step 37 reason-extension CRL revoke"
openssl ca -config ../renewcerts/wolfssl.cnf -revoke ../server-cert.pem \
-crl_reason keyCompromise -keyfile ../ca-key.pem -cert ../ca-cert.pem
check_result $?

echo "Step 38 reason-extension CRL"
openssl ca -config ../renewcerts/wolfssl.cnf -gencrl -crldays 3650 \
-out crl_reason.pem -keyfile ../ca-key.pem -cert ../ca-cert.pem
check_result $?

# metadata
echo "Step 39"
openssl crl -in crl_reason.pem -text > tmp
check_result $?
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