Fix IDNA matching#10331
Open
embhorn wants to merge 3 commits intowolfSSL:masterfrom
Open
Conversation
Contributor
There was a problem hiding this comment.
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.
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #10331
Scan targets checked: wolfssl-bugs, wolfssl-src
No new issues found in the changed files. ✅
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Handle IDNA wildcards
Fixes zd21706
Testing
Added
test_wolfSSL_MatchDomainName_idnChecklist