Skip to content

Fix IDNA matching#10331

Open
embhorn wants to merge 3 commits intowolfSSL:masterfrom
embhorn:zd21706
Open

Fix IDNA matching#10331
embhorn wants to merge 3 commits intowolfSSL:masterfrom
embhorn:zd21706

Conversation

@embhorn
Copy link
Copy Markdown
Member

@embhorn embhorn commented Apr 27, 2026

Description

Handle IDNA wildcards

Fixes zd21706

Testing

Added test_wolfSSL_MatchDomainName_idn

Checklist

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

@embhorn embhorn self-assigned this Apr 27, 2026
Copilot AI review requested due to automatic review settings April 27, 2026 21:49
Copy link
Copy Markdown
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

Updates wolfSSL’s hostname matching to properly handle IDNA (punycode “xn--” A-label) cases by tightening wildcard behavior and adding targeted regression tests.

Changes:

  • Add A-label detection and block wildcard matching when IDNA A-labels are involved (per RFC 6125 / RFC 9525 guidance).
  • Introduce a helper to validate whether an input is a well-formed FQDN and use it to gate wildcard behavior under WOLFSSL_LEFT_MOST_WILDCARD_ONLY.
  • Add new API tests covering IDNA wildcard edge cases and FQDN validation boundaries.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/internal.c Adds IDNA A-label gating logic to MatchDomainName() and integrates FQDN validation for stricter wildcard-only mode.
wolfcrypt/src/asn.c Adds wolfssl_local_IsValidFQDN() helper used by domain matching logic.
wolfssl/wolfcrypt/asn.h Exposes wolfssl_local_IsValidFQDN() for in-tree testing via WOLFSSL_TEST_VIS.
wolfssl/internal.h Changes MatchDomainName() declaration visibility to WOLFSSL_TEST_VIS to support direct test calls.
tests/api/test_ossl_x509.c Adds new unit tests for wolfssl_local_IsValidFQDN() and IDNA wildcard matching; strengthens existing IP/hostname regression coverage.
tests/api/test_ossl_x509.h Registers the newly added tests in the ossl_x509 test group.

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

Comment thread tests/api/test_ossl_x509.c
Comment thread src/internal.c
Comment thread tests/api/test_ossl_x509.c Outdated
Comment thread tests/api/test_ossl_x509.c Outdated
Comment thread wolfcrypt/src/asn.c Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 27, 2026

MemBrowse Memory Report

No memory changes detected for:

@embhorn embhorn requested a review from douzzer April 28, 2026 21:31
@dgarske dgarske assigned embhorn and unassigned embhorn May 5, 2026
Copy link
Copy Markdown

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #10331

Scan targets checked: wolfssl-bugs, wolfssl-src

No new issues found in the changed files. ✅

@embhorn embhorn marked this pull request as ready for review May 5, 2026 20:41
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