diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..53a5fa8 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/libidn-1.34.tar.gz diff --git a/.libidn.metadata b/.libidn.metadata new file mode 100644 index 0000000..e96513f --- /dev/null +++ b/.libidn.metadata @@ -0,0 +1 @@ +8701e3d01df25431802ce483756ecad698156835 SOURCES/libidn-1.34.tar.gz diff --git a/SOURCES/libidn-1.33-Allow-disabling-Emacs-support.patch b/SOURCES/libidn-1.33-Allow-disabling-Emacs-support.patch new file mode 100644 index 0000000..2c7189b --- /dev/null +++ b/SOURCES/libidn-1.33-Allow-disabling-Emacs-support.patch @@ -0,0 +1,61 @@ +From d011a6ae00ce9abd445d6d01ce9131a7b97ef5bc Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Tue, 3 Oct 2017 10:04:18 +0200 +Subject: [PATCH] Allow disabling Emacs support +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This patch adds --disable-emacs configure option to disable installing +LISP scripts for Emacs. + +Signed-off-by: Petr Písař +--- + configure.ac | 9 ++++++++- + src/Makefile.am | 2 ++ + 2 files changed, 10 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 649ddcd..a6dc9ff 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -50,7 +50,6 @@ AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir) + AM_GNU_GETTEXT(external) + AM_GNU_GETTEXT_VERSION(0.19.3) + AM_ICONV +-AM_PATH_LISPDIR + + if test "$am_cv_func_iconv" != "yes"; then + AC_MSG_NOTICE([ +@@ -100,6 +99,14 @@ AM_CONDITIONAL(JAVA, test "$enable_java" != "no") + AC_MSG_CHECKING([if implementation in Java should be built]) + AC_MSG_RESULT($enable_java) + ++# Check for Emacs ++AC_ARG_ENABLE(emacs, AC_HELP_STRING([--disable-emacs], [disable Emacs support]), ++ enable_emacs=$enableval, enable_emacs=yes) ++AM_CONDITIONAL(EMACS, test "$enable_emacs" != "no") ++if test "$enable_emacs" != "no"; then ++ AM_PATH_LISPDIR ++fi ++ + # Check for C# + if test -n "$HAVE_CSHARPCOMP"; then + gt_CSHARPEXEC +diff --git a/src/Makefile.am b/src/Makefile.am +index 6832c20..ec99560 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -20,7 +20,9 @@ AM_CFLAGS = $(WERROR_CFLAGS) $(WARN_CFLAGS) + AM_CPPFLAGS = -I$(top_srcdir)/lib -I../lib -I$(top_srcdir)/gl -I../gl + AM_CPPFLAGS += -DLOCALEDIR=\"$(localedir)\" + ++if EMACS + dist_lisp_DATA = punycode.el idna.el ++endif + + bin_PROGRAMS = idn + idn_SOURCES = idn.c +-- +2.13.6 + diff --git a/SOURCES/libidn-tablesize-revert.patch b/SOURCES/libidn-tablesize-revert.patch new file mode 100644 index 0000000..13bf2b3 --- /dev/null +++ b/SOURCES/libidn-tablesize-revert.patch @@ -0,0 +1,758 @@ +This is a revert of + +commit 518b72c7273278d24cb79ac1485972e42cf98ed4 +Author: Tim Rühsen +Date: Thu Jun 29 12:52:57 2017 +0200 + + Increase speed of stringprep by ~20x + +diff -up libidn-1.34/lib/Makefile.am.tablesize-revert libidn-1.34/lib/Makefile.am +--- libidn-1.34/lib/Makefile.am.tablesize-revert 2017-07-14 20:18:42.000000000 +0200 ++++ libidn-1.34/lib/Makefile.am 2018-05-04 12:45:38.293778700 +0200 +@@ -28,7 +28,7 @@ lib_LTLIBRARIES = libidn.la + + idn_int = idn-int.h + +-BUILT_SOURCES = $(idn_int) gunibreak.h gunicomp.h gunidecomp.h rfc3454.c rfc3454.h tlds.c ++BUILT_SOURCES = $(idn_int) gunibreak.h gunicomp.h gunidecomp.h rfc3454.c tlds.c + DISTCLEANFILES = $(idn_int) + include_HEADERS = stringprep.h idna.h punycode.h idn-free.h pr29.h + if TLD +@@ -46,7 +46,7 @@ idn-int.h: + libidn_la_SOURCES = libidn.map \ + gunibreak.h gunicomp.h gunidecomp.h \ + nfkc.c toutf8.c version.c \ +- stringprep.h stringprep.c rfc3454.c rfc3454.h profiles.c \ ++ stringprep.h stringprep.c rfc3454.c profiles.c \ + punycode.h punycode.c \ + idna.h idna.c \ + pr29.h pr29.c \ +@@ -82,7 +82,7 @@ SPEC = $(top_srcdir)/doc/specifications + #gunibreak.h gunicomp.h gunidecomp.h: gen-unicode-tables.pl $(SPEC)/UnicodeData-3.2.0.txt $(SPEC)/LineBreak-3.2.0.txt $(SPEC)/SpecialCasing-3.2.0.txt $(SPEC)/CaseFolding-3.2.0.txt $(SPEC)/CompositionExclusions-3.2.0.txt + # $(PERL) $(srcdir)/gen-unicode-tables.pl -decomp 3.2 $(SPEC) + +-rfc3454.c rfc3454.h: gen-stringprep-tables.pl ++rfc3454.c: gen-stringprep-tables.pl + $(PERL) $(srcdir)/gen-stringprep-tables.pl $(SPEC)/rfc3454.txt + + tlds.c: gen-tld-tables.pl +diff -up libidn-1.34/lib/gen-stringprep-tables.pl.tablesize-revert libidn-1.34/lib/gen-stringprep-tables.pl +--- libidn-1.34/lib/gen-stringprep-tables.pl.tablesize-revert 2017-06-29 21:11:13.000000000 +0200 ++++ libidn-1.34/lib/gen-stringprep-tables.pl 2018-05-04 12:44:24.696588209 +0200 +@@ -22,13 +22,11 @@ use strict; + + my ($tab) = 59; + my ($intable) = 0; +-my ($entries) = 0; + my ($tablename); + my ($varname); + my ($starheader, $header); + my ($profile) = "rfc3454"; + my ($filename) = "$profile.c"; +-my ($headername) = "$profile.h"; + my ($line, $start, $end, @map); + + open(FH, ">$filename") or die "cannot open $filename for writing"; +@@ -39,10 +37,6 @@ print FH " Instead, edit gen-stringpre + print FH "#include \n"; + print FH "#include \"stringprep.h\"\n"; + +-open(FHH, ">$headername") or die "cannot open $headername for writing"; +-print FHH "/* This file is automatically generated. DO NOT EDIT!\n"; +-print FHH " Instead, edit gen-stringprep-tables.pl and re-run. */\n\n"; +- + while(<>) { + s/^ (.*)/$1/g; # for rfc + $line = $_; +@@ -53,11 +47,9 @@ while(<>) { + if ($intable && m,^----- End Table (.*) -----,) { + die "table error" unless $1 eq $tablename || + ($1 eq "C.1.2" && $tablename eq "C.1.1"); # Typo in draft ++ $intable = 0; + print FH " { 0 },\n"; + print FH "};\n\n"; +- print FHH "#define N_STRINGPREP_${profile}_${varname} ${entries}\n"; +- $intable = 0; +- $entries = 0; + } + + if (m,^[A-Z],) { +@@ -92,28 +84,27 @@ while(<>) { + die "tables tried to map a range" if $end && $map[0]; + + if ($map[3]) { +- printf FH " { 0x%06s, 0x%06s, { 0x%06s,%*s/* %s */\n 0x%06s, 0x%06s, 0x%06s }},\n", +- $start, $start, $map[0], $tab-length($line)-13, " ", $line, ++ printf FH " { 0x%06s, 0, { 0x%06s,%*s/* %s */\n 0x%06s, 0x%06s, 0x%06s }},\n", ++ $start, $map[0], $tab-length($line)-13, " ", $line, + $map[1], $map[2], $map[3]; + } elsif ($map[2]) { +- printf FH " { 0x%06s, 0x%06s, { 0x%06s,%*s/* %s */\n 0x%06s, 0x%06s }},\n", +- $start, $start, $map[0], $tab-length($line)-14, " ", $line, ++ printf FH " { 0x%06s, 0, { 0x%06s,%*s/* %s */\n 0x%06s, 0x%06s }},\n", ++ $start, $map[0], $tab-length($line)-14, " ", $line, + $map[1], $map[2]; + } elsif ($map[1]) { +- printf FH " { 0x%06s, 0x%06s, { 0x%06s,%*s/* %s */\n 0x%06s }},\n", +- $start, $start, $map[0], $tab-length($line)-14, " ", $line, ++ printf FH " { 0x%06s, 0, { 0x%06s,%*s/* %s */\n 0x%06s }},\n", ++ $start, $map[0], $tab-length($line)-14, " ", $line, + $map[1]; + } elsif ($map[0]) { +- printf FH " { 0x%06s, 0x%06s, { 0x%06s }},%*s/* %s */\n", +- $start, $start, $map[0], $tab-length($line)-17, " ", $line; ++ printf FH " { 0x%06s, 0, { 0x%06s }},%*s/* %s */\n", ++ $start, $map[0], $tab-length($line)-17, " ", $line; + } elsif ($end) { + printf FH " { 0x%06s, 0x%06s },%*s/* %s */\n", + $start, $end, $tab-length($line)-11, " ", $line; + } else { +- printf FH " { 0x%06s, 0x%06s },%*s/* %s */\n", +- $start, $start, $tab-length($line)-11, " ", $line; ++ printf FH " { 0x%06s },%*s/* %s */\n", ++ $start, $tab-length($line)-11, " ", $line; + } +- $entries++; + } else { + $intable = 1 if !$intable; + $tablename = $1; +@@ -126,5 +117,4 @@ while(<>) { + } + } + +-close FHH or die "cannot close $headername"; + close FH or die "cannot close $filename"; +diff -up libidn-1.34/lib/profiles.c.tablesize-revert libidn-1.34/lib/profiles.c +--- libidn-1.34/lib/profiles.c.tablesize-revert 2017-06-29 21:11:13.000000000 +0200 ++++ libidn-1.34/lib/profiles.c 2018-05-04 12:44:24.696588209 +0200 +@@ -29,7 +29,6 @@ + + #include + #include "stringprep.h" +-#include "rfc3454.h" + + const Stringprep_profiles stringprep_profiles[] = { + {"Nameprep", stringprep_nameprep}, +@@ -44,219 +43,280 @@ const Stringprep_profiles stringprep_pro + {NULL, NULL} + }; + +-/* number of elements within an array */ +-#define countof(a) (sizeof(a)/sizeof(*(a))) +- +-/* helper for profile definitions */ +-#define TABLE(x) stringprep_rfc3454_##x, N_STRINGPREP_rfc3454_##x +- + const Stringprep_profile stringprep_nameprep[] = { +- {STRINGPREP_MAP_TABLE, 0, TABLE(B_1)}, +- {STRINGPREP_MAP_TABLE, 0, TABLE(B_2)}, +- {STRINGPREP_NFKC, 0, 0, 0}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_1_2)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_2_2)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_3)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_4)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_5)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_6)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_7)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_8)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_9)}, +- {STRINGPREP_BIDI, 0, 0, 0}, +- {STRINGPREP_BIDI_PROHIBIT_TABLE, ~STRINGPREP_NO_BIDI, TABLE(C_8)}, +- {STRINGPREP_BIDI_RAL_TABLE, 0, TABLE(D_1)}, +- {STRINGPREP_BIDI_L_TABLE, 0, TABLE(D_2)}, +- {STRINGPREP_UNASSIGNED_TABLE, ~STRINGPREP_NO_UNASSIGNED, TABLE(A_1)}, ++ {STRINGPREP_MAP_TABLE, 0, stringprep_rfc3454_B_1}, ++ {STRINGPREP_MAP_TABLE, 0, stringprep_rfc3454_B_2}, ++ {STRINGPREP_NFKC, 0, 0}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_1_2}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_2_2}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_3}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_4}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_5}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_6}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_7}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_8}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_9}, ++ {STRINGPREP_BIDI, 0, 0}, ++ {STRINGPREP_BIDI_PROHIBIT_TABLE, ~STRINGPREP_NO_BIDI, ++ stringprep_rfc3454_C_8}, ++ {STRINGPREP_BIDI_RAL_TABLE, 0, stringprep_rfc3454_D_1}, ++ {STRINGPREP_BIDI_L_TABLE, 0, stringprep_rfc3454_D_2}, ++ {STRINGPREP_UNASSIGNED_TABLE, ~STRINGPREP_NO_UNASSIGNED, ++ stringprep_rfc3454_A_1}, + {0} + }; + + const Stringprep_profile stringprep_kerberos5[] = { + /* XXX this is likely to be wrong as the specification is + a rough draft. */ +- {STRINGPREP_MAP_TABLE, 0, TABLE(B_1)}, +- {STRINGPREP_MAP_TABLE, 0, TABLE(B_3)}, +- {STRINGPREP_NFKC, 0, 0, 0}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_1_2)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_2_2)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_3)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_4)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_5)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_6)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_7)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_8)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_9)}, +- {STRINGPREP_BIDI, 0, 0, 0}, +- {STRINGPREP_BIDI_PROHIBIT_TABLE, ~STRINGPREP_NO_BIDI, TABLE(C_8)}, +- {STRINGPREP_BIDI_RAL_TABLE, 0, TABLE(D_1)}, +- {STRINGPREP_BIDI_L_TABLE, 0, TABLE(D_2)}, +- {STRINGPREP_UNASSIGNED_TABLE, ~STRINGPREP_NO_UNASSIGNED, TABLE(A_1)}, ++ {STRINGPREP_MAP_TABLE, 0, stringprep_rfc3454_B_1}, ++ {STRINGPREP_MAP_TABLE, 0, stringprep_rfc3454_B_3}, ++ {STRINGPREP_NFKC, 0, 0}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_1_2}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_2_2}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_3}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_4}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_5}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_6}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_7}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_8}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_9}, ++ {STRINGPREP_BIDI, 0, 0}, ++ {STRINGPREP_BIDI_PROHIBIT_TABLE, ~STRINGPREP_NO_BIDI, ++ stringprep_rfc3454_C_8}, ++ {STRINGPREP_BIDI_RAL_TABLE, 0, stringprep_rfc3454_D_1}, ++ {STRINGPREP_BIDI_L_TABLE, 0, stringprep_rfc3454_D_2}, ++ {STRINGPREP_UNASSIGNED_TABLE, ~STRINGPREP_NO_UNASSIGNED, ++ stringprep_rfc3454_A_1}, + {0} + }; + + const Stringprep_table_element stringprep_xmpp_nodeprep_prohibit[] = { +- {0x000022, 0x000022}, /* #x22 (") */ +- {0x000026, 0x000026}, /* #x26 (&) */ +- {0x000027, 0x000027}, /* #x27 (') */ +- {0x00002F, 0x00002F}, /* #x2F (/) */ +- {0x00003A, 0x00003A}, /* #x3A (:) */ +- {0x00003C, 0x00003C}, /* #x3C (<) */ +- {0x00003E, 0x00003E}, /* #x3E (>) */ +- {0x000040, 0x000040}, /* #x40 (@) */ ++ {0x000022}, /* #x22 (") */ ++ {0x000026}, /* #x26 (&) */ ++ {0x000027}, /* #x27 (') */ ++ {0x00002F}, /* #x2F (/) */ ++ {0x00003A}, /* #x3A (:) */ ++ {0x00003C}, /* #x3C (<) */ ++ {0x00003E}, /* #x3E (>) */ ++ {0x000040}, /* #x40 (@) */ + {0} + }; + + const Stringprep_profile stringprep_xmpp_nodeprep[] = { +- {STRINGPREP_MAP_TABLE, 0, TABLE(B_1)}, +- {STRINGPREP_MAP_TABLE, 0, TABLE(B_2)}, +- {STRINGPREP_NFKC, 0, 0, 0}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_1_1)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_1_2)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_2_1)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_2_2)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_3)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_4)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_5)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_6)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_7)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_8)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_9)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_xmpp_nodeprep_prohibit, +- countof(stringprep_xmpp_nodeprep_prohibit) - 1}, +- {STRINGPREP_BIDI, 0, 0, 0}, +- {STRINGPREP_BIDI_PROHIBIT_TABLE, 0, TABLE(C_8)}, +- {STRINGPREP_BIDI_RAL_TABLE, 0, TABLE(D_1)}, +- {STRINGPREP_BIDI_L_TABLE, 0, TABLE(D_2)}, +- {STRINGPREP_UNASSIGNED_TABLE, ~STRINGPREP_NO_UNASSIGNED, TABLE(A_1)}, ++ {STRINGPREP_MAP_TABLE, 0, stringprep_rfc3454_B_1}, ++ {STRINGPREP_MAP_TABLE, 0, stringprep_rfc3454_B_2}, ++ {STRINGPREP_NFKC, 0, 0}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_1_1}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_1_2}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_2_1}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_2_2}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_3}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_4}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_5}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_6}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_7}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_8}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_9}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_xmpp_nodeprep_prohibit}, ++ {STRINGPREP_BIDI, 0, 0}, ++ {STRINGPREP_BIDI_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_8}, ++ {STRINGPREP_BIDI_RAL_TABLE, 0, stringprep_rfc3454_D_1}, ++ {STRINGPREP_BIDI_L_TABLE, 0, stringprep_rfc3454_D_2}, ++ {STRINGPREP_UNASSIGNED_TABLE, ~STRINGPREP_NO_UNASSIGNED, ++ stringprep_rfc3454_A_1}, + {0} + }; + + const Stringprep_profile stringprep_xmpp_resourceprep[] = { +- {STRINGPREP_MAP_TABLE, 0, TABLE(B_1)}, +- {STRINGPREP_NFKC, 0, 0, 0}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_1_2)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_2_1)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_2_2)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_3)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_4)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_5)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_6)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_7)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_8)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_9)}, +- {STRINGPREP_BIDI, 0, 0, 0}, +- {STRINGPREP_BIDI_PROHIBIT_TABLE, 0, TABLE(C_8)}, +- {STRINGPREP_BIDI_RAL_TABLE, ~STRINGPREP_NO_BIDI, TABLE(D_1)}, +- {STRINGPREP_BIDI_L_TABLE, ~STRINGPREP_NO_BIDI, TABLE(D_2)}, +- {STRINGPREP_UNASSIGNED_TABLE, ~STRINGPREP_NO_UNASSIGNED, TABLE(A_1)}, ++ {STRINGPREP_MAP_TABLE, 0, stringprep_rfc3454_B_1}, ++ {STRINGPREP_NFKC, 0, 0}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_1_2}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_2_1}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_2_2}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_3}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_4}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_5}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_6}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_7}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_8}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_9}, ++ {STRINGPREP_BIDI, 0, 0}, ++ {STRINGPREP_BIDI_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_8}, ++ {STRINGPREP_BIDI_RAL_TABLE, ~STRINGPREP_NO_BIDI, stringprep_rfc3454_D_1}, ++ {STRINGPREP_BIDI_L_TABLE, ~STRINGPREP_NO_BIDI, stringprep_rfc3454_D_2}, ++ {STRINGPREP_UNASSIGNED_TABLE, ~STRINGPREP_NO_UNASSIGNED, ++ stringprep_rfc3454_A_1}, + {0} + }; + + const Stringprep_profile stringprep_plain[] = { +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_2_1)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_2_2)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_3)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_4)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_5)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_6)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_8)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_9)}, +- {STRINGPREP_BIDI, 0, 0, 0}, +- {STRINGPREP_BIDI_PROHIBIT_TABLE, 0, TABLE(C_8)}, +- {STRINGPREP_BIDI_RAL_TABLE, ~STRINGPREP_NO_BIDI, TABLE(D_1)}, +- {STRINGPREP_BIDI_L_TABLE, ~STRINGPREP_NO_BIDI, TABLE(D_2)}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_2_1}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_2_2}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_3}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_4}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_5}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_6}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_8}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_9}, ++ {STRINGPREP_BIDI, 0, 0}, ++ {STRINGPREP_BIDI_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_8}, ++ {STRINGPREP_BIDI_RAL_TABLE, ~STRINGPREP_NO_BIDI, stringprep_rfc3454_D_1}, ++ {STRINGPREP_BIDI_L_TABLE, ~STRINGPREP_NO_BIDI, stringprep_rfc3454_D_2}, + {0} + }; + + const Stringprep_profile stringprep_trace[] = { +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_2_1)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_2_2)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_3)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_4)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_5)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_6)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_8)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_9)}, +- {STRINGPREP_BIDI, 0, 0, 0}, +- {STRINGPREP_BIDI_PROHIBIT_TABLE, 0, TABLE(C_8)}, +- {STRINGPREP_BIDI_RAL_TABLE, ~STRINGPREP_NO_BIDI, TABLE(D_1)}, +- {STRINGPREP_BIDI_L_TABLE, ~STRINGPREP_NO_BIDI, TABLE(D_2)}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_2_1}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_2_2}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_3}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_4}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_5}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_6}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_8}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_9}, ++ {STRINGPREP_BIDI, 0, 0}, ++ {STRINGPREP_BIDI_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_8}, ++ {STRINGPREP_BIDI_RAL_TABLE, ~STRINGPREP_NO_BIDI, stringprep_rfc3454_D_1}, ++ {STRINGPREP_BIDI_L_TABLE, ~STRINGPREP_NO_BIDI, stringprep_rfc3454_D_2}, + {0} + }; + + const Stringprep_table_element stringprep_iscsi_prohibit[] = { +- {0x0000, 0x002C}, /* [ASCII CONTROL CHARACTERS and SPACE through ,] */ +- {0x002F, 0x002F}, /* [ASCII /] */ +- {0x003B, 0x0040}, /* [ASCII ; through @] */ +- {0x005B, 0x0060}, /* [ASCII [ through `] */ +- {0x007B, 0x007F}, /* [ASCII { through DEL] */ +- {0x3002, 0x3002}, /* ideographic full stop */ ++ /* NB, since start == 0, we must have that end != 0 for the ++ end-of-table logic to work. */ ++ {0x0000, 1}, /* [ASCII CONTROL CHARACTERS and SPACE through ,] */ ++ {0x0001}, ++ {0x0002}, ++ {0x0003}, ++ {0x0004}, ++ {0x0005}, ++ {0x0006}, ++ {0x0007}, ++ {0x0008}, ++ {0x0009}, ++ {0x000A}, ++ {0x000B}, ++ {0x000C}, ++ {0x000D}, ++ {0x000E}, ++ {0x000F}, ++ {0x0010}, ++ {0x0011}, ++ {0x0012}, ++ {0x0013}, ++ {0x0014}, ++ {0x0015}, ++ {0x0016}, ++ {0x0017}, ++ {0x0018}, ++ {0x0019}, ++ {0x001A}, ++ {0x001B}, ++ {0x001C}, ++ {0x001D}, ++ {0x001E}, ++ {0x001F}, ++ {0x0020}, ++ {0x0021}, ++ {0x0022}, ++ {0x0023}, ++ {0x0024}, ++ {0x0025}, ++ {0x0026}, ++ {0x0027}, ++ {0x0028}, ++ {0x0029}, ++ {0x002A}, ++ {0x002B}, ++ {0x002C}, ++ {0x002F}, /* [ASCII /] */ ++ {0x003B}, /* [ASCII ; through @] */ ++ {0x003C}, ++ {0x003D}, ++ {0x003E}, ++ {0x003F}, ++ {0x0040}, ++ {0x005B}, /* [ASCII [ through `] */ ++ {0x005C}, ++ {0x005D}, ++ {0x005E}, ++ {0x005F}, ++ {0x0060}, ++ {0x007B}, /* [ASCII { through DEL] */ ++ {0x007C}, ++ {0x007D}, ++ {0x007E}, ++ {0x007F}, ++ {0x3002}, /* ideographic full stop */ + {0} + }; + + const Stringprep_profile stringprep_iscsi[] = { +- {STRINGPREP_MAP_TABLE, 0, TABLE(B_1)}, +- {STRINGPREP_MAP_TABLE, 0, TABLE(B_2)}, +- {STRINGPREP_NFKC, 0, 0, 0}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_1_1)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_1_2)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_2_1)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_2_2)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_3)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_4)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_5)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_6)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_7)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_8)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_9)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_iscsi_prohibit, countof(stringprep_iscsi_prohibit) - 1}, +- {STRINGPREP_BIDI, 0, 0, 0}, +- {STRINGPREP_BIDI_PROHIBIT_TABLE, 0, TABLE(C_8)}, +- {STRINGPREP_BIDI_RAL_TABLE, ~STRINGPREP_NO_BIDI, TABLE(D_1)}, +- {STRINGPREP_BIDI_L_TABLE, ~STRINGPREP_NO_BIDI, TABLE(D_2)}, +- {STRINGPREP_UNASSIGNED_TABLE, ~STRINGPREP_NO_UNASSIGNED, TABLE(A_1)}, ++ {STRINGPREP_MAP_TABLE, 0, stringprep_rfc3454_B_1}, ++ {STRINGPREP_MAP_TABLE, 0, stringprep_rfc3454_B_2}, ++ {STRINGPREP_NFKC, 0, 0}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_1_1}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_1_2}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_2_1}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_2_2}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_3}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_4}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_5}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_6}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_7}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_8}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_9}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_iscsi_prohibit}, ++ {STRINGPREP_BIDI, 0, 0}, ++ {STRINGPREP_BIDI_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_8}, ++ {STRINGPREP_BIDI_RAL_TABLE, ~STRINGPREP_NO_BIDI, stringprep_rfc3454_D_1}, ++ {STRINGPREP_BIDI_L_TABLE, ~STRINGPREP_NO_BIDI, stringprep_rfc3454_D_2}, ++ {STRINGPREP_UNASSIGNED_TABLE, ~STRINGPREP_NO_UNASSIGNED, ++ stringprep_rfc3454_A_1}, + {0} + }; + + const Stringprep_table_element stringprep_saslprep_space_map[] = { +- {0x00A0, 0x00A0, {0x0020}}, /* 00A0; NO-BREAK SPACE */ +- {0x1680, 0x1680, {0x0020}}, /* 1680; OGHAM SPACE MARK */ +- {0x2000, 0x200B, {0x0020}}, /* 2000; EN QUAD */ +- /* 2001; EM QUAD */ +- /* 2002; EN SPACE */ +- /* 2003; EM SPACE */ +- /* 2004; THREE-PER-EM SPACE */ +- /* 2005; FOUR-PER-EM SPACE */ +- /* 2006; SIX-PER-EM SPACE */ +- /* 2007; FIGURE SPACE */ +- /* 2008; PUNCTUATION SPACE */ +- /* 2009; THIN SPACE */ +- /* 200A; HAIR SPACE */ +- /* 200B; ZERO WIDTH SPACE */ +- {0x202F, 0x202F, {0x0020}}, /* 202F; NARROW NO-BREAK SPACE */ +- {0x205F, 0x205F, {0x0020}}, /* 205F; MEDIUM MATHEMATICAL SPACE */ +- {0x3000, 0x3000, {0x0020}}, /* 3000; IDEOGRAPHIC SPACE */ ++ {0x0000A0, 0, {0x0020}}, /* 00A0; NO-BREAK SPACE */ ++ {0x001680, 0, {0x0020}}, /* 1680; OGHAM SPACE MARK */ ++ {0x002000, 0, {0x0020}}, /* 2000; EN QUAD */ ++ {0x002001, 0, {0x0020}}, /* 2001; EM QUAD */ ++ {0x002002, 0, {0x0020}}, /* 2002; EN SPACE */ ++ {0x002003, 0, {0x0020}}, /* 2003; EM SPACE */ ++ {0x002004, 0, {0x0020}}, /* 2004; THREE-PER-EM SPACE */ ++ {0x002005, 0, {0x0020}}, /* 2005; FOUR-PER-EM SPACE */ ++ {0x002006, 0, {0x0020}}, /* 2006; SIX-PER-EM SPACE */ ++ {0x002007, 0, {0x0020}}, /* 2007; FIGURE SPACE */ ++ {0x002008, 0, {0x0020}}, /* 2008; PUNCTUATION SPACE */ ++ {0x002009, 0, {0x0020}}, /* 2009; THIN SPACE */ ++ {0x00200A, 0, {0x0020}}, /* 200A; HAIR SPACE */ ++ {0x00200B, 0, {0x0020}}, /* 200B; ZERO WIDTH SPACE */ ++ {0x00202F, 0, {0x0020}}, /* 202F; NARROW NO-BREAK SPACE */ ++ {0x00205F, 0, {0x0020}}, /* 205F; MEDIUM MATHEMATICAL SPACE */ ++ {0x003000, 0, {0x0020}}, /* 3000; IDEOGRAPHIC SPACE */ + {0} + }; + + const Stringprep_profile stringprep_saslprep[] = { +- {STRINGPREP_MAP_TABLE, 0, stringprep_saslprep_space_map, countof(stringprep_saslprep_space_map) - 1}, +- {STRINGPREP_MAP_TABLE, 0, TABLE(B_1)}, +- {STRINGPREP_NFKC, 0, 0, 0}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_1_2)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_2_1)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_2_2)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_3)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_4)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_5)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_6)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_7)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_8)}, +- {STRINGPREP_PROHIBIT_TABLE, 0, TABLE(C_9)}, +- {STRINGPREP_BIDI, 0, 0, 0}, +- {STRINGPREP_BIDI_PROHIBIT_TABLE, 0, TABLE(C_8)}, +- {STRINGPREP_BIDI_RAL_TABLE, ~STRINGPREP_NO_BIDI, TABLE(D_1)}, +- {STRINGPREP_BIDI_L_TABLE, ~STRINGPREP_NO_BIDI, TABLE(D_2)}, +- {STRINGPREP_UNASSIGNED_TABLE, ~STRINGPREP_NO_UNASSIGNED, TABLE(A_1)}, ++ {STRINGPREP_MAP_TABLE, 0, stringprep_saslprep_space_map}, ++ {STRINGPREP_MAP_TABLE, 0, stringprep_rfc3454_B_1}, ++ {STRINGPREP_NFKC, 0, 0}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_1_2}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_2_1}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_2_2}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_3}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_4}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_5}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_6}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_7}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_8}, ++ {STRINGPREP_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_9}, ++ {STRINGPREP_BIDI, 0, 0}, ++ {STRINGPREP_BIDI_PROHIBIT_TABLE, 0, stringprep_rfc3454_C_8}, ++ {STRINGPREP_BIDI_RAL_TABLE, ~STRINGPREP_NO_BIDI, stringprep_rfc3454_D_1}, ++ {STRINGPREP_BIDI_L_TABLE, ~STRINGPREP_NO_BIDI, stringprep_rfc3454_D_2}, ++ {STRINGPREP_UNASSIGNED_TABLE, ~STRINGPREP_NO_UNASSIGNED, ++ stringprep_rfc3454_A_1}, + {0} + }; +diff -up libidn-1.34/lib/stringprep.c.tablesize-revert libidn-1.34/lib/stringprep.c +--- libidn-1.34/lib/stringprep.c.tablesize-revert 2017-07-12 21:40:56.000000000 +0200 ++++ libidn-1.34/lib/stringprep.c 2018-05-04 12:44:24.697588211 +0200 +@@ -36,20 +36,9 @@ + + #include "stringprep.h" + +-static int +-_compare_table_element (const uint32_t * c, const Stringprep_table_element * e) +-{ +- if (*c < e->start) +- return -1; +- if (*c > e->end) +- return 1; +- return 0; +-} +- + static ssize_t + stringprep_find_character_in_table (uint32_t ucs4, +- const Stringprep_table_element * table, +- size_t table_size) ++ const Stringprep_table_element * table) + { + /* This is where typical uses of Libidn spends very close to all CPU + time and causes most cache misses. One could easily do a binary +@@ -57,17 +46,8 @@ stringprep_find_character_in_table (uint + slowness is at all relevant in typical applications. (I don't + dispute optimization may improve matters significantly, I'm + mostly interested in having someone give real-world benchmark on +- the impact of libidn.) +- * +- * Answer (Tim Rühsen rockdaboot@gmx.de): +- * Testing the fuzz corpora just once via make check takes ~54 billion CPU cycles. +- * That is almost 20s on my Intel i3 3.1GHz !!! +- * That even makes fuzzing almost useless, eating up CPU cycles for nothing. +- * +- * The bsearch() approach takes ~3 billion CPU cycles. +- * Almost a factor of 20 faster (but still pretty slow). +- * There are still ~2 million calls to bsearch() which make ~30% of CPU time used. +- * Most time is spent in _g_utf8_normalize_wc(). ++ the impact of libidn.) */ ++ + + ssize_t i; + +@@ -75,27 +55,21 @@ stringprep_find_character_in_table (uint + if (ucs4 >= table[i].start && + ucs4 <= (table[i].end ? table[i].end : table[i].start)) + return i; +- */ +- +- const Stringprep_table_element * p = +- bsearch (&ucs4, table, table_size, sizeof(Stringprep_table_element), +- (int (*)(const void *, const void *)) _compare_table_element); + +- return p ? (p - table) : -1; ++ return -1; + } + + static ssize_t + stringprep_find_string_in_table (uint32_t * ucs4, + size_t ucs4len, + size_t * tablepos, +- const Stringprep_table_element * table, +- size_t table_size) ++ const Stringprep_table_element * table) + { + size_t j; + ssize_t pos; + + for (j = 0; j < ucs4len; j++) +- if ((pos = stringprep_find_character_in_table (ucs4[j], table, table_size)) != -1) ++ if ((pos = stringprep_find_character_in_table (ucs4[j], table)) != -1) + { + if (tablepos) + *tablepos = pos; +@@ -109,8 +83,7 @@ static int + stringprep_apply_table_to_string (uint32_t * ucs4, + size_t * ucs4len, + size_t maxucs4len, +- const Stringprep_table_element * table, +- size_t table_size) ++ const Stringprep_table_element * table) + { + ssize_t pos; + size_t i, maplen; +@@ -118,7 +91,7 @@ stringprep_apply_table_to_string (uint32 + size_t srclen = *ucs4len; /* length of unprocessed data */ + + while ((pos = stringprep_find_string_in_table (src, srclen, +- &i, table, table_size)) != -1) ++ &i, table)) != -1) + { + for (maplen = STRINGPREP_MAX_MAP_CHARS; + maplen > 0 && table[i].map[maplen - 1] == 0; maplen--) +@@ -220,7 +193,7 @@ stringprep_4i (uint32_t * ucs4, size_t * + + case STRINGPREP_PROHIBIT_TABLE: + k = stringprep_find_string_in_table (ucs4, ucs4len, +- NULL, profile[i].table, profile[i].table_size); ++ NULL, profile[i].table); + if (k != -1) + return STRINGPREP_CONTAINS_PROHIBITED; + break; +@@ -231,7 +204,7 @@ stringprep_4i (uint32_t * ucs4, size_t * + if (flags & STRINGPREP_NO_UNASSIGNED) + { + k = stringprep_find_string_in_table +- (ucs4, ucs4len, NULL, profile[i].table, profile[i].table_size); ++ (ucs4, ucs4len, NULL, profile[i].table); + if (k != -1) + return STRINGPREP_CONTAINS_UNASSIGNED; + } +@@ -241,7 +214,7 @@ stringprep_4i (uint32_t * ucs4, size_t * + if (UNAPPLICAPLEFLAGS (flags, profile[i].flags)) + break; + rc = stringprep_apply_table_to_string +- (ucs4, &ucs4len, maxucs4len, profile[i].table, profile[i].table_size); ++ (ucs4, &ucs4len, maxucs4len, profile[i].table); + if (rc != STRINGPREP_OK) + return rc; + break; +@@ -265,7 +238,7 @@ stringprep_4i (uint32_t * ucs4, size_t * + done_prohibited = 1; + k = stringprep_find_string_in_table (ucs4, ucs4len, + NULL, +- profile[j].table, profile[j].table_size); ++ profile[j].table); + if (k != -1) + return STRINGPREP_BIDI_CONTAINS_PROHIBITED; + } +@@ -273,14 +246,14 @@ stringprep_4i (uint32_t * ucs4, size_t * + { + done_ral = 1; + if (stringprep_find_string_in_table +- (ucs4, ucs4len, NULL, profile[j].table, profile[j].table_size) != -1) ++ (ucs4, ucs4len, NULL, profile[j].table) != -1) + contains_ral = j; + } + else if (profile[j].operation == STRINGPREP_BIDI_L_TABLE) + { + done_l = 1; + if (stringprep_find_string_in_table +- (ucs4, ucs4len, NULL, profile[j].table, profile[j].table_size) != -1) ++ (ucs4, ucs4len, NULL, profile[j].table) != -1) + contains_l = j; + } + +@@ -293,9 +266,9 @@ stringprep_4i (uint32_t * ucs4, size_t * + if (contains_ral != SIZE_MAX) + { + if (!(stringprep_find_character_in_table +- (ucs4[0], profile[contains_ral].table, profile[contains_ral].table_size) != -1 && ++ (ucs4[0], profile[contains_ral].table) != -1 && + stringprep_find_character_in_table +- (ucs4[ucs4len - 1], profile[contains_ral].table, profile[contains_ral].table_size) != -1)) ++ (ucs4[ucs4len - 1], profile[contains_ral].table) != -1)) + return STRINGPREP_BIDI_LEADTRAIL_NOT_RAL; + } + } +diff -up libidn-1.34/lib/stringprep.h.tablesize-revert libidn-1.34/lib/stringprep.h +--- libidn-1.34/lib/stringprep.h.tablesize-revert 2017-06-29 21:11:13.000000000 +0200 ++++ libidn-1.34/lib/stringprep.h 2018-05-04 12:44:24.697588211 +0200 +@@ -110,7 +110,6 @@ extern "C" + Stringprep_profile_steps operation; + Stringprep_profile_flags flags; + const Stringprep_table_element *table; +- size_t table_size; + }; + typedef struct Stringprep_table Stringprep_profile; + diff --git a/SPECS/libidn.spec b/SPECS/libidn.spec new file mode 100644 index 0000000..6610f5a --- /dev/null +++ b/SPECS/libidn.spec @@ -0,0 +1,526 @@ +# Build with Emacs support +%bcond_without libidn_enables_emacs +# Build with Java support +%bcond_with libidn_enables_java + +Summary: Internationalized Domain Name support library +Name: libidn +Version: 1.34 +Release: 5%{?dist} +URL: http://www.gnu.org/software/libidn/ +License: LGPLv2+ and GPLv3+ and GFDL +Source0: http://ftp.gnu.org/gnu/libidn/libidn-%{version}.tar.gz +# Allow disabling Emacs support +Patch0: libidn-1.33-Allow-disabling-Emacs-support.patch +# Fix ABI compatibility with libidn-1.33 and earlier +Patch1: libidn-tablesize-revert.patch + +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: libtool +BuildRequires: texinfo +BuildRequires: gcc +BuildRequires: gettext gettext-devel +%if %{with libidn_enables_emacs} +BuildRequires: emacs +%endif +BuildRequires: pkgconfig +BuildRequires: help2man +Requires(post): /sbin/install-info +Requires(preun): /sbin/install-info +# gnulib is a copylib, bundling is allowed +Provides: bundled(gnulib) +%if %{with libidn_enables_emacs} +# emacs-libidn merged with main package in 1.30-4 +Obsoletes: emacs-libidn < 1.30-4 +Provides: emacs-libidn < 1.30-4 +Requires: emacs-filesystem >= %{_emacs_version} +%endif + +%description +GNU Libidn is an implementation of the Stringprep, Punycode and +IDNA specifications defined by the IETF Internationalized Domain +Names (IDN) working group, used for internationalized domain +names. + +%package devel +Summary: Development files for the libidn library +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: pkgconfig + +%description devel +This package includes header files and libraries necessary for +developing programs which use the GNU libidn library. + +%if %{with libidn_enables_java} +%package java +Summary: Java port of the GNU Libidn library +BuildRequires: java-devel +BuildRequires: javapackages-local +BuildRequires: mvn(com.google.code.findbugs:annotations) +BuildRequires: mvn(com.google.guava:guava) +BuildRequires: mvn(junit:junit) +BuildArch: noarch + +%description java +GNU Libidn is a fully documented implementation of the Stringprep, +Punycode and IDNA specifications. Libidn's purpose is to encode +and decode internationalized domain names. + +This package contains the native Java port of the library. + +%package javadoc +Summary: Javadoc for %{name}-java +BuildArch: noarch + +%description javadoc +This package contains javadoc for %{name}-java. +%endif + +%prep +%setup -q +%patch0 -p1 +%patch1 -p1 -b .tablesize-revert +autoreconf -vif +# Prevent from regenerating sources by gengetopt because it's broken. +touch src/idn_cmd.c src/idn_cmd.h + +# Cleanup +find . -name '*.jar' -print -delete +find . -name '*.class' -print -delete + +%if %{with libidn_enables_java} +# Not available test dep +%pom_remove_dep com.google.caliper:caliper java/pom.xml.in +%endif + +# Name directory sections consistently in the info file, #209491 +sed -i '/^INFO-DIR-SECTION/{s/GNU Libraries/Libraries/;s/GNU utilities/Utilities/;}' doc/libidn.info + +iconv -f ISO-8859-1 -t UTF-8 doc/libidn.info > iconv.tmp +mv iconv.tmp doc/libidn.info + +%build +%configure --disable-csharp --disable-static \ +%if %{with libidn_enables_emacs} + --enable-emacs \ + --with-lispdir=%{_emacs_sitelispdir}/%{name} \ +%else + --disable-emacs \ +%endif +%if %{with libidn_enables_java} + --enable-java +%else + --disable-java +%endif + +# remove RPATH hardcoding +sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool +sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool + +# without RPATH this needs to be set for idn executed by help2man +export LD_LIBRARY_PATH=$(pwd)/lib/.libs + +make %{?_smp_mflags} V=1 + +%check +# without RPATH this needs to be set to test the compiled library +export LD_LIBRARY_PATH=$(pwd)/lib/.libs +make %{?_smp_mflags} -C tests check VALGRIND=env + +%install +make install DESTDIR=$RPM_BUILD_ROOT pkgconfigdir=%{_libdir}/pkgconfig \ +%if %{with libidn_enables_java} + libidn_jardir=%{_javadir} \ +%endif + ; + +# provide more examples +make %{?_smp_mflags} -C examples distclean + +# clean up docs +find doc -name "Makefile*" | xargs rm +rm -rf $RPM_BUILD_ROOT%{_datadir}/info/dir + +# Make multilib safe: +sed -i '/gnu compiler/d' $RPM_BUILD_ROOT%{_includedir}/idn-int.h + +rm -f $RPM_BUILD_ROOT%{_libdir}/*.la \ + $RPM_BUILD_ROOT%{_datadir}/info/*.png + +%if %{with libidn_enables_emacs} +%{_emacs_bytecompile} $RPM_BUILD_ROOT%{_emacs_sitelispdir}/%{name}/*.el +%endif + +%if %{with libidn_enables_java} +# regenerate java documentation +rm -rf doc/java/* +%javadoc -source 1.6 -d doc/java $(find java/src/main/java -name "*.java") +# generate maven depmap +rm -rf $RPM_BUILD_ROOT%{_javadir}/libidn*.jar +%mvn_artifact java/pom.xml java/libidn-%{version}.jar +%mvn_file org.gnu.inet:libidn libidn +%mvn_install -J doc/java +%endif + +%find_lang %{name} + +%post +/sbin/install-info %{_infodir}/%{name}.info.gz %{_infodir}/dir || : +%?ldconfig + +%preun +if [ $1 = 0 ]; then + /sbin/install-info --delete %{_infodir}/%{name}.info.gz %{_infodir}/dir || : +fi + +%ldconfig_postun + +%files -f %{name}.lang +%{!?_licensedir:%global license %%doc} +%license COPYING* +%doc AUTHORS NEWS FAQ README THANKS +%{_bindir}/idn +%{_mandir}/man1/idn.1* +%{_libdir}/libidn.so.11* +%{_infodir}/%{name}.info.gz +%if %{with libidn_enables_emacs} +%{_emacs_sitelispdir}/%{name} +%endif + +%files devel +%doc doc/libidn.html examples +%{_libdir}/libidn.so +%{_includedir}/*.h +%{_libdir}/pkgconfig/*.pc +%{_mandir}/man3/* + +%if %{with libidn_enables_java} +%files java -f .mfiles +%license COPYING* java/LICENSE-2.0.txt + +%files javadoc -f .mfiles-javadoc +%license COPYING* java/LICENSE-2.0.txt +%endif + +%changelog +* Wed May 30 2018 Mikolaj Izdebski - 1.34-5 +- disable Java support (#1584067) + +* Tue May 22 2018 Miroslav Lichvar - 1.34-4 +- fix building with no libidn in build root (#1580762) + +* Mon May 14 2018 Miroslav Lichvar - 1.34-3 +- ignore install-info errors in post scriptlet (#1573966) + +* Fri May 04 2018 Miroslav Lichvar - 1.34-2 +- fix ABI compatibility with libidn-1.33 and earlier (#1566414 #1573961) +- add texinfo to build requirements + +* Wed Apr 04 2018 Miroslav Lichvar - 1.34-1 +- update to 1.34 (CVE-2017-14062) +- include soname in file list +- use macros for ldconfig +- add gcc to build requirements + +* Tue Feb 20 2018 Peter Robinson 1.33-6 +- Add missing libtool dep, minor cleanups + +* Wed Feb 07 2018 Fedora Release Engineering - 1.33-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Thu Aug 03 2017 Fedora Release Engineering - 1.33-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 1.33-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Fri Feb 10 2017 Fedora Release Engineering - 1.33-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Thu Jul 21 2016 Miroslav Lichvar - 1.33-1 +- update to 1.33 (CVE-2015-8948 CVE-2016-6261 CVE-2016-6262 CVE-2016-6263) + +* Sat Jun 18 2016 gil cattaneo 1.32-3 +- rebuilt for re-generate maven depmap + +* Thu Feb 04 2016 Fedora Release Engineering - 1.32-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Mon Aug 03 2015 Miroslav Lichvar - 1.32-1 +- update to 1.32 + +* Mon Jul 13 2015 Miroslav Lichvar - 1.31-1 +- update to 1.31 (CVE-2015-2059) + +* Thu Jun 25 2015 Miroslav Lichvar - 1.30-4 +- merge emacs-libidn with main package (#1234563) + +* Wed Jun 17 2015 Fedora Release Engineering - 1.30-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Tue Mar 31 2015 gil cattaneo 1.30-2 +- build java libidn library + +* Mon Mar 02 2015 Miroslav Lichvar - 1.30-1 +- update to 1.30 + +* Sat Feb 21 2015 Till Maas - 1.29-3 +- Rebuilt for Fedora 23 Change + https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code + +* Sun Aug 17 2014 Fedora Release Engineering - 1.29-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Wed Aug 13 2014 Miroslav Lichvar - 1.29-1 +- update to 1.29 + +* Fri Jul 18 2014 Tom Callaway - 1.28-4 +- fix license handling + +* Sat Jun 07 2014 Fedora Release Engineering - 1.28-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Sat Aug 03 2013 Fedora Release Engineering - 1.28-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Thu Jul 18 2013 Miroslav Lichvar - 1.28-1 +- update to 1.28 +- remove RPATH hardcoding +- move library to /usr + +* Fri Jun 07 2013 Miroslav Lichvar - 1.27-1 +- update to 1.27 +- make devel dependency arch-specific +- remove obsolete macros + +* Thu Feb 14 2013 Fedora Release Engineering - 1.26-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Mon Dec 17 2012 Miroslav Lichvar - 1.26-1 +- update to 1.26 + +* Thu Jul 19 2012 Fedora Release Engineering - 1.25-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Tue May 29 2012 Joe Orton - 1.25-2 +- update to 1.25 + +* Tue May 15 2012 Miroslav Lichvar - 1.24-2 +- provide bundled(gnulib) (#821768) + +* Sun Jan 15 2012 Robert Scheck - 1.24-1 +- Update to 1.24 (#781379) + +* Fri Jan 13 2012 Fedora Release Engineering - 1.23-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Fri Nov 25 2011 Miroslav Lichvar - 1.23-1 +- update to 1.23 + +* Tue May 31 2011 Ville Skyttä - 1.22-3 +- Split emacs-libidn subpackage to avoid *.elc arch conflicts (#709136). + +* Sun May 29 2011 Ville Skyttä - 1.22-2 +- Byte compile Emacs lisp files, require emacs-filesystem for dir ownership. + +* Thu May 05 2011 Miroslav Lichvar - 1.22-1 +- update to 1.22 + +* Tue Apr 26 2011 Miroslav Lichvar - 1.21-1 +- update to 1.21 + +* Thu Mar 03 2011 Miroslav Lichvar - 1.20-1 +- update to 1.20 +- fix requires + +* Wed Feb 09 2011 Fedora Release Engineering - 1.19-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Mon May 24 2010 Joe Orton - 1.19-1 +- update to 1.19 (#595086) + +* Tue Mar 30 2010 Joe Orton - 1.18-2 +- add GFDL to License + +* Mon Mar 29 2010 Joe Orton - 1.18-1 +- update to 1.18 +- fix Source0 to reference gnu.org repository + +* Fri Jan 29 2010 Joe Orton - 1.16-1 +- update to 1.16 + +* Fri Jul 24 2009 Fedora Release Engineering - 1.9-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Tue Mar 10 2009 Joe Orton 1.9-4 +- update to 1.9 (#302111) +- update License to reflect GPLv3+ binaries, LGPLv2+ library + +* Wed Feb 25 2009 Fedora Release Engineering - 0.6.14-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Mon Dec 29 2008 Kedar Sovani 0.6.14-9 +- fix the problem with #include_next + +* Tue Jun 10 2008 Joe Orton 0.6.14-8 +- fix build with latest autoconf (#449440) + +* Mon Mar 31 2008 Joe Orton 0.6.14-7 +- fix libidn.pc for correct libdir (#439549) + +* Fri Mar 7 2008 Joe Orton 0.6.14-6 +- drop libidn.a +- move shared library to /lib{,64} (#283651) + +* Thu Feb 7 2008 Joe Orton 0.6.14-5 +- fix DT_RPATH in /usr/bin/idn +- convert libidn.iconv to UTF-8 (Jon Ciesla, #226029) +- fix BuildRoot tag (Jon Ciesla, #226029) + +* Tue Aug 21 2007 Joe Orton 0.6.14-4 +- drop contrib directory from docs + +* Mon Aug 20 2007 Joe Orton 0.6.14-3 +- fix License + +* Mon Jun 18 2007 Joe Orton 0.6.14-2 +- update to 0.6.14 + +* Mon Jan 29 2007 Joe Orton 0.6.9-2 +- update to 0.6.9 +- make install-info use failsafe (Ville Skyttä, #223707) + +* Wed Nov 15 2006 Joe Orton 0.6.8-4 +- use non-GNU section in info directory (#209491) + +* Wed Nov 15 2006 Joe Orton 0.6.8-3 +- update to 0.6.8 + +* Wed Jul 12 2006 Jesse Keating - 0.6.5-1.1 +- rebuild + +* Fri Jul 7 2006 Joe Orton 0.6.5-1 +- update to 0.6.5 + +* Fri Jul 7 2006 Joe Orton 0.6.4-1 +- update to 0.6.4 + +* Thu Jun 1 2006 Joe Orton 0.6.3-1 +- update to 0.6.3 +- fix some places where gettext() was not getting used + +* Thu Jun 1 2006 Joe Orton 0.6.2-4 +- remove the libidn.la (#172639) + +* Thu May 11 2006 Joe Orton 0.6.2-3 +- make idn-int.h multilib-safe + +* Wed Feb 22 2006 Joe Orton 0.6.2-2 +- disable C# support (#182393) + +* Fri Feb 10 2006 Jesse Keating - 0.6.2-1.1 +- bump again for double-long bug on ppc(64) + +* Mon Feb 06 2006 Florian La Roche +- 0.6.1 + +* Fri Dec 09 2005 Jesse Keating +- rebuilt + +* Sun Dec 4 2005 Joe Orton 0.6.0-1 +- update to 0.6.0 + +* Mon Oct 24 2005 Joe Orton 0.5.20-1 +- update to 0.5.20 + +* Mon Sep 19 2005 Joe Orton 0.5.19-1 +- update to 0.5.19 + +* Fri May 27 2005 Joe Orton 0.5.17-1 +- update to 0.5.17 + +* Fri May 6 2005 Joe Orton 0.5.16-1 +- update to 0.5.16 + +* Thu May 5 2005 Joe Orton 0.5.15-2 +- constify data tables in pr29.c +- clean up pre/post/postun requires + +* Sun Mar 20 2005 Joe Orton 0.5.15-1 +- update to 0.5.15 + +* Fri Mar 4 2005 Joe Orton 0.5.13-2 +- rebuild + +* Mon Jan 31 2005 Joe Orton 0.5.13-1 +- update to 0.5.13 + +* Sun Dec 5 2004 Joe Orton 0.5.12-1 +- update to 0.5.12 + +* Mon Nov 29 2004 Joe Orton 0.5.11-1 +- update to 0.5.11 (#141094) + +* Tue Nov 9 2004 Joe Orton 0.5.10-1 +- update to 0.5.10 +- buildroot cleanup fix (Robert Scheck) + +* Mon Nov 8 2004 Joe Orton 0.5.9-1 +- update to 0.5.9 (#138296) + +* Thu Oct 7 2004 Joe Orton 0.5.6-1 +- update to 0.5.6 (#134343) + +* Thu Sep 30 2004 Miloslav Trmac - 0.5.4-3 +- Fix Group: (#134068) + +* Tue Aug 31 2004 Joe Orton 0.5.4-2 +- move ldconfig from preun to postun (#131280) + +* Sun Aug 8 2004 Joe Orton 0.5.4-1 +- update to 0.5.4 (#129341) + +* Thu Jul 15 2004 Robert Scheck 0.5.2-1 +- upgrade to 0.5.2, enabled i18n support and info files (#127906) + +* Fri Jul 9 2004 Joe Orton 0.5.1-1 +- update to 0.5.1 (#127496) + +* Mon Jun 28 2004 Joe Orton 0.5.0-1 +- update to 0.5.0 (#126836) + +* Tue Jun 22 2004 Than Ngo 0.4.9-2 +- add prereq: /sbin/ldconfig +- move la file in main package + +* Tue Jun 15 2004 Robert Scheck 0.4.9-1 +- upgrade to 0.4.9 (#126353) + +* Tue Jun 15 2004 Elliot Lee +- rebuilt + +* Thu Apr 29 2004 Joe Orton 0.4.4-1 +- update to 0.4.4; remove contrib from -devel docs + +* Thu Apr 29 2004 Joe Orton 0.4.3-1 +- update to 0.4.3, remove -rpath patch + +* Tue Jan 27 2004 Joe Orton 0.3.7-1 +- update to 0.3.7, simplify + +* Wed Jan 07 2004 Lenny Cartier 0.3.6-1mdk +- 0.3.6 + +* Mon Dec 15 2003 Oden Eriksson 0.3.5-1mdk +- 0.3.5 + +* Sun Oct 19 2003 Oden Eriksson 0.3.3-2mdk +- drop the "soname fix" and use the correct way... + +* Sat Oct 18 2003 Oden Eriksson 0.3.3-1mdk +- 0.3.3 + +* Mon Oct 13 2003 Oden Eriksson 0.3.2-1mdk +- initial cooker contrib +- used the package from PLD as a start point