From b0dfccd2149086cf5d2db44c329664a56b126216 Mon Sep 17 00:00:00 2001
From: Alon Bar-Lev <alon.barlev@gmail.com>
Date: Sun, 6 Jan 2019 20:02:50 +0200
Subject: [PATCH] idn2: do not use deprecated idn2_to_unicode_8z8z in
 idn2-2.1.0

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
---
 lib/str-idna.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

https://gitlab.com/gnutls/gnutls/merge_requests/864

diff --git a/lib/str-idna.c b/lib/str-idna.c
index 3bf2db877..95ca9b769 100644
--- a/lib/str-idna.c
+++ b/lib/str-idna.c
@@ -145,7 +145,7 @@ int gnutls_idna_map(const char *input, unsigned ilen, gnutls_datum_t *out, unsig
 	return ret;
 }
 
-#ifdef HAVE_LIBIDN2
+#if defined(HAVE_LIBIDN2) && IDN2_VERSION_NUMBER < 0x02000000
 int _idn2_punycode_decode(
 	size_t input_length,
 	const char input[],
@@ -153,7 +153,7 @@ int _idn2_punycode_decode(
 	uint32_t output[],
 	unsigned char case_flags[]);
 
-static int _idn2_to_unicode_8z8z(const char *src, char **dst)
+static int idn2_to_unicode_8z8z(const char *src, char **dst, int flags)
 {
 	int rc, run;
 	size_t out_len = 0;
@@ -253,7 +253,7 @@ int gnutls_idna_reverse_map(const char *input, unsigned ilen, gnutls_datum_t *ou
 
 #ifdef HAVE_LIBIDN2
 	/* currently libidn2 just converts single labels, thus a wrapper function */
-	rc = _idn2_to_unicode_8z8z((char*)istr.data, &u8);
+	rc = idn2_to_unicode_8z8z((char*)istr.data, &u8, 0);
 	if (rc != IDN2_OK) {
 		gnutls_assert();
 		_gnutls_debug_log("unable to convert ACE name '%s' to UTF-8 format: %s\n", istr.data, idn2_strerror(rc));
-- 
2.19.2

