Skip to content

Disallow matching URI type in CheckForAltNames. NULL *response on error in wolfSSL_d2i_OCSP_RESPONSE.#10509

Merged
JacobBarthelmeh merged 4 commits into
wolfSSL:masterfrom
kareem-wolfssl:zd21863_5
May 29, 2026
Merged

Disallow matching URI type in CheckForAltNames. NULL *response on error in wolfSSL_d2i_OCSP_RESPONSE.#10509
JacobBarthelmeh merged 4 commits into
wolfSSL:masterfrom
kareem-wolfssl:zd21863_5

Conversation

@kareem-wolfssl

Copy link
Copy Markdown
Contributor

Description

Fixes zd#21863, zd#21865

Testing

Built in tests, provided reproducers

Checklist

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

@kareem-wolfssl kareem-wolfssl self-assigned this May 20, 2026
Copilot AI review requested due to automatic review settings May 20, 2026 23:34

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 addresses two certificate/OCSP edge cases: (1) TLS hostname matching should not treat URI SANs as DNSName SANs, and (2) wolfSSL_d2i_OCSP_RESPONSE() should NULL out a caller-supplied *response on failure to avoid leaving a dangling pointer.

Changes:

  • Update CheckForAltNames() to skip uniformResourceIdentifier SANs when performing DNS hostname checks.
  • Update wolfSSL_d2i_OCSP_RESPONSE() error paths to clear *response when the caller passed a reusable response pointer.
  • Add regression tests covering URI SAN hostname-matching behavior and OCSP response reuse failure semantics.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
wolfcrypt/src/asn.c Updates in-code documentation clarifying URI SAN handling vs CN fallback behavior.
src/internal.c Skips URI SAN entries during DNS hostname matching in CheckForAltNames().
src/ocsp.c Clears caller’s *response on allocation/decode failures in wolfSSL_d2i_OCSP_RESPONSE().
tests/api/test_ocsp.c Adds a test to ensure *response is NULLed on reuse + decode failure.
tests/api/test_certman.h Registers a new certman API test.
tests/api/test_certman.c Adds a test ensuring URI SANs don’t satisfy DNS hostname checks (and validates behavior when DNS SAN is also present).

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

Comment thread src/ocsp.c Outdated
@github-actions

github-actions Bot commented May 20, 2026

Copy link
Copy Markdown

MemBrowse Memory Report

No memory changes detected for:

@harukioya

Copy link
Copy Markdown

The changes look good. Thank you for the prompt response.

Comment thread src/internal.c Outdated
Comment thread src/ocsp.c Outdated
Comment thread wolfcrypt/src/asn.c Outdated
Thanks to Haruki Oyama (Waseda University) for the report.
Thanks to Zou Dikai for the report.
Remove outdated RFC, refactor into single error case, guard against negative/0 len and NULL *data pointer, don't set ownStatus until status is confirmed non-NULL.
@julek-wolfssl julek-wolfssl removed their assignment May 29, 2026
@JacobBarthelmeh JacobBarthelmeh merged commit 9fa5db5 into wolfSSL:master May 29, 2026
468 of 469 checks passed
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.

6 participants