diff options
Diffstat (limited to 'dev-libs')
-rw-r--r-- | dev-libs/nettle/files/nettle-3.4.1-build.patch | 53 | ||||
-rw-r--r-- | dev-libs/nettle/nettle-3.4.1.ebuild | 4 |
2 files changed, 57 insertions, 0 deletions
diff --git a/dev-libs/nettle/files/nettle-3.4.1-build.patch b/dev-libs/nettle/files/nettle-3.4.1-build.patch new file mode 100644 index 000000000000..4351dfeb5bcb --- /dev/null +++ b/dev-libs/nettle/files/nettle-3.4.1-build.patch @@ -0,0 +1,53 @@ +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 index 6541764cd8bc..2fff9c6d49a1 100644 --- a/dev-libs/nettle/nettle-3.4.1.ebuild +++ b/dev-libs/nettle/nettle-3.4.1.ebuild @@ -25,6 +25,10 @@ MULTILIB_WRAPPED_HEADERS=( DOCS=() HTML_DOCS=() +PATCHES=( + "${FILESDIR}/${P}-build.patch" +) + pkg_setup() { use doc && DOCS+=( nettle.pdf |