char *tmp_str = NULL;
res = idn2_to_ascii_lz(from, &tmp_str, IDN2_NONTRANSITIONAL|IDN2_NFC_INPUT);
- if (res == IDN2_DISALLOWED) {
- res = idn2_to_ascii_lz(from, &tmp_str, IDN2_TRANSITIONAL|IDN2_NFC_INPUT);
- }
-
if (res == IDN2_OK) {
/*
* idn2_to_ascii_lz() normalizes all strings to lowerl case,
return ISC_R_SUCCESS;
}
- fatal("'%s' is not a legal IDN name (%s), use +noidnin", from, idn2_strerror(res));
+ fatal("'%s' is not a legal IDNA2008 name (%s), use +noidnin", from, idn2_strerror(res));
return ISC_R_FAILURE;
}
return ISC_R_SUCCESS;
}
- fatal("'%s' is not a legal IDN name (%s), use +noidnout", from, idn2_strerror(res));
+ fatal("'%s' is not a legal IDNA2008 name (%s), use +noidnout", from, idn2_strerror(res));
return ISC_R_FAILURE;
}
#endif /* HAVE_LIBIDN2 */
# Tests of a valid unicode string but an invalid U-label
#
- # Symbols are not valid IDNA names.
+ # Symbols are not valid IDNA2008 names. Check whether dig rejects them to
+ # ensure no IDNA2003 fallbacks are in place.
#
# +noidnin: "dig" should send unicode octets to the server and display the
# returned qname in the same form.
# The +[no]idnout options should not have any effect on the test.
text="Checking invalid U-label"
- idna_fail "$text" "" "🧦.com"
- idna_test "$text" "+noidnin +noidnout" "🧦.com" "\240\159\167\166.com."
- idna_test "$text" "+noidnin +idnout" "🧦.com" "\240\159\167\166.com."
- idna_fail "$text" "+idnin +noidnout" "🧦.com"
- idna_fail "$text" "+idnin +idnout" "🧦.com"
+ idna_fail "$text" "" "√.com"
+ idna_test "$text" "+noidnin +noidnout" "√.com" "\226\136\154.com."
+ idna_test "$text" "+noidnin +idnout" "√.com" "\226\136\154.com."
+ idna_fail "$text" "+idnin +noidnout" "√.com"
+ idna_fail "$text" "+idnin +idnout" "√.com"
}