summaryrefslogtreecommitdiff
path: root/tests/hostname-check-utf8.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2017-02-04 14:01:36 +0100
committerNikos Mavrogiannopoulos <nmav@redhat.com>2017-02-04 23:48:37 +0100
commit90deae35fed78b5c617489e1dfc9506181b27d4b (patch)
tree88750027aa72838547b34076cb30d1b512f0eb26 /tests/hostname-check-utf8.c
parent35bb9d4bc9f66293cd75cb405d5af3b291054e1f (diff)
downloadgnutls-90deae35fed78b5c617489e1dfc9506181b27d4b.tar.gz
tests: enable all IDNA tests when compiled with libidn2
Keep IDNA2003-only tests on the ifdef HAVE_LIBIDN. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Diffstat (limited to 'tests/hostname-check-utf8.c')
-rw-r--r--tests/hostname-check-utf8.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/hostname-check-utf8.c b/tests/hostname-check-utf8.c
index 4f521c5690..10128bc774 100644
--- a/tests/hostname-check-utf8.c
+++ b/tests/hostname-check-utf8.c
@@ -188,7 +188,7 @@ void doit(void)
if (ret)
fail("%d: Hostname incorrectly matches (%d)\n", __LINE__, ret);
-#ifdef HAVE_LIBIDN
+#if defined(HAVE_LIBIDN) || defined(HAVE_LIBIDN2)
ret = gnutls_x509_crt_check_hostname(x509, "www.teχ.gr");
if (!ret)
fail("%d: Hostname incorrectly does not match (%d)\n", __LINE__, ret);
@@ -197,11 +197,12 @@ void doit(void)
if (!ret)
fail("%d: Hostname incorrectly does not match (%d)\n", __LINE__, ret);
- ret = gnutls_x509_crt_check_hostname(x509, "γΓγ.τόΣτ.gr");
+ ret = gnutls_x509_crt_check_hostname(x509, "τέστ.gr");
if (!ret)
fail("%d: Hostname incorrectly does not match (%d)\n", __LINE__, ret);
- ret = gnutls_x509_crt_check_hostname(x509, "τέστ.gr");
+#if defined(HAVE_LIBIDN) /* There are IDNA2003 */
+ ret = gnutls_x509_crt_check_hostname(x509, "γΓγ.τόΣτ.gr");
if (!ret)
fail("%d: Hostname incorrectly does not match (%d)\n", __LINE__, ret);
@@ -209,6 +210,7 @@ void doit(void)
if (!ret)
fail("%d: Hostname incorrectly does not match (%d)\n", __LINE__, ret);
#endif
+#endif
gnutls_x509_crt_deinit(x509);