1 |
commit: bf99f12dd62ea1273d2fc7784c381ade40703170 |
2 |
Author: Jeroen Roovers <jer <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Nov 27 06:23:01 2017 +0000 |
4 |
Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Nov 27 06:23:29 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bf99f12d |
7 |
|
8 |
net-dns/libidn: "Really fix integer overflow" (bug #631130). |
9 |
|
10 |
Package-Manager: Portage-2.3.16, Repoman-2.3.6 |
11 |
|
12 |
net-dns/libidn/Manifest | 2 +- |
13 |
.../libidn/files/libidn-1.33-CVE-2017-14062.patch | 45 ++++++++ |
14 |
.../libidn/files/libidn-1.33-parallel-make.patch | 26 +++++ |
15 |
net-dns/libidn/libidn-1.33-r2.ebuild | 126 +++++++++++++++++++++ |
16 |
4 files changed, 198 insertions(+), 1 deletion(-) |
17 |
|
18 |
diff --git a/net-dns/libidn/Manifest b/net-dns/libidn/Manifest |
19 |
index 7cc057c769f..8be52eeac64 100644 |
20 |
--- a/net-dns/libidn/Manifest |
21 |
+++ b/net-dns/libidn/Manifest |
22 |
@@ -1 +1 @@ |
23 |
-DIST libidn-1.33.tar.gz 3501056 SHA256 44a7aab635bb721ceef6beecc4d49dfd19478325e1b47f3196f7d2acc4930e19 SHA512 38dd459eaeda0c9e3cc2d24d967113515a499747550a2a9157f32357def90d71a3a3b52398e96a44a28cd5948dc353b0473c4ff0453a69720191c4cb49cac2c6 WHIRLPOOL 3b0c44742c2515e09eaf8f16f32f30bc37478a6273765d71dd9a9283f501998b6d85583cd38810bbdbd6103855e77831360010d707d29956798e3f5d066b0e82 |
24 |
+DIST libidn-1.33.tar.gz 3501056 BLAKE2B ce6319dc61dd825cf7ddb33f4279c178709e16ce2815c3d1a464bba6b5c6cc493107a10a686f349247a0d6023b1b834a650046e68da9f2f559870dba13a59384 SHA512 38dd459eaeda0c9e3cc2d24d967113515a499747550a2a9157f32357def90d71a3a3b52398e96a44a28cd5948dc353b0473c4ff0453a69720191c4cb49cac2c6 |
25 |
|
26 |
diff --git a/net-dns/libidn/files/libidn-1.33-CVE-2017-14062.patch b/net-dns/libidn/files/libidn-1.33-CVE-2017-14062.patch |
27 |
index 2ddf3fdd6be..5c2e0a91b2e 100644 |
28 |
--- a/net-dns/libidn/files/libidn-1.33-CVE-2017-14062.patch |
29 |
+++ b/net-dns/libidn/files/libidn-1.33-CVE-2017-14062.patch |
30 |
@@ -30,3 +30,48 @@ index 86819a7..49250a1 100644 |
31 |
-- |
32 |
1.9.1 |
33 |
|
34 |
+From 6c8a9375641ca283b50f9680c90dcd57f9c44798 Mon Sep 17 00:00:00 2001 |
35 |
+From: =?utf8?q?Tim=20R=C3=BChsen?= <tim.ruehsen@×××.de> |
36 |
+Date: Wed, 4 Oct 2017 15:22:43 +0200 |
37 |
+Subject: [PATCH] lib/punycode.c (decode_digit): Really fix integer overflow |
38 |
+ |
39 |
+The fix in commit e9e81b8063b095b02cf104bb992fa9bf9515b9d8 |
40 |
+was incomplete. |
41 |
+ |
42 |
+Reported-by: Christian Weisgerber |
43 |
+--- |
44 |
+ lib/punycode.c | 4 ++-- |
45 |
+ tests/tst_idna.c | 2 +- |
46 |
+ 2 files changed, 3 insertions(+), 3 deletions(-) |
47 |
+ |
48 |
+diff --git a/lib/punycode.c b/lib/punycode.c |
49 |
+index 49250a1..d475b6d 100644 |
50 |
+--- a/lib/punycode.c |
51 |
++++ b/lib/punycode.c |
52 |
+@@ -91,8 +91,8 @@ enum |
53 |
+ static unsigned |
54 |
+ decode_digit (int cp) |
55 |
+ { |
56 |
+- return (unsigned) cp - 48 < 10 ? cp - 22 : cp - 65 < 26 ? cp - 65 : |
57 |
+- cp - 97 < 26 ? cp - 97 : base; |
58 |
++ return (unsigned) (cp - 48 < 10 ? cp - 22 : cp - 65 < 26 ? cp - 65 : |
59 |
++ cp - 97 < 26 ? cp - 97 : base); |
60 |
+ } |
61 |
+ |
62 |
+ /* encode_digit(d,flag) returns the basic code point whose value */ |
63 |
+diff --git a/tests/tst_idna.c b/tests/tst_idna.c |
64 |
+index 4ac046f..7fb58b9 100644 |
65 |
+--- a/tests/tst_idna.c |
66 |
++++ b/tests/tst_idna.c |
67 |
+@@ -211,7 +211,7 @@ static const struct idna idna[] = { |
68 |
+ 'x', 'n', '-', '-', 'f', 'o', 0x3067}, |
69 |
+ IDNA_ACE_PREFIX "too long too long too long too long too long too " |
70 |
+ "long too long too long too long too long ", 0, |
71 |
+- IDNA_CONTAINS_ACE_PREFIX, IDNA_PUNYCODE_ERROR} |
72 |
++ IDNA_CONTAINS_ACE_PREFIX, IDNA_INVALID_LENGTH} |
73 |
+ }; |
74 |
+ |
75 |
+ void |
76 |
+-- |
77 |
+1.9.1 |
78 |
+ |
79 |
|
80 |
diff --git a/net-dns/libidn/files/libidn-1.33-parallel-make.patch b/net-dns/libidn/files/libidn-1.33-parallel-make.patch |
81 |
new file mode 100644 |
82 |
index 00000000000..a33cdc74e2a |
83 |
--- /dev/null |
84 |
+++ b/net-dns/libidn/files/libidn-1.33-parallel-make.patch |
85 |
@@ -0,0 +1,26 @@ |
86 |
+From 4709e64fef29ca8ddd5b0878e3126640bd1480c2 Mon Sep 17 00:00:00 2001 |
87 |
+From: =?utf8?q?Tim=20R=C3=BChsen?= <tim.ruehsen@×××.de> |
88 |
+Date: Wed, 4 Oct 2017 15:02:49 +0200 |
89 |
+Subject: [PATCH] * src/Makefile.am: Fix rule for parallel builds |
90 |
+ |
91 |
+--- |
92 |
+ src/Makefile.am | 3 ++- |
93 |
+ 1 file changed, 2 insertions(+), 1 deletion(-) |
94 |
+ |
95 |
+diff --git a/src/Makefile.am b/src/Makefile.am |
96 |
+index 6832c20..218d52e 100644 |
97 |
+--- a/src/Makefile.am |
98 |
++++ b/src/Makefile.am |
99 |
+@@ -35,7 +35,8 @@ libidn_cmd_la_SOURCES = idn.ggo idn_cmd.c idn_cmd.h |
100 |
+ libidn_cmd_la_LIBADD = ../gl/libgnu.la |
101 |
+ libidn_cmd_la_CFLAGS = |
102 |
+ |
103 |
+-idn_cmd.c idn_cmd.h: idn.ggo Makefile.am |
104 |
++# pattern rule (%) needed for parallel make (-j) |
105 |
++idn_cmd%c idn_cmd%h: idn.ggo Makefile.am |
106 |
+ gengetopt --unamed-opts --no-handle-version --no-handle-help \ |
107 |
+ --set-package="idn" \ |
108 |
+ --input $^ --file-name idn_cmd |
109 |
+-- |
110 |
+1.9.1 |
111 |
+ |
112 |
|
113 |
diff --git a/net-dns/libidn/libidn-1.33-r2.ebuild b/net-dns/libidn/libidn-1.33-r2.ebuild |
114 |
new file mode 100644 |
115 |
index 00000000000..5e498c6299e |
116 |
--- /dev/null |
117 |
+++ b/net-dns/libidn/libidn-1.33-r2.ebuild |
118 |
@@ -0,0 +1,126 @@ |
119 |
+# Copyright 1999-2017 Gentoo Foundation |
120 |
+# Distributed under the terms of the GNU General Public License v2 |
121 |
+ |
122 |
+EAPI=6 |
123 |
+inherit elisp-common java-pkg-opt-2 mono-env multilib-minimal libtool |
124 |
+ |
125 |
+DESCRIPTION="Internationalized Domain Names (IDN) implementation" |
126 |
+HOMEPAGE="https://www.gnu.org/software/libidn/" |
127 |
+SRC_URI="mirror://gnu/libidn/${P}.tar.gz" |
128 |
+ |
129 |
+LICENSE="GPL-2 GPL-3 LGPL-3 java? ( Apache-2.0 )" |
130 |
+SLOT="0" |
131 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x64-cygwin ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" |
132 |
+IUSE="doc emacs java mono nls static-libs" |
133 |
+ |
134 |
+DOCS=( AUTHORS ChangeLog FAQ NEWS README THANKS TODO ) |
135 |
+COMMON_DEPEND=" |
136 |
+ emacs? ( virtual/emacs ) |
137 |
+ mono? ( >=dev-lang/mono-0.95 ) |
138 |
+" |
139 |
+DEPEND="${COMMON_DEPEND} |
140 |
+ nls? ( |
141 |
+ >=sys-devel/gettext-0.17 |
142 |
+ ) |
143 |
+ java? ( |
144 |
+ >=virtual/jdk-1.5 |
145 |
+ ) |
146 |
+" |
147 |
+RDEPEND="${COMMON_DEPEND} |
148 |
+ nls? ( |
149 |
+ >=virtual/libintl-0-r1[${MULTILIB_USEDEP}] |
150 |
+ ) |
151 |
+ java? ( |
152 |
+ >=virtual/jre-1.5 |
153 |
+ ) |
154 |
+ abi_x86_32? ( |
155 |
+ !<=app-emulation/emul-linux-x86-baselibs-20140508-r5 |
156 |
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] |
157 |
+ ) |
158 |
+" |
159 |
+PATCHES=( |
160 |
+ "${FILESDIR}"/${PN}-1.33-CVE-2017-14062.patch |
161 |
+ "${FILESDIR}"/${PN}-1.33-parallel-make.patch |
162 |
+) |
163 |
+ |
164 |
+pkg_setup() { |
165 |
+ mono-env_pkg_setup |
166 |
+ java-pkg-opt-2_pkg_setup |
167 |
+} |
168 |
+ |
169 |
+src_prepare() { |
170 |
+ default |
171 |
+ |
172 |
+ # bundled, with wrong bytecode |
173 |
+ rm "${S}/java/${P}.jar" || die |
174 |
+ |
175 |
+ # prevent triggering doc updates after punycode.c patch |
176 |
+ touch doc/texi/punycode* doc/man/punycode* doc/libidn.info || die |
177 |
+ |
178 |
+ elibtoolize # for Solaris shared objects |
179 |
+} |
180 |
+ |
181 |
+multilib_src_configure() { |
182 |
+ ECONF_SOURCE=${S} GJDOC=javadoc \ |
183 |
+ econf \ |
184 |
+ $(multilib_native_use_enable java) \ |
185 |
+ $(multilib_native_use_enable mono csharp mono) \ |
186 |
+ $(use_enable nls) \ |
187 |
+ $(use_enable static-libs static) \ |
188 |
+ --disable-silent-rules \ |
189 |
+ --disable-valgrind-tests \ |
190 |
+ --with-lispdir="${EPREFIX}${SITELISP}/${PN}" \ |
191 |
+ --with-packager-bug-reports="https://bugs.gentoo.org" \ |
192 |
+ --with-packager-version="r${PR}" \ |
193 |
+ --with-packager="Gentoo" |
194 |
+} |
195 |
+ |
196 |
+multilib_src_compile() { |
197 |
+ default |
198 |
+ |
199 |
+ if multilib_is_native_abi; then |
200 |
+ use emacs && elisp-compile "${S}"/src/*.el |
201 |
+ use java && use doc && emake -C java/src/main/java javadoc |
202 |
+ fi |
203 |
+} |
204 |
+ |
205 |
+multilib_src_test() { |
206 |
+ # only run libidn specific tests and not gnulib tests (bug #539356) |
207 |
+ emake -C tests check |
208 |
+} |
209 |
+ |
210 |
+multilib_src_install() { |
211 |
+ emake DESTDIR="${D}" install |
212 |
+ |
213 |
+ if multilib_is_native_abi && use java; then |
214 |
+ java-pkg_newjar java/${P}.jar ${PN}.jar |
215 |
+ rm -r "${ED}"/usr/share/java || die |
216 |
+ use doc && java-pkg_dojavadoc "${S}"/doc/java |
217 |
+ fi |
218 |
+} |
219 |
+ |
220 |
+multilib_src_install_all() { |
221 |
+ if use emacs; then |
222 |
+ # *.el are installed by the build system |
223 |
+ elisp-install ${PN} "${S}"/src/*.elc |
224 |
+ elisp-site-file-install "${FILESDIR}/50${PN}-gentoo.el" |
225 |
+ else |
226 |
+ rm -r "${ED}/usr/share/emacs" || die |
227 |
+ fi |
228 |
+ |
229 |
+ einstalldocs |
230 |
+ |
231 |
+ if use doc ; then |
232 |
+ dodoc -r doc/reference/html/ |
233 |
+ fi |
234 |
+ |
235 |
+ prune_libtool_files |
236 |
+} |
237 |
+ |
238 |
+pkg_postinst() { |
239 |
+ use emacs && elisp-site-regen |
240 |
+} |
241 |
+ |
242 |
+pkg_postrm() { |
243 |
+ use emacs && elisp-site-regen |
244 |
+} |