[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using IDNA_USE_STD3_ASCII_RULES still almost everything is accepted
From: |
Simon Josefsson |
Subject: |
Re: Using IDNA_USE_STD3_ASCII_RULES still almost everything is accepted |
Date: |
Thu, 08 Sep 2016 13:28:14 +0200 |
User-agent: |
Gnus/5.130014 (Ma Gnus v0.14) Emacs/24.4 (gnu/linux) |
Martijn Otto <address@hidden> writes:
> Hello,
>
> I have attached a very simple program which I believe displays a
> serious problem in libidn. Even using IDNA_USE_STD3_ASCII_RULES it
> still happily accepts almost anything.
>
> Maybe I misunderstood and libidn is not designed for this kind of
> thing. If so, could you suggest a better alternative?
Hello.
What is it that you are trying to do? I don't understand what you mean
by ".org" being invalid. All-ASCII things like ".org" will not be
converted to Unicode, this is how IDNA works.
/Simon
> With regards,
> Martijn Otto
>
> #include <idna.h>
> #include <stdio.h>
> #include <stdlib.h>
>
> int main()
> {
> // input, output and result of the operation
> char *output;
> int result;
>
> // try to convert the invalid domain name
> result = idna_to_unicode_8z8z(".org", &output, IDNA_USE_STD3_ASCII_RULES);
>
> // the .org domain is obviously bogus, so we expect an error
> if (result != IDNA_SUCCESS) return 0;
>
> // idna considered the bogus name valid, this is an error
> fprintf(stderr, "libidn considered our bogus domain name valid, and
> converted it to: '%s'\n", output);
> free(output);
>
> // something went wrong
> return 1;
> }
>
> _______________________________________________
> Help-libidn mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/help-libidn
>
signature.asc
Description: PGP signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: Using IDNA_USE_STD3_ASCII_RULES still almost everything is accepted,
Simon Josefsson <=