-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix CIDR notation queries with libidn2 #53
Conversation
How about IPv6? Please test "whois 2001:67c:2178:8::13" See https://bugzilla.opensuse.org/show_bug.cgi?id=1026831#c5
|
Fixes #50 Fixes https://bugzilla.opensuse.org/show_bug.cgi?id=1026831 Signed-off-by: Andreas Stieger <astieger@suse.com>
The last push fixes IPv6 and CIDR notation queries with libidn2. Please check. |
I tested IPv4 and IPv6 adresses and CIDRs and some ASCII and IDN domain names. All of them works for me with HAVE_LIBDN2=1 HAVE_ICONV=1. |
Did you get a chance to review the proposed fix for libidn2? @rockdaboot maybe? |
Wasn't aware of this patch, sorry. Just take a look right now. If ipv6 and CIDRs are the only non-domain input to normalize_domain(), the code is correct. There is just one thing I would like to mention: The code that curl and wget currently use is like
That is "first try pure IDNA 2008, if that fails fall back to IDNA 2008 transitional, which is very close to IDNA 2003". Use the idn2_lookup_ul() function in your case (locale encoded input string). |
Thank you for the hint. Commit 1e6a7b3 additionally tries IDNA 2008 transitional and passes all test cases here. |
This patch has been in use by openSUSE Tumbleweed rolling release users for a month without bug reports. Will you merge it? |
Thank you, I will have a new look at this before the next release. |
@rfc1036 libidn 2.0.3 (latest release) keeps the 'forbidden' chars to be compatible to libidn. This is STD3 ASCII rules are 'off' by default now. So if you check for that version, you maybe don't have to do much. |
I do not like much calling idn2_lookup_ul() twice: do I still need this if I mandate using >= 2.0.3 which disables IDN2_USE_STD3_ASCII_RULES? |
Or even checking for / and : at all? |
With >= 2.0.3 the / and : issue is gone. The double calling of idn2_lookup_ul() is a kind of 'maximum backward compatibility to IDNA 2003'. If you don't want/need that kind of compat, remove the second call. Then you have straight IDNA 2008 with TR46 preprocessing + disabled STD3 rules. |
Then installation instructions / debian metadata should be updated to list
2.0.3 as the minimal required version.
|
The debian package does not build with libidn2. |
Thank you for your help, now I have spent some time learning about IDNA2003, IDNA2008 and TR46. Since the current trend is to adopt IDNA2008 non-transitional I think that the current code is right. |
Fixes #50
Fixes https://bugzilla.opensuse.org/show_bug.cgi?id=1026831
Tested with without IDN, libidn and libidn2. Does the right thing on the wire. Please check.