]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
nettle: remove bundled code for RSA-OAEP
authorDaiki Ueno <ueno@gnu.org>
Tue, 3 Mar 2026 01:21:07 +0000 (10:21 +0900)
committerDaiki Ueno <ueno@gnu.org>
Wed, 4 Mar 2026 11:49:58 +0000 (20:49 +0900)
Now that Nettle 3.10 is required to build the library, the bundled
code is no longer used.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
configure.ac
devel/import-from-nettle.sh
lib/nettle/Makefile.am
lib/nettle/int/rsa-oaep.h [deleted file]
lib/nettle/pk.c

index d30f975e186caa6ef8ad3f2e7ec5343bc6c2589b..10dd171e8f473bb68c20ff20fc9715413e6cc719 100644 (file)
@@ -828,13 +828,6 @@ LIBS="$LIBS $NETTLE_LIBS"
 AC_CHECK_FUNCS(nettle_cmac_kuznyechik_update)
 LIBS=$save_LIBS
 
-# Check for RSA-OAEP
-save_LIBS=$LIBS
-LIBS="$LIBS $HOGWEED_LIBS $NETTLE_LIBS $GMP_LIBS"
-AC_CHECK_FUNCS(nettle_rsa_oaep_sha256_encrypt)
-LIBS=$save_LIBS
-AM_CONDITIONAL([NEED_RSA_OAEP], [test "$ac_cv_func_nettle_rsa_oaep_sha256_encrypt" != yes])
-
 # Check for specialized AES-CBC encryption
 save_LIBS=$LIBS
 LIBS="$LIBS $NETTLE_LIBS"
index 96805214fbd43b08bb0882d9b1129979f5c5463d..a7c44e3a29f4bfe4ac093e802d7c73b0e2bc7724 100755 (executable)
@@ -11,19 +11,8 @@ DST=$srcdir/lib/nettle/backport
 
 IMPORTS="
 block-internal.h
-gmp-glue.c
-gmp-glue.h
 md-internal.h
 nettle-write.h
-oaep.c
-oaep.h
-pss-mgf1.h
-pss-mgf1.c
-rsa-internal.h
-rsa-oaep-encrypt.c
-rsa-oaep-decrypt.c
-rsa-sec-compute-root.c
-rsa-sign-tr.c
 sha3.c
 sha3-internal.h
 sha3-shake.c
@@ -43,7 +32,6 @@ memops.h
 memxor.h
 nettle-meta.h
 nettle-types.h
-rsa.h
 sha1.h
 sha2.h
 sha3.h
@@ -101,24 +89,6 @@ for f in $IMPORTS; do
        sed \
          -e '/^#include <nettle\/nettle-types\.h>/a\
 #include "block8.h"
-' \
-         $dst > $dst-t && mv $dst-t $dst
-       ;;
-    esac
-    case $dst in
-      */rsa-sign-tr.c)
-       sed \
-         -e '/^#include <nettle\/rsa\.h>/i\
-#define nettle_rsa_compute_root_tr _gnutls_nettle_backport_rsa_compute_root_tr\
-' \
-         $dst > $dst-t && mv $dst-t $dst
-       ;;
-    esac
-    case $dst in
-      */rsa-oaep-*.c)
-       sed \
-         -e '/^#include <nettle\/rsa\.h>/a\
-#include "int/rsa-oaep.h"
 ' \
          $dst > $dst-t && mv $dst-t $dst
        ;;
index 213458f2414114feb26d6764a6c341207697ab1c..86903dee33aceccf908336cda596d3bced0d3dbe 100644 (file)
@@ -51,7 +51,7 @@ libcrypto_la_SOURCES = pk.c mpi.c mac.c cipher.c init.c \
        int/ecdsa-compute-k.c int/ecdsa-compute-k.h \
        int/mpn-base256.c int/mpn-base256.h \
        int/block8.h backport/block-internal.h \
-       int/rsa-oaep.h int/rsa-pad.c int/nettle-internal.h int/sha3-shake.h
+       int/rsa-pad.c int/nettle-internal.h int/sha3-shake.h
 
 if WINDOWS
 if HAVE_BCRYPT
@@ -100,22 +100,6 @@ libcrypto_la_SOURCES += \
        gost/cmac.h gost/cmac-magma.c gost/cmac-kuznyechik.c
 endif
 
-if NEED_RSA_OAEP
-libcrypto_la_SOURCES += \
-       backport/gmp-glue.c \
-       backport/gmp-glue.h \
-       backport/oaep.c \
-       backport/oaep.h \
-       backport/pss-mgf1.c \
-       backport/pss-mgf1.h \
-       backport/rsa-internal.h \
-       backport/rsa-oaep-encrypt.c \
-       backport/rsa-oaep-decrypt.c \
-       backport/rsa-sec-compute-root.c \
-       backport/rsa-sign-tr.c \
-       $(NULL)
-endif
-
 if NEED_SHAKE_OUTPUT
 libcrypto_la_SOURCES += \
        backport/md-internal.h \
diff --git a/lib/nettle/int/rsa-oaep.h b/lib/nettle/int/rsa-oaep.h
deleted file mode 100644 (file)
index cfdb30e..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/* rsa.h
-
-   The RSA publickey algorithm.
-
-   Copyright (C) 2001, 2002 Niels Möller
-
-   This file is part of GNU Nettle.
-
-   GNU Nettle is free software: you can redistribute it and/or
-   modify it under the terms of either:
-
-     * the GNU Lesser General Public License as published by the Free
-       Software Foundation; either version 3 of the License, or (at your
-       option) any later version.
-
-   or
-
-     * the GNU General Public License as published by the Free
-       Software Foundation; either version 2 of the License, or (at your
-       option) any later version.
-
-   or both in parallel, as here.
-
-   GNU Nettle is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   You should have received copies of the GNU General Public License and
-   the GNU Lesser General Public License along with this program.  If
-   not, see http://www.gnu.org/licenses/.
-*/
-
-#ifndef GNUTLS_LIB_NETTLE_INT_RSA_OAEP_H_INCLUDED
-#define GNUTLS_LIB_NETTLE_INT_RSA_OAEP_H_INCLUDED
-
-#include <nettle/nettle-types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Name mangling */
-#define rsa_oaep_sha256_encrypt gnutls_nettle_backport_rsa_oaep_sha256_encrypt
-#define rsa_oaep_sha256_decrypt gnutls_nettle_backport_rsa_oaep_sha256_decrypt
-#define rsa_oaep_sha384_encrypt gnutls_nettle_backport_rsa_oaep_sha384_encrypt
-#define rsa_oaep_sha384_decrypt gnutls_nettle_backport_rsa_oaep_sha384_decrypt
-#define rsa_oaep_sha512_encrypt gnutls_nettle_backport_rsa_oaep_sha512_encrypt
-#define rsa_oaep_sha512_decrypt gnutls_nettle_backport_rsa_oaep_sha512_decrypt
-
-/* RSA encryption, using OAEP */
-
-int rsa_oaep_sha256_encrypt(const struct rsa_public_key *key, void *random_ctx,
-                           nettle_random_func *random, size_t label_length,
-                           const uint8_t *label, size_t length,
-                           const uint8_t *message, uint8_t *ciphertext);
-
-int rsa_oaep_sha256_decrypt(const struct rsa_public_key *pub,
-                           const struct rsa_private_key *key, void *random_ctx,
-                           nettle_random_func *random, size_t label_length,
-                           const uint8_t *label, size_t *length,
-                           uint8_t *message, const uint8_t *ciphertext);
-
-int rsa_oaep_sha384_encrypt(const struct rsa_public_key *key, void *random_ctx,
-                           nettle_random_func *random, size_t label_length,
-                           const uint8_t *label, size_t length,
-                           const uint8_t *message, uint8_t *ciphertext);
-
-int rsa_oaep_sha384_decrypt(const struct rsa_public_key *pub,
-                           const struct rsa_private_key *key, void *random_ctx,
-                           nettle_random_func *random, size_t label_length,
-                           const uint8_t *label, size_t *length,
-                           uint8_t *message, const uint8_t *ciphertext);
-
-int rsa_oaep_sha512_encrypt(const struct rsa_public_key *key, void *random_ctx,
-                           nettle_random_func *random, size_t label_length,
-                           const uint8_t *label, size_t length,
-                           const uint8_t *message, uint8_t *ciphertext);
-
-int rsa_oaep_sha512_decrypt(const struct rsa_public_key *pub,
-                           const struct rsa_private_key *key, void *random_ctx,
-                           nettle_random_func *random, size_t label_length,
-                           const uint8_t *label, size_t *length,
-                           uint8_t *message, const uint8_t *ciphertext);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* GNUTLS_LIB_NETTLE_INT_RSA_OAEP_H_INCLUDED */
index 1cd19241c30b7f05e1c43fd097b2181db3292a17..8a92cbc4aea47b3c1eb323dfe4ab68fc746c1525 100644 (file)
@@ -42,9 +42,6 @@
 #include "dsa-fips.h"
 #include "rsa-fips.h"
 #include <nettle/rsa.h>
-#ifndef HAVE_NETTLE_RSA_OAEP_SHA256_ENCRYPT
-#include "int/rsa-oaep.h"
-#endif
 #include <gnutls/crypto.h>
 #include <nettle/bignum.h>
 #include <nettle/ecc.h>