Skip to content

Map name/IP mismatches to X509_V_* codes in GetX509Error() - #11260

Open
julek-wolfssl wants to merge 1 commit into
wolfSSL:masterfrom
julek-wolfssl:x509-get-error
Open

Map name/IP mismatches to X509_V_* codes in GetX509Error()#11260
julek-wolfssl wants to merge 1 commit into
wolfSSL:masterfrom
julek-wolfssl:x509-get-error

Conversation

@julek-wolfssl

Copy link
Copy Markdown
Member

SetupStoreCtxCallback() runs the handshake store-ctx error through GetX509Error() under OPENSSL_COMPATIBLE_DEFAULTS, but that function passed DOMAIN_NAME_MISMATCH / IPADDR_MISMATCH through unmapped, so X509_STORE_CTX_get_error() reported the internal codes for peer name mismatches in that build.

  • src/x509_str.c: add DOMAIN_NAME_MISMATCH / IPADDR_MISMATCH cases to GetX509Error(), mapping them to WOLFSSL_X509_V_ERR_HOSTNAME_MISMATCH / WOLFSSL_X509_V_ERR_IP_ADDRESS_MISMATCH to match OpenSSL.
  • Default builds keep returning the internal codes, unchanged.

Copilot AI lite review requested due to automatic review settings August 25, 2026 16:31
@julek-wolfssl julek-wolfssl self-assigned this Aug 25, 2026
@wolfSSL-Bot

Copy link
Copy Markdown

Can one of the admins verify this patch?

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

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.

Maps internal peer name mismatch errors to OpenSSL-compatible X509_V_ERR_* codes so X509_STORE_CTX_get_error() reports expected values when OPENSSL_COMPATIBLE_DEFAULTS is enabled.

Changes:

  • Map DOMAIN_NAME_MISMATCH to WOLFSSL_X509_V_ERR_HOSTNAME_MISMATCH in GetX509Error().
  • Map IPADDR_MISMATCH to WOLFSSL_X509_V_ERR_IP_ADDRESS_MISMATCH in GetX509Error().

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/x509_str.c
SetupStoreCtxCallback() runs the handshake store-ctx error through
GetX509Error() only under OPENSSL_COMPATIBLE_DEFAULTS, and that
function passed DOMAIN_NAME_MISMATCH / IPADDR_MISMATCH through
unmapped, so X509_STORE_CTX_get_error() reported the internal codes
for peer name mismatches in that build. Add the two cases so it
reports WOLFSSL_X509_V_ERR_HOSTNAME_MISMATCH /
WOLFSSL_X509_V_ERR_IP_ADDRESS_MISMATCH, matching OpenSSL. Default
builds keep returning the internal codes, unchanged.

src/x509_str.c: add DOMAIN_NAME_MISMATCH / IPADDR_MISMATCH cases to
GetX509Error().
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.

3 participants