* [gentoo-commits] repo/gentoo:master commit in: dev-libs/nettle/, dev-libs/nettle/files/
@ 2016-08-04 19:42 Alon Bar-Lev
0 siblings, 0 replies; 4+ messages in thread
From: Alon Bar-Lev @ 2016-08-04 19:42 UTC (permalink / raw
To: gentoo-commits
commit: e564743466a473d0c5df5d97f2bb8c0b5377f5fd
Author: Alon Bar-Lev <alonbl <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 4 19:40:43 2016 +0000
Commit: Alon Bar-Lev <alonbl <AT> gentoo <DOT> org>
CommitDate: Thu Aug 4 19:41:43 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e5647434
dev-libs/nettle - fix CVE-2016-6489
Bug: 590484
Package-Manager: portage-2.2.28
.../nettle/files/nettle-3.2-CVE-2016-6489.patch | 177 +++++++++++++++++++++
dev-libs/nettle/nettle-3.2-r1.ebuild | 67 ++++++++
2 files changed, 244 insertions(+)
diff --git a/dev-libs/nettle/files/nettle-3.2-CVE-2016-6489.patch b/dev-libs/nettle/files/nettle-3.2-CVE-2016-6489.patch
new file mode 100644
index 0000000..4776a20
--- /dev/null
+++ b/dev-libs/nettle/files/nettle-3.2-CVE-2016-6489.patch
@@ -0,0 +1,177 @@
+From 6450224f3e3c78fdfa37eadbe6ada8301279f6c1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se>
+Date: Mon, 20 Jun 2016 20:04:56 +0200
+Subject: Use mpz_powm_sec.
+Subject: Check for invalid keys, with even p, in dsa_sign.
+Subject: Reject invalid keys, with even moduli, in rsa_compute_root_tr.
+Subject: Reject invalid RSA keys with even modulo.
+
+diff --git a/bignum.h b/bignum.h
+index 24158e0..0d30534 100644
+--- a/bignum.h
++++ b/bignum.h
+@@ -53,6 +53,8 @@
+ # define mpz_combit mpz_combit
+ # define mpz_import mpz_import
+ # define mpz_export mpz_export
++/* Side-channel silent powm not available in mini-gmp. */
++# define mpz_powm_sec mpz_powm
+ #else
+ # include <gmp.h>
+ #endif
+diff --git a/configure.ac b/configure.ac
+index e1ee64c..1e88477 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -236,9 +236,9 @@ fi
+ # Checks for libraries
+ if test "x$enable_public_key" = "xyes" ; then
+ if test "x$enable_mini_gmp" = "xno" ; then
+- AC_CHECK_LIB(gmp, __gmpz_getlimbn,,
++ AC_CHECK_LIB(gmp, __gmpz_powm_sec,,
+ [AC_MSG_WARN(
+- [GNU MP not found, or not 3.1 or up, see http://gmplib.org/.
++ [GNU MP not found, or too old. GMP-5.0 or later is needed, see http://gmplib.org/.
+ Support for public key algorithms will be unavailable.])]
+ enable_public_key=no)
+
+diff --git a/dsa-sign.c b/dsa-sign.c
+index 62c7d4a..b713743 100644
+--- a/dsa-sign.c
++++ b/dsa-sign.c
+@@ -56,6 +56,11 @@ dsa_sign(const struct dsa_params *params,
+ mpz_t tmp;
+ int res;
+
++ /* Check that p is odd, so that invalid keys don't result in a crash
++ inside mpz_powm_sec. */
++ if (mpz_even_p (params->p))
++ return 0;
++
+ /* Select k, 0<k<q, randomly */
+ mpz_init_set(tmp, params->q);
+ mpz_sub_ui(tmp, tmp, 1);
+@@ -65,7 +70,7 @@ dsa_sign(const struct dsa_params *params,
+ mpz_add_ui(k, k, 1);
+
+ /* Compute r = (g^k (mod p)) (mod q) */
+- mpz_powm(tmp, params->g, k, params->p);
++ mpz_powm_sec(tmp, params->g, k, params->p);
+ mpz_fdiv_r(signature->r, tmp, params->q);
+
+ /* Compute hash */
+diff --git a/rsa-blind.c b/rsa-blind.c
+index 7662f50..16b03d7 100644
+--- a/rsa-blind.c
++++ b/rsa-blind.c
+@@ -61,7 +61,7 @@ _rsa_blind (const struct rsa_public_key *pub,
+ while (!mpz_invert (ri, r, pub->n));
+
+ /* c = c*(r^e) mod n */
+- mpz_powm(r, r, pub->e, pub->n);
++ mpz_powm_sec(r, r, pub->e, pub->n);
+ mpz_mul(c, c, r);
+ mpz_fdiv_r(c, c, pub->n);
+
+diff --git a/rsa-sign-tr.c b/rsa-sign-tr.c
+index 3d80ed4..8542cae 100644
+--- a/rsa-sign-tr.c
++++ b/rsa-sign-tr.c
+@@ -60,7 +60,7 @@ rsa_blind (const struct rsa_public_key *pub,
+ while (!mpz_invert (ri, r, pub->n));
+
+ /* c = c*(r^e) mod n */
+- mpz_powm(r, r, pub->e, pub->n);
++ mpz_powm_sec(r, r, pub->e, pub->n);
+ mpz_mul(c, m, r);
+ mpz_fdiv_r(c, c, pub->n);
+
+@@ -88,6 +88,14 @@ rsa_compute_root_tr(const struct rsa_public_key *pub,
+ int res;
+ mpz_t t, mb, xb, ri;
+
++ /* mpz_powm_sec handles only odd moduli. If p, q or n is even, the
++ key is invalid and rejected by rsa_private_key_prepare. However,
++ some applications, notably gnutls, don't use this function, and
++ we don't want an invalid key to lead to a crash down inside
++ mpz_powm_sec. So do an additional check here. */
++ if (mpz_even_p (pub->n) || mpz_even_p (key->p) || mpz_even_p (key->q))
++ return 0;
++
+ mpz_init (mb);
+ mpz_init (xb);
+ mpz_init (ri);
+@@ -97,7 +105,7 @@ rsa_compute_root_tr(const struct rsa_public_key *pub,
+
+ rsa_compute_root (key, xb, mb);
+
+- mpz_powm(t, xb, pub->e, pub->n);
++ mpz_powm_sec(t, xb, pub->e, pub->n);
+ res = (mpz_cmp(mb, t) == 0);
+
+ if (res)
+diff --git a/rsa-sign.c b/rsa-sign.c
+index eba7388..4832352 100644
+--- a/rsa-sign.c
++++ b/rsa-sign.c
+@@ -96,11 +96,11 @@ rsa_compute_root(const struct rsa_private_key *key,
+
+ /* Compute xq = m^d % q = (m%q)^b % q */
+ mpz_fdiv_r(xq, m, key->q);
+- mpz_powm(xq, xq, key->b, key->q);
++ mpz_powm_sec(xq, xq, key->b, key->q);
+
+ /* Compute xp = m^d % p = (m%p)^a % p */
+ mpz_fdiv_r(xp, m, key->p);
+- mpz_powm(xp, xp, key->a, key->p);
++ mpz_powm_sec(xp, xp, key->a, key->p);
+
+ /* Set xp' = (xp - xq) c % p. */
+ mpz_sub(xp, xp, xq);
+diff --git a/rsa.c b/rsa.c
+index 19d93de..f594140 100644
+--- a/rsa.c
++++ b/rsa.c
+@@ -58,13 +58,18 @@ rsa_public_key_clear(struct rsa_public_key *key)
+ }
+
+ /* Computes the size, in octets, of a the modulo. Returns 0 if the
+- * modulo is too small to be useful. */
+-
++ * modulo is too small to be useful, or otherwise appears invalid. */
+ size_t
+ _rsa_check_size(mpz_t n)
+ {
+ /* Round upwards */
+- size_t size = (mpz_sizeinbase(n, 2) + 7) / 8;
++ size_t size;
++
++ /* Even moduli are invalid, and not supported by mpz_powm_sec. */
++ if (mpz_even_p (n))
++ return 0;
++
++ size = (mpz_sizeinbase(n, 2) + 7) / 8;
+
+ if (size < RSA_MINIMUM_N_OCTETS)
+ return 0;
+diff --git a/testsuite/rsa-test.c b/testsuite/rsa-test.c
+index e9b1c03..a429664 100644
+--- a/testsuite/rsa-test.c
++++ b/testsuite/rsa-test.c
+@@ -57,6 +57,13 @@ test_main(void)
+
+ test_rsa_sha512(&pub, &key, expected);
+
++ /* Test detection of invalid keys with even modulo */
++ mpz_clrbit (pub.n, 0);
++ ASSERT (!rsa_public_key_prepare (&pub));
++
++ mpz_clrbit (key.p, 0);
++ ASSERT (!rsa_private_key_prepare (&key));
++
+ /* 777-bit key, generated by
+ *
+ * lsh-keygen -a rsa -l 777 -f advanced-hex
+--
+2.7.3
+
diff --git a/dev-libs/nettle/nettle-3.2-r1.ebuild b/dev-libs/nettle/nettle-3.2-r1.ebuild
new file mode 100644
index 0000000..3ed9631
--- /dev/null
+++ b/dev-libs/nettle/nettle-3.2-r1.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit autotools eutils multilib-build multilib-minimal multilib toolchain-funcs
+
+DESCRIPTION="Low-level cryptographic library"
+HOMEPAGE="http://www.lysator.liu.se/~nisse/nettle/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
+
+LICENSE="|| ( LGPL-3 LGPL-2.1 )"
+SLOT="0/6" # subslot = libnettle soname version
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~x86-solaris"
+IUSE="doc +gmp neon static-libs test cpu_flags_x86_aes"
+
+DEPEND="gmp? ( >=dev-libs/gmp-5.0:0[${MULTILIB_USEDEP}] )"
+RDEPEND="${DEPEND}
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20131008-r17
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+
+PATCHES=(
+ "${FILESDIR}/${P}-CVE-2016-6489.patch"
+)
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/nettle/nettle-stdint.h
+ /usr/include/nettle/version.h
+)
+
+src_prepare() {
+ default
+
+ sed -e '/CFLAGS=/s: -ggdb3::' \
+ -e 's/solaris\*)/sunldsolaris*)/' \
+ -i configure.ac || die
+
+ # conditionally build tests and examples required by tests
+ use test || sed -i '/SUBDIRS/s/testsuite examples//' Makefile.in || die
+
+ eautoreconf
+}
+
+multilib_src_configure() {
+ # --disable-openssl bug #427526
+ ECONF_SOURCE="${S}" econf \
+ --libdir="${EPREFIX}"/usr/$(get_libdir) \
+ --disable-openssl \
+ --disable-fat \
+ $(use_enable gmp public-key) \
+ $(use_enable static-libs static) \
+ $(tc-is-static-only && echo --disable-shared) \
+ $(use_enable doc documentation) \
+ $(use_enable neon arm-neon) \
+ $(use_enable cpu_flags_x86_aes x86-aesni)
+}
+
+multilib_src_install_all() {
+ einstalldocs
+ if use doc ; then
+ dohtml nettle.html
+ dodoc nettle.pdf
+ fi
+}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-libs/nettle/, dev-libs/nettle/files/
@ 2017-06-14 18:02 Alon Bar-Lev
0 siblings, 0 replies; 4+ messages in thread
From: Alon Bar-Lev @ 2017-06-14 18:02 UTC (permalink / raw
To: gentoo-commits
commit: 01da71fecfa49bed0320d1d2b076f76e9681db31
Author: Alon Bar-Lev <alonbl <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 11 01:55:30 2017 +0000
Commit: Alon Bar-Lev <alonbl <AT> gentoo <DOT> org>
CommitDate: Wed Jun 14 18:02:37 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=01da71fe
dev-libs/nettle: cleanup
Bug: 613846
Package-Manager: Portage-2.3.5, Repoman-2.3.1
dev-libs/nettle/Manifest | 1 -
.../nettle/files/nettle-3.2-CVE-2016-6489.patch | 177 ---------------------
dev-libs/nettle/nettle-3.2-r1.ebuild | 66 --------
dev-libs/nettle/nettle-3.3.ebuild | 66 --------
4 files changed, 310 deletions(-)
diff --git a/dev-libs/nettle/Manifest b/dev-libs/nettle/Manifest
index 48b600a0309..599513172b0 100644
--- a/dev-libs/nettle/Manifest
+++ b/dev-libs/nettle/Manifest
@@ -1,2 +1 @@
-DIST nettle-3.2.tar.gz 1879604 SHA256 ea4283def236413edab5a4cf9cf32adf540c8df1b9b67641cfc2302fca849d97 SHA512 9f2c802e8b683d1c2fd8d16ab33b2a1efda33a1bf33196be39031a2d0677f2e78d67221a718997780e157aa72973da7d9d549429e706fcfcdff97ee3bbef615a WHIRLPOOL 0353f04760137eef292848b4d8060c40cf2959596aff6f39a1d1bd123e42bc0ecb6f01679f16797204eedb01123c09ae7745121241f6a32cc205bf1c8c6efc12
DIST nettle-3.3.tar.gz 1887927 SHA256 46942627d5d0ca11720fec18d81fc38f7ef837ea4197c1f630e71ce0d470b11e SHA512 271981d89766f151af3cdc4e5fc43c438222f0f6f44475bad114f4209955b5235fced6526c7abca001cca223e8cfcd2a6bf389b160b305a499e7acf52425ec70 WHIRLPOOL 716df66adaa96019101916a351f1f87f82f0df12269aa0c8a1f3e762f9150ddf09752a817e3479a523f0e76a4d0fe074a3ca403d7df568b63c028d61ec395e80
diff --git a/dev-libs/nettle/files/nettle-3.2-CVE-2016-6489.patch b/dev-libs/nettle/files/nettle-3.2-CVE-2016-6489.patch
deleted file mode 100644
index 4776a207275..00000000000
--- a/dev-libs/nettle/files/nettle-3.2-CVE-2016-6489.patch
+++ /dev/null
@@ -1,177 +0,0 @@
-From 6450224f3e3c78fdfa37eadbe6ada8301279f6c1 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se>
-Date: Mon, 20 Jun 2016 20:04:56 +0200
-Subject: Use mpz_powm_sec.
-Subject: Check for invalid keys, with even p, in dsa_sign.
-Subject: Reject invalid keys, with even moduli, in rsa_compute_root_tr.
-Subject: Reject invalid RSA keys with even modulo.
-
-diff --git a/bignum.h b/bignum.h
-index 24158e0..0d30534 100644
---- a/bignum.h
-+++ b/bignum.h
-@@ -53,6 +53,8 @@
- # define mpz_combit mpz_combit
- # define mpz_import mpz_import
- # define mpz_export mpz_export
-+/* Side-channel silent powm not available in mini-gmp. */
-+# define mpz_powm_sec mpz_powm
- #else
- # include <gmp.h>
- #endif
-diff --git a/configure.ac b/configure.ac
-index e1ee64c..1e88477 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -236,9 +236,9 @@ fi
- # Checks for libraries
- if test "x$enable_public_key" = "xyes" ; then
- if test "x$enable_mini_gmp" = "xno" ; then
-- AC_CHECK_LIB(gmp, __gmpz_getlimbn,,
-+ AC_CHECK_LIB(gmp, __gmpz_powm_sec,,
- [AC_MSG_WARN(
-- [GNU MP not found, or not 3.1 or up, see http://gmplib.org/.
-+ [GNU MP not found, or too old. GMP-5.0 or later is needed, see http://gmplib.org/.
- Support for public key algorithms will be unavailable.])]
- enable_public_key=no)
-
-diff --git a/dsa-sign.c b/dsa-sign.c
-index 62c7d4a..b713743 100644
---- a/dsa-sign.c
-+++ b/dsa-sign.c
-@@ -56,6 +56,11 @@ dsa_sign(const struct dsa_params *params,
- mpz_t tmp;
- int res;
-
-+ /* Check that p is odd, so that invalid keys don't result in a crash
-+ inside mpz_powm_sec. */
-+ if (mpz_even_p (params->p))
-+ return 0;
-+
- /* Select k, 0<k<q, randomly */
- mpz_init_set(tmp, params->q);
- mpz_sub_ui(tmp, tmp, 1);
-@@ -65,7 +70,7 @@ dsa_sign(const struct dsa_params *params,
- mpz_add_ui(k, k, 1);
-
- /* Compute r = (g^k (mod p)) (mod q) */
-- mpz_powm(tmp, params->g, k, params->p);
-+ mpz_powm_sec(tmp, params->g, k, params->p);
- mpz_fdiv_r(signature->r, tmp, params->q);
-
- /* Compute hash */
-diff --git a/rsa-blind.c b/rsa-blind.c
-index 7662f50..16b03d7 100644
---- a/rsa-blind.c
-+++ b/rsa-blind.c
-@@ -61,7 +61,7 @@ _rsa_blind (const struct rsa_public_key *pub,
- while (!mpz_invert (ri, r, pub->n));
-
- /* c = c*(r^e) mod n */
-- mpz_powm(r, r, pub->e, pub->n);
-+ mpz_powm_sec(r, r, pub->e, pub->n);
- mpz_mul(c, c, r);
- mpz_fdiv_r(c, c, pub->n);
-
-diff --git a/rsa-sign-tr.c b/rsa-sign-tr.c
-index 3d80ed4..8542cae 100644
---- a/rsa-sign-tr.c
-+++ b/rsa-sign-tr.c
-@@ -60,7 +60,7 @@ rsa_blind (const struct rsa_public_key *pub,
- while (!mpz_invert (ri, r, pub->n));
-
- /* c = c*(r^e) mod n */
-- mpz_powm(r, r, pub->e, pub->n);
-+ mpz_powm_sec(r, r, pub->e, pub->n);
- mpz_mul(c, m, r);
- mpz_fdiv_r(c, c, pub->n);
-
-@@ -88,6 +88,14 @@ rsa_compute_root_tr(const struct rsa_public_key *pub,
- int res;
- mpz_t t, mb, xb, ri;
-
-+ /* mpz_powm_sec handles only odd moduli. If p, q or n is even, the
-+ key is invalid and rejected by rsa_private_key_prepare. However,
-+ some applications, notably gnutls, don't use this function, and
-+ we don't want an invalid key to lead to a crash down inside
-+ mpz_powm_sec. So do an additional check here. */
-+ if (mpz_even_p (pub->n) || mpz_even_p (key->p) || mpz_even_p (key->q))
-+ return 0;
-+
- mpz_init (mb);
- mpz_init (xb);
- mpz_init (ri);
-@@ -97,7 +105,7 @@ rsa_compute_root_tr(const struct rsa_public_key *pub,
-
- rsa_compute_root (key, xb, mb);
-
-- mpz_powm(t, xb, pub->e, pub->n);
-+ mpz_powm_sec(t, xb, pub->e, pub->n);
- res = (mpz_cmp(mb, t) == 0);
-
- if (res)
-diff --git a/rsa-sign.c b/rsa-sign.c
-index eba7388..4832352 100644
---- a/rsa-sign.c
-+++ b/rsa-sign.c
-@@ -96,11 +96,11 @@ rsa_compute_root(const struct rsa_private_key *key,
-
- /* Compute xq = m^d % q = (m%q)^b % q */
- mpz_fdiv_r(xq, m, key->q);
-- mpz_powm(xq, xq, key->b, key->q);
-+ mpz_powm_sec(xq, xq, key->b, key->q);
-
- /* Compute xp = m^d % p = (m%p)^a % p */
- mpz_fdiv_r(xp, m, key->p);
-- mpz_powm(xp, xp, key->a, key->p);
-+ mpz_powm_sec(xp, xp, key->a, key->p);
-
- /* Set xp' = (xp - xq) c % p. */
- mpz_sub(xp, xp, xq);
-diff --git a/rsa.c b/rsa.c
-index 19d93de..f594140 100644
---- a/rsa.c
-+++ b/rsa.c
-@@ -58,13 +58,18 @@ rsa_public_key_clear(struct rsa_public_key *key)
- }
-
- /* Computes the size, in octets, of a the modulo. Returns 0 if the
-- * modulo is too small to be useful. */
--
-+ * modulo is too small to be useful, or otherwise appears invalid. */
- size_t
- _rsa_check_size(mpz_t n)
- {
- /* Round upwards */
-- size_t size = (mpz_sizeinbase(n, 2) + 7) / 8;
-+ size_t size;
-+
-+ /* Even moduli are invalid, and not supported by mpz_powm_sec. */
-+ if (mpz_even_p (n))
-+ return 0;
-+
-+ size = (mpz_sizeinbase(n, 2) + 7) / 8;
-
- if (size < RSA_MINIMUM_N_OCTETS)
- return 0;
-diff --git a/testsuite/rsa-test.c b/testsuite/rsa-test.c
-index e9b1c03..a429664 100644
---- a/testsuite/rsa-test.c
-+++ b/testsuite/rsa-test.c
-@@ -57,6 +57,13 @@ test_main(void)
-
- test_rsa_sha512(&pub, &key, expected);
-
-+ /* Test detection of invalid keys with even modulo */
-+ mpz_clrbit (pub.n, 0);
-+ ASSERT (!rsa_public_key_prepare (&pub));
-+
-+ mpz_clrbit (key.p, 0);
-+ ASSERT (!rsa_private_key_prepare (&key));
-+
- /* 777-bit key, generated by
- *
- * lsh-keygen -a rsa -l 777 -f advanced-hex
---
-2.7.3
-
diff --git a/dev-libs/nettle/nettle-3.2-r1.ebuild b/dev-libs/nettle/nettle-3.2-r1.ebuild
deleted file mode 100644
index 6986ec4df95..00000000000
--- a/dev-libs/nettle/nettle-3.2-r1.ebuild
+++ /dev/null
@@ -1,66 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit autotools eutils multilib-build multilib-minimal multilib toolchain-funcs
-
-DESCRIPTION="Low-level cryptographic library"
-HOMEPAGE="http://www.lysator.liu.se/~nisse/nettle/"
-SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
-
-LICENSE="|| ( LGPL-3 LGPL-2.1 )"
-SLOT="0/6" # subslot = libnettle soname version
-KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="doc +gmp neon static-libs test cpu_flags_x86_aes"
-
-DEPEND="gmp? ( >=dev-libs/gmp-5.0:0[${MULTILIB_USEDEP}] )"
-RDEPEND="${DEPEND}
- abi_x86_32? (
- !<=app-emulation/emul-linux-x86-baselibs-20131008-r17
- !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
- )"
-
-PATCHES=(
- "${FILESDIR}/${P}-CVE-2016-6489.patch"
-)
-
-MULTILIB_WRAPPED_HEADERS=(
- /usr/include/nettle/nettle-stdint.h
- /usr/include/nettle/version.h
-)
-
-src_prepare() {
- default
-
- sed -e '/CFLAGS=/s: -ggdb3::' \
- -e 's/solaris\*)/sunldsolaris*)/' \
- -i configure.ac || die
-
- # conditionally build tests and examples required by tests
- use test || sed -i '/SUBDIRS/s/testsuite examples//' Makefile.in || die
-
- eautoreconf
-}
-
-multilib_src_configure() {
- # --disable-openssl bug #427526
- ECONF_SOURCE="${S}" econf \
- --libdir="${EPREFIX}"/usr/$(get_libdir) \
- --disable-openssl \
- --disable-fat \
- $(use_enable gmp public-key) \
- $(use_enable static-libs static) \
- $(tc-is-static-only && echo --disable-shared) \
- $(use_enable doc documentation) \
- $(use_enable neon arm-neon) \
- $(use_enable cpu_flags_x86_aes x86-aesni)
-}
-
-multilib_src_install_all() {
- einstalldocs
- if use doc ; then
- dohtml nettle.html
- dodoc nettle.pdf
- fi
-}
diff --git a/dev-libs/nettle/nettle-3.3.ebuild b/dev-libs/nettle/nettle-3.3.ebuild
deleted file mode 100644
index 44409ba976a..00000000000
--- a/dev-libs/nettle/nettle-3.3.ebuild
+++ /dev/null
@@ -1,66 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit autotools multilib-build multilib-minimal multilib toolchain-funcs
-
-DESCRIPTION="Low-level cryptographic library"
-HOMEPAGE="http://www.lysator.liu.se/~nisse/nettle/"
-SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
-
-LICENSE="|| ( LGPL-3 LGPL-2.1 )"
-SLOT="0/6" # subslot = libnettle soname version
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="doc +gmp neon static-libs test cpu_flags_x86_aes"
-
-DEPEND="gmp? ( >=dev-libs/gmp-5.0:0=[${MULTILIB_USEDEP}] )"
-RDEPEND="${DEPEND}
- abi_x86_32? (
- !<=app-emulation/emul-linux-x86-baselibs-20131008-r17
- !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
- )"
-
-MULTILIB_WRAPPED_HEADERS=(
- /usr/include/nettle/nettle-stdint.h
- /usr/include/nettle/version.h
-)
-
-DOCS=()
-HTML_DOCS=()
-
-pkg_setup() {
- use doc && DOCS+=(
- nettle.pdf
- )
- use doc && HTML_DOCS+=(
- nettle.html
- )
-}
-
-src_prepare() {
- default
-
- sed -e '/CFLAGS=/s: -ggdb3::' \
- -e 's/solaris\*)/sunldsolaris*)/' \
- -i configure.ac || die
-
- # conditionally build tests and examples required by tests
- use test || sed -i '/SUBDIRS/s/testsuite examples//' Makefile.in || die
-
- eautoreconf
-}
-
-multilib_src_configure() {
- # --disable-openssl bug #427526
- ECONF_SOURCE="${S}" econf \
- --libdir="${EPREFIX}"/usr/$(get_libdir) \
- --disable-openssl \
- --disable-fat \
- $(use_enable gmp public-key) \
- $(use_enable static-libs static) \
- $(tc-is-static-only && echo --disable-shared) \
- $(use_enable doc documentation) \
- $(use_enable neon arm-neon) \
- $(use_enable cpu_flags_x86_aes x86-aesni)
-}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-libs/nettle/, dev-libs/nettle/files/
@ 2017-07-23 18:09 Alon Bar-Lev
0 siblings, 0 replies; 4+ messages in thread
From: Alon Bar-Lev @ 2017-07-23 18:09 UTC (permalink / raw
To: gentoo-commits
commit: 85a16efd00f98f26f3966aaa273eb9797194bf75
Author: Alon Bar-Lev <alonbl <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 23 18:08:34 2017 +0000
Commit: Alon Bar-Lev <alonbl <AT> gentoo <DOT> org>
CommitDate: Sun Jul 23 18:08:58 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=85a16efd
dev-libs/nettle: fix inplace operations
Thanks: Sergei Trofimovich
Bug: 613418
Package-Manager: Portage-2.3.6, Repoman-2.3.1
dev-libs/nettle/files/nettle-3.3-ecc-add-eh.patch | 32 +++++++++++
dev-libs/nettle/nettle-3.3-r2.ebuild | 70 +++++++++++++++++++++++
2 files changed, 102 insertions(+)
diff --git a/dev-libs/nettle/files/nettle-3.3-ecc-add-eh.patch b/dev-libs/nettle/files/nettle-3.3-ecc-add-eh.patch
new file mode 100644
index 00000000000..5492997f336
--- /dev/null
+++ b/dev-libs/nettle/files/nettle-3.3-ecc-add-eh.patch
@@ -0,0 +1,32 @@
+From dcda81d796de2f4a16fd7e9e7a5d07baa288f147 Mon Sep 17 00:00:00 2001
+From: Niels Möller <nisse@lysator.liu.se>
+Date: Tue, 18 Jul 2017 20:52:30 +0200
+Subject: [PATCH] Fix for in-place ecc_add_eh.
+
+* ecc-add-eh.c (ecc_add_eh): Fix in-place operation by reordering
+two multiplies. Previously, in-place operation resulted in an
+invalid call to mpn_mul with overlapping operands. Reported by
+Sergei Trofimovich.
+---
+ ChangeLog | 7 +++++++
+ ecc-add-eh.c | 4 ++--
+ 2 files changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/ecc-add-eh.c b/ecc-add-eh.c
+index a16be4c..c07ff49 100644
+--- a/ecc-add-eh.c
++++ b/ecc-add-eh.c
+@@ -98,8 +98,8 @@ ecc_add_eh (const struct ecc_curve *ecc,
+ ecc_modp_mul (ecc, x3, B, z1);
+
+ /* y3 */
+- ecc_modp_mul (ecc, B, F, C); /* ! */
+- ecc_modp_mul (ecc, y3, B, z1);
++ ecc_modp_mul (ecc, B, F, z1); /* ! */
++ ecc_modp_mul (ecc, y3, B, C); /* Clobbers z1 in case r == p. */
+
+ /* z3 */
+ ecc_modp_mul (ecc, B, F, G);
+--
+libgit2 0.25.0
+
diff --git a/dev-libs/nettle/nettle-3.3-r2.ebuild b/dev-libs/nettle/nettle-3.3-r2.ebuild
new file mode 100644
index 00000000000..6062d1dfd34
--- /dev/null
+++ b/dev-libs/nettle/nettle-3.3-r2.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools multilib-build multilib-minimal multilib toolchain-funcs
+
+DESCRIPTION="Low-level cryptographic library"
+HOMEPAGE="http://www.lysator.liu.se/~nisse/nettle/"
+SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
+
+LICENSE="|| ( LGPL-3 LGPL-2.1 )"
+SLOT="0/6.1" # subslot = libnettle soname version, .1 as broke ABI bug#601512
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="doc +gmp neon static-libs test cpu_flags_x86_aes"
+
+DEPEND="gmp? ( >=dev-libs/gmp-5.0:0=[${MULTILIB_USEDEP}] )"
+RDEPEND="${DEPEND}
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-baselibs-20131008-r17
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+ )"
+
+MULTILIB_WRAPPED_HEADERS=(
+ /usr/include/nettle/nettle-stdint.h
+ /usr/include/nettle/version.h
+)
+
+DOCS=()
+HTML_DOCS=()
+
+PATCHES=(
+ "${FILESDIR}/${P}-ecc-add-eh.patch"
+)
+
+pkg_setup() {
+ use doc && DOCS+=(
+ nettle.pdf
+ )
+ use doc && HTML_DOCS+=(
+ nettle.html
+ )
+}
+
+src_prepare() {
+ default
+
+ sed -e '/CFLAGS=/s: -ggdb3::' \
+ -e 's/solaris\*)/sunldsolaris*)/' \
+ -i configure.ac || die
+
+ # conditionally build tests and examples required by tests
+ use test || sed -i '/SUBDIRS/s/testsuite examples//' Makefile.in || die
+
+ eautoreconf
+}
+
+multilib_src_configure() {
+ # --disable-openssl bug #427526
+ ECONF_SOURCE="${S}" econf \
+ --libdir="${EPREFIX}"/usr/$(get_libdir) \
+ --disable-openssl \
+ --disable-fat \
+ $(use_enable gmp public-key) \
+ $(use_enable static-libs static) \
+ $(tc-is-static-only && echo --disable-shared) \
+ $(use_enable doc documentation) \
+ $(use_enable neon arm-neon) \
+ $(use_enable cpu_flags_x86_aes x86-aesni)
+}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-libs/nettle/, dev-libs/nettle/files/
@ 2021-01-04 21:09 Lars Wendler
0 siblings, 0 replies; 4+ messages in thread
From: Lars Wendler @ 2021-01-04 21:09 UTC (permalink / raw
To: gentoo-commits
commit: 844c0b192a46048a01b7e9e17953e2534df0d229
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 4 21:09:07 2021 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Mon Jan 4 21:09:18 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=844c0b19
dev-libs/nettle: Removed old
Package-Manager: Portage-3.0.12, Repoman-3.0.2
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
dev-libs/nettle/Manifest | 2 -
dev-libs/nettle/files/nettle-3.4.1-build.patch | 53 --------------------
dev-libs/nettle/nettle-3.4.1.ebuild | 67 --------------------------
dev-libs/nettle/nettle-3.5.1-r1.ebuild | 63 ------------------------
4 files changed, 185 deletions(-)
diff --git a/dev-libs/nettle/Manifest b/dev-libs/nettle/Manifest
index 0de3dc7f97c..7b7ca7e26f9 100644
--- a/dev-libs/nettle/Manifest
+++ b/dev-libs/nettle/Manifest
@@ -1,4 +1,2 @@
-DIST nettle-3.4.1.tar.gz 1947053 BLAKE2B 354318c46c28aeaaca611abe70298024ec12ff70aed53c741e43c1b5373361e5cffb03df7b8e86ef103a3b7770b2b4fe39fbca00b128f2b7ec810b3a4d9fd0fd SHA512 26aefbbe9927e90e28f271e56d2ba876611831222d0e1e1a58bdb75bbd50934fcd84418a4fe47b845f557e60a9786a72a4de2676c930447b104f2256aca7a54f
-DIST nettle-3.5.1.tar.gz 1989593 BLAKE2B 40e527a4cc541674acc39072f2ebbab4b6ed1b043687d88c776ce9c58374538b111d282e0eea5424059260b0876c5cf01f97470c850e082c167b05a57e6c591a SHA512 f738121b9091cbe79435fb5d46b45cf6f10912320c233829356908127bab1cac6946ca56e022a832380c44f2c10f21d2feef64cb0f4f41e3da4a681dc0131784
DIST nettle-3.6.tar.gz 2288173 BLAKE2B 45e08832e9c337f10d958956545c77f521b747b8abca56ce40c755adf352bdc2a79584b1e1c0e50f5ede0ac54794aabd6883601c53593b965aada744502789db SHA512 2471af875e51327af61af8bda53cd9c3adc27b6e32592a4b5b10b3ec60999ebf771ab9c54c747b0bade4b3b5a717e77fdbdb53699dd9e8a9ed4eee07f46aed51
DIST nettle-3.7.tar.gz 2375067 BLAKE2B 1e8a77db9b7e62dee9a01e3c3b476e206f36cc7235153b0a1a762276650c61d7c4c3be73b2ecae9313313e416e3c7a2bd999a3505c41b26e806f9b3eb486550f SHA512 be32eff0ea3c83abb8b6670d049a8ce21ea9c7cac3e1a5d41ae003d5160e2683572c7dd8930b869ac1db0b89f9423605e0a8ec0cff074c63e2a60c71996ef66c
diff --git a/dev-libs/nettle/files/nettle-3.4.1-build.patch b/dev-libs/nettle/files/nettle-3.4.1-build.patch
deleted file mode 100644
index 4351dfeb5bc..00000000000
--- a/dev-libs/nettle/files/nettle-3.4.1-build.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From f5a3a224bf00bef5669366d2ae23c2b2b13b8016 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se>
-Date: Wed, 26 Dec 2018 11:04:31 +0100
-Subject: [PATCH] Fix accidental use of C99 for loop.
-
-* rsa-sign-tr.c (sec_equal): Fix accidental use of C99 for loop.
-Reported by Andreas Gustafsson.
-* testsuite/rsa-sec-decrypt-test.c (test_main): Likewise.
----
- ChangeLog | 6 ++++++
- rsa-sign-tr.c | 3 ++-
- testsuite/rsa-sec-decrypt-test.c | 3 ++-
- 3 files changed, 10 insertions(+), 2 deletions(-)
-
-diff --git a/rsa-sign-tr.c b/rsa-sign-tr.c
-index 59c9bd07..f824c4ca 100644
---- a/rsa-sign-tr.c
-+++ b/rsa-sign-tr.c
-@@ -239,8 +239,9 @@ static int
- sec_equal(const mp_limb_t *a, const mp_limb_t *b, size_t limbs)
- {
- volatile mp_limb_t z = 0;
-+ size_t i;
-
-- for (size_t i = 0; i < limbs; i++)
-+ for (i = 0; i < limbs; i++)
- {
- z |= (a[i] ^ b[i]);
- }
-diff --git a/testsuite/rsa-sec-decrypt-test.c b/testsuite/rsa-sec-decrypt-test.c
-index 64f0b13c..fb0ed3a1 100644
---- a/testsuite/rsa-sec-decrypt-test.c
-+++ b/testsuite/rsa-sec-decrypt-test.c
-@@ -68,6 +68,7 @@ test_main(void)
- unsigned n_size = 1024;
- mpz_t gibberish;
- mpz_t garbage;
-+ size_t size;
-
- rsa_private_key_init(&key);
- rsa_public_key_init(&pub);
-@@ -78,7 +79,7 @@ test_main(void)
-
- memset(verifybad, 'A', PAYLOAD_SIZE);
-
-- for (size_t size = 1; size < 51; size++)
-+ for (size = 1; size < 51; size++)
- {
- ASSERT (rsa_generate_keypair(&pub, &key, &random_ctx,
- (nettle_random_func *) knuth_lfib_random,
---
-2.18.1
-
diff --git a/dev-libs/nettle/nettle-3.4.1.ebuild b/dev-libs/nettle/nettle-3.4.1.ebuild
deleted file mode 100644
index bb7dcdf6c2a..00000000000
--- a/dev-libs/nettle/nettle-3.4.1.ebuild
+++ /dev/null
@@ -1,67 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit autotools multilib-build multilib-minimal multilib toolchain-funcs
-
-DESCRIPTION="Low-level cryptographic library"
-HOMEPAGE="http://www.lysator.liu.se/~nisse/nettle/"
-SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
-
-LICENSE="|| ( LGPL-3 LGPL-2.1 )"
-SLOT="0/6.2" # subslot = libnettle soname version, .2 as broke ABI bug#601512 then fixed
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="doc +gmp neon static-libs test cpu_flags_x86_aes"
-RESTRICT="!test? ( test )"
-
-DEPEND="gmp? ( >=dev-libs/gmp-6.0:0=[static-libs?,${MULTILIB_USEDEP}] )"
-RDEPEND="${DEPEND}"
-
-MULTILIB_WRAPPED_HEADERS=(
- /usr/include/nettle/nettle-stdint.h
- /usr/include/nettle/version.h
-)
-
-DOCS=()
-HTML_DOCS=()
-
-PATCHES=(
- "${FILESDIR}/${P}-build.patch"
-)
-
-pkg_setup() {
- use doc && DOCS+=(
- nettle.pdf
- )
- use doc && HTML_DOCS+=(
- nettle.html
- )
-}
-
-src_prepare() {
- default
-
- sed -e '/CFLAGS=/s: -ggdb3::' \
- -e 's/solaris\*)/sunldsolaris*)/' \
- -i configure.ac || die
-
- # conditionally build tests and examples required by tests
- use test || sed -i '/SUBDIRS/s/testsuite examples//' Makefile.in || die
-
- eautoreconf
-}
-
-multilib_src_configure() {
- # --disable-openssl bug #427526
- ECONF_SOURCE="${S}" econf \
- --libdir="${EPREFIX}"/usr/$(get_libdir) \
- --disable-openssl \
- --disable-fat \
- $(use_enable gmp public-key) \
- $(use_enable static-libs static) \
- $(tc-is-static-only && echo --disable-shared) \
- $(use_enable doc documentation) \
- $(use_enable neon arm-neon) \
- $(use_enable cpu_flags_x86_aes x86-aesni)
-}
diff --git a/dev-libs/nettle/nettle-3.5.1-r1.ebuild b/dev-libs/nettle/nettle-3.5.1-r1.ebuild
deleted file mode 100644
index acb10fbbe9a..00000000000
--- a/dev-libs/nettle/nettle-3.5.1-r1.ebuild
+++ /dev/null
@@ -1,63 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit autotools multilib-build multilib-minimal multilib toolchain-funcs
-
-DESCRIPTION="Low-level cryptographic library"
-HOMEPAGE="http://www.lysator.liu.se/~nisse/nettle/"
-SRC_URI="mirror://gnu/${PN}/${P}.tar.gz"
-
-LICENSE="|| ( LGPL-3 LGPL-2.1 )"
-SLOT="0/7" # subslot = libnettle soname version
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
-IUSE="+asm doc +gmp static-libs test cpu_flags_x86_aes cpu_flags_arm_neon cpu_flags_x86_sha"
-RESTRICT="!test? ( test )"
-
-DEPEND="gmp? ( >=dev-libs/gmp-6.0:0=[static-libs?,${MULTILIB_USEDEP}] )"
-RDEPEND="${DEPEND}"
-
-MULTILIB_WRAPPED_HEADERS=(
- /usr/include/nettle/version.h
-)
-
-DOCS=()
-HTML_DOCS=()
-
-pkg_setup() {
- use doc && DOCS+=(
- nettle.pdf
- )
- use doc && HTML_DOCS+=(
- nettle.html
- )
-}
-
-src_prepare() {
- default
-
- # I do not see in config.sub reference to sunldsolaris.
- # if someone complains readd
- # -e 's/solaris\*)/sunldsolaris*)/' \
- sed -e '/CFLAGS=/s: -ggdb3::' \
- -i configure.ac || die
-
- eautoreconf
-}
-
-multilib_src_configure() {
- # --disable-openssl bug #427526
- ECONF_SOURCE="${S}" econf \
- $(tc-is-static-only && echo --disable-shared) \
- $(use_enable cpu_flags_x86_aes x86-aesni) \
- $(use_enable cpu_flags_x86_sha x86-sha-ni) \
- $(use_enable asm assembler) \
- $(use_enable doc documentation) \
- $(use_enable gmp public-key) \
- $(use_enable cpu_flags_arm_neon arm-neon) \
- $(use_enable static-libs static) \
- --disable-fat \
- --disable-openssl \
- --libdir="${EPREFIX}"/usr/$(get_libdir)
-}
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-01-04 21:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-04 21:09 [gentoo-commits] repo/gentoo:master commit in: dev-libs/nettle/, dev-libs/nettle/files/ Lars Wendler
-- strict thread matches above, loose matches on Subject: below --
2017-07-23 18:09 Alon Bar-Lev
2017-06-14 18:02 Alon Bar-Lev
2016-08-04 19:42 Alon Bar-Lev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox