Update to nettle 3.10

Resolves: RHEL-42424
Signed-off-by: Daiki Ueno <dueno@redhat.com>
This commit is contained in:
Daiki Ueno 2024-06-17 09:29:34 +09:00
parent 98695c3783
commit 1df6156b68
4 changed files with 39 additions and 39 deletions

1
.gitignore vendored
View File

@ -21,3 +21,4 @@ nettle-1.15.tar.gz
/nettle-3.8-hobbled.tar.xz
/gmp-6.2.1.tar.xz
/nettle-3.9.1-hobbled.tar.xz
/nettle-3.10-hobbled.tar.xz

View File

@ -18,7 +18,7 @@ for f in gcm-sm4-meta.c gcm-sm4.c sm4-meta.c sm4.c sm4.h testsuite/sm4-test.c; d
done
patch -p1 << '__EOF__'
From 6a729afd5059ba8aff85827e718be54658904ad6 Mon Sep 17 00:00:00 2001
From 4f46c4f64358d19f73ac9ba2f78c39bbffa04a57 Mon Sep 17 00:00:00 2001
From: Daiki Ueno <dueno@redhat.com>
Date: Sun, 21 Mar 2021 11:09:51 +0100
Subject: [PATCH 1/2] Remove secp192r1 and secp224r1 support
@ -29,16 +29,16 @@ Subject: [PATCH 1/2] Remove secp192r1 and secp224r1 support
examples/ecc-benchmark.c | 2 --
examples/hogweed-benchmark.c | 17 ---------
testsuite/ecdh-test.c | 40 ---------------------
testsuite/ecdsa-sign-test.c | 47 ------------------------
testsuite/ecdsa-sign-test.c | 46 ------------------------
testsuite/ecdsa-verify-test.c | 28 ---------------
testsuite/testutils.c | 22 +-----------
8 files changed, 4 insertions(+), 241 deletions(-)
8 files changed, 4 insertions(+), 240 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index f031e195..36587d29 100644
index 2bf7f1e8..8e3df0a0 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -201,7 +201,7 @@ hogweed_SOURCES = sexp.c sexp-format.c \
@@ -204,7 +204,7 @@ hogweed_SOURCES = sexp.c sexp-format.c \
ecc-mod-arith.c ecc-pp1-redc.c ecc-pm1-redc.c \
ecc-curve25519.c ecc-curve448.c \
ecc-gost-gc256b.c ecc-gost-gc512a.c \
@ -47,7 +47,7 @@ index f031e195..36587d29 100644
ecc-secp384r1.c ecc-secp521r1.c \
ecc-size.c ecc-j-to-a.c ecc-a-to-j.c \
ecc-dup-jj.c ecc-add-jja.c ecc-add-jjj.c ecc-nonsec-add-jjj.c \
@@ -354,22 +354,6 @@ des.$(OBJEXT): des.c des.h $(des_headers)
@@ -358,22 +358,6 @@ des.$(OBJEXT): des.c des.h $(des_headers)
# Generate ECC files, with roughly 16 KB of tables per curve.
@ -70,7 +70,7 @@ index f031e195..36587d29 100644
# Some reasonable choices for 256:
# k = 9, c = 6, S = 320, T = 54 ( 45 A + 9 D) 20 KB
# k = 11, c = 6, S = 256, T = 55 ( 44 A + 11 D) 16 KB
@@ -429,8 +413,6 @@ ecc-curve25519.$(OBJEXT): ecc-curve25519.h
@@ -433,8 +417,6 @@ ecc-curve25519.$(OBJEXT): ecc-curve25519.h
ecc-curve448.$(OBJEXT): ecc-curve448.h
ecc-gost-gc256b.$(OBJEXT): ecc-gost-gc256b.h
ecc-gost-gc512a.$(OBJEXT): ecc-gost-gc512a.h
@ -79,7 +79,7 @@ index f031e195..36587d29 100644
ecc-secp256r1.$(OBJEXT): ecc-secp256r1.h
ecc-secp384r1.$(OBJEXT): ecc-secp384r1.h
ecc-secp521r1.$(OBJEXT): ecc-secp521r1.h
@@ -677,7 +659,7 @@ clean-here:
@@ -681,7 +663,7 @@ clean-here:
-rm -f $(TARGETS) *.$(OBJEXT) *.$(OBJEXT).d *.s *.so *.dll *.a \
ecc-curve25519.h ecc-curve448.h \
ecc-gost-gc256b.h ecc-gost-gc512a.h \
@ -180,10 +180,10 @@ index 7e857f80..0bffe7a9 100644
&_nettle_secp_256r1,
&_nettle_secp_384r1,
diff --git a/examples/hogweed-benchmark.c b/examples/hogweed-benchmark.c
index 3d008021..b8cf902c 100644
index 3f858833..44c9cea5 100644
--- a/examples/hogweed-benchmark.c
+++ b/examples/hogweed-benchmark.c
@@ -412,23 +412,6 @@ bench_ecdsa_init (unsigned size)
@@ -410,23 +410,6 @@ bench_ecdsa_init (unsigned size)
switch (size)
{
@ -259,13 +259,13 @@ index ff4f7233..2be26b19 100644
"94731533361265297353914491124013058635674217345912524033267198103710636378786",
"22441589863306126152768848344973918725077248391248404659242620344938484650846",
diff --git a/testsuite/ecdsa-sign-test.c b/testsuite/ecdsa-sign-test.c
index b8a100b6..bc1ab7e3 100644
index 46fc2738..4816de82 100644
--- a/testsuite/ecdsa-sign-test.c
+++ b/testsuite/ecdsa-sign-test.c
@@ -64,19 +64,6 @@ test_ecdsa (const struct ecc_curve *ecc,
void
test_main (void)
{
@@ -74,18 +74,6 @@ test_main (void)
if (test_side_channel)
SKIP();
#endif
- /* Producing the signature for corresponding test in
- ecdsa-verify-test.c, with special u1 and u2. */
- test_ecdsa (&_nettle_secp_224r1,
@ -278,11 +278,10 @@ index b8a100b6..bc1ab7e3 100644
- "d16dc18032d268fd1a704fa6", /* r */
- "3a41e1423b1853e8aa89747b1f987364"
- "44705d6d6d8371ea1f578f2e"); /* s */
-
/* Produce a signature where verify operation results in a point duplication. */
test_ecdsa (&_nettle_secp_256r1,
"1", /* Private key */
@@ -89,40 +76,6 @@ test_main (void)
@@ -99,40 +87,6 @@ test_main (void)
"53f097727a0e0dc284a0daa0da0ab77d"
"5792ae67ed075d1f8d5bda0f853fa093"); /* s */
@ -363,10 +362,10 @@ index 8d527000..eb5449da 100644
point duplication in the verify operation by using private key =
1 (public key = generator) and hash = r. */
diff --git a/testsuite/testutils.c b/testsuite/testutils.c
index 3420ae9d..99c96956 100644
index dcd653c1..b35248b9 100644
--- a/testsuite/testutils.c
+++ b/testsuite/testutils.c
@@ -1915,8 +1915,6 @@ test_dsa_key(const struct dsa_params *params,
@@ -2142,8 +2142,6 @@ test_dsa_key(const struct dsa_params *params,
}
const struct ecc_curve * const ecc_curves[] = {
@ -375,7 +374,7 @@ index 3420ae9d..99c96956 100644
&_nettle_secp_256r1,
&_nettle_secp_384r1,
&_nettle_secp_521r1,
@@ -2040,25 +2038,7 @@ test_ecc_point (const struct ecc_curve *ecc,
@@ -2267,25 +2265,7 @@ test_ecc_point (const struct ecc_curve *ecc,
}
/* For each curve, the points g, 2 g, 3 g and 4 g */
@ -403,10 +402,10 @@ index 3420ae9d..99c96956 100644
"4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5" },
{ "7cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc47669978",
--
2.41.0
2.45.1
From c1b637ce2774065308e6c39639a03449cefe1537 Mon Sep 17 00:00:00 2001
From fda2e8fb058076715763346ae0b5cb4bb3eea5dd Mon Sep 17 00:00:00 2001
From: Daiki Ueno <dueno@redhat.com>
Date: Wed, 1 Nov 2023 09:21:16 +0900
Subject: [PATCH 2/2] Remove SM4 cipher support
@ -425,7 +424,7 @@ Subject: [PATCH 2/2] Remove SM4 cipher support
10 files changed, 2 insertions(+), 54 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index 36587d29..037f3001 100644
index 8e3df0a0..6a762008 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -117,7 +117,6 @@ nettle_SOURCES = aes-decrypt-internal.c aes-decrypt.c aes-decrypt-table.c \
@ -444,17 +443,17 @@ index 36587d29..037f3001 100644
umac-nh.c umac-nh-n.c umac-l2.c umac-l3.c \
umac-poly64.c umac-poly128.c umac-set-key.c \
umac32.c umac64.c umac96.c umac128.c \
@@ -242,7 +240,7 @@ HEADERS = aes.h arcfour.h arctwo.h asn1.h blowfish.h balloon.h \
@@ -245,7 +243,7 @@ HEADERS = aes.h arcfour.h arctwo.h asn1.h blowfish.h balloon.h \
ocb.h pbkdf2.h \
pgp.h pkcs1.h pss.h pss-mgf1.h realloc.h ripemd160.h rsa.h \
salsa20.h sexp.h serpent.h \
- sha.h sha1.h sha2.h sha3.h sm3.h sm4.h streebog.h twofish.h \
+ sha.h sha1.h sha2.h sha3.h sm3.h streebog.h twofish.h \
umac.h yarrow.h xts.h poly1305.h nist-keywrap.h
umac.h yarrow.h xts.h poly1305.h nist-keywrap.h \
drbg-ctr.h
INSTALL_HEADERS = $(HEADERS) version.h @IF_MINI_GMP@ mini-gmp.h
diff --git a/examples/nettle-benchmark.c b/examples/nettle-benchmark.c
index 04c3e0f2..0ac57a0a 100644
index 2a11a694..991d5bee 100644
--- a/examples/nettle-benchmark.c
+++ b/examples/nettle-benchmark.c
@@ -64,7 +64,6 @@
@ -465,7 +464,7 @@ index 04c3e0f2..0ac57a0a 100644
#include "twofish.h"
#include "umac.h"
#include "cmac.h"
@@ -940,7 +939,6 @@ main(int argc, char **argv)
@@ -937,7 +936,6 @@ main(int argc, char **argv)
&nettle_des3,
&nettle_serpent256,
&nettle_twofish128, &nettle_twofish192, &nettle_twofish256,
@ -567,23 +566,23 @@ index 19dc96c5..d684947e 100644
extern const struct nettle_aead nettle_chacha_poly1305;
diff --git a/testsuite/Makefile.in b/testsuite/Makefile.in
index 5c2a0028..b00390df 100644
index 0699fa0d..f5db4bca 100644
--- a/testsuite/Makefile.in
+++ b/testsuite/Makefile.in
@@ -24,7 +24,7 @@ TS_NETTLE_SOURCES = aes-test.c aes-keywrap-test.c arcfour-test.c arctwo-test.c \
sha384-test.c sha512-test.c sha512-224-test.c sha512-256-test.c \
@@ -25,7 +25,7 @@ TS_NETTLE_SOURCES = aes-test.c aes-keywrap-test.c arcfour-test.c arctwo-test.c \
sha3-permute-test.c sha3-224-test.c sha3-256-test.c \
sha3-384-test.c sha3-512-test.c \
- shake256-test.c streebog-test.c sm3-test.c sm4-test.c \
+ shake256-test.c streebog-test.c sm3-test.c \
shake128-test.c shake256-test.c \
- streebog-test.c sm3-test.c sm4-test.c \
+ streebog-test.c sm3-test.c \
serpent-test.c twofish-test.c version-test.c \
knuth-lfib-test.c \
cbc-test.c cfb-test.c ctr-test.c gcm-test.c eax-test.c ccm-test.c \
diff --git a/testsuite/gcm-test.c b/testsuite/gcm-test.c
index bc555d60..156381ad 100644
index e8228ed7..e0501963 100644
--- a/testsuite/gcm-test.c
+++ b/testsuite/gcm-test.c
@@ -592,24 +592,6 @@ test_main(void)
@@ -825,24 +825,6 @@ test_main(void)
"16aedbf5a0de6a57 a637b39b"), /* iv */
SHEX("5791883f822013f8bd136fc36fb9946b")); /* tag */
@ -633,6 +632,6 @@ index 912fac5a..046fbdaf 100644
void
--
2.41.0
2.45.1
__EOF__

View File

@ -25,7 +25,7 @@
%endif
Name: nettle
Version: 3.9.1
Version: 3.10
Release: %{?autorelease}%{!?autorelease:1%{?dist}}
Summary: A low-level cryptographic library

View File

@ -1,2 +1,2 @@
SHA512 (gmp-6.2.1.tar.xz) = c99be0950a1d05a0297d65641dd35b75b74466f7bf03c9e8a99895a3b2f9a0856cd17887738fa51cf7499781b65c049769271cbcb77d057d2e9f1ec52e07dd84
SHA512 (nettle-3.9.1-hobbled.tar.xz) = 8e79b2c7ec0da17ce7eddb9c10c35d0a7bd0d17f978103499536c276e7824d6b938d877616a9cc808b7f001741d8a1a08f2130a8f21136909c42fb84fb303a6a
SHA512 (nettle-3.10-hobbled.tar.xz) = 5f2bba913e8ac9c3bef91e59cb7784f609ee6a4549157503583441770fb57782530391906c271316936297ccd691174578a9a584b4a374dfc6214c206b020cb2