]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
nettle: remove check for nettle_cbc_aes128_encrypt
authorDaiki Ueno <ueno@gnu.org>
Tue, 3 Mar 2026 01:25:57 +0000 (10:25 +0900)
committerDaiki Ueno <ueno@gnu.org>
Wed, 4 Mar 2026 11:49:58 +0000 (20:49 +0900)
nettle_cbc_aes128_encrypt was added in Nettle 3.8, while we require
3.10 or later. We can use the function unconditionally.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
configure.ac
lib/nettle/cipher.c

index 0339bcdcba6ee1ab213099b1130231417d818b32..3307b04731c1468f73e32e5a539a3fd00ab7efb4 100644 (file)
@@ -828,12 +828,6 @@ LIBS="$LIBS $NETTLE_LIBS"
 AC_CHECK_FUNCS(nettle_cmac_kuznyechik_update)
 LIBS=$save_LIBS
 
-# Check for specialized AES-CBC encryption
-save_LIBS=$LIBS
-LIBS="$LIBS $NETTLE_LIBS"
-AC_CHECK_FUNCS(nettle_cbc_aes128_encrypt)
-LIBS=$save_LIBS
-
 # Check sonames of the linked libraries needed for FIPS selftests.
 save_CFLAGS=$CFLAGS
 CFLAGS="$CFLAGS $GMP_CFLAGS"
index 86d1aea10a1ed6061e83b3914a4a5cf76aa6d874..da583c5f6d57f687614e2397532f607b3e8b5046 100644 (file)
@@ -498,8 +498,6 @@ static void _xts_aes256_decrypt(struct nettle_cipher_ctx *ctx, size_t length,
        xts_aes256_decrypt_message(ctx->ctx_ptr, ctx->iv, length, dst, src);
 }
 
-#ifdef HAVE_NETTLE_CBC_AES128_ENCRYPT
-
 static void _cbc_aes128_encrypt(struct nettle_cipher_ctx *ctx, size_t length,
                                uint8_t *dst, const uint8_t *src)
 {
@@ -521,8 +519,6 @@ static void _cbc_aes256_encrypt(struct nettle_cipher_ctx *ctx, size_t length,
        cbc_aes256_encrypt(ctx->ctx_ptr, ctx->iv, length, dst, src);
 }
 
-#endif /* HAVE_NETTLE_CBC_AES128_ENCRYPT */
-
 static const struct nettle_cipher_st builtin_ciphers[] = {
        {
                .algo = GNUTLS_CIPHER_AES_128_GCM,
@@ -681,11 +677,7 @@ static const struct nettle_cipher_st builtin_ciphers[] = {
 
                .ctx_size = sizeof(
                        struct CBC_CTX(struct aes128_ctx, AES_BLOCK_SIZE)),
-#ifdef HAVE_NETTLE_CBC_AES128_ENCRYPT
                .encrypt = _cbc_aes128_encrypt,
-#else
-               .encrypt = _cbc_encrypt,
-#endif
                .decrypt = _cbc_decrypt,
                .set_encrypt_key =
                        (nettle_set_key_func *)aes128_set_encrypt_key,
@@ -702,11 +694,7 @@ static const struct nettle_cipher_st builtin_ciphers[] = {
 
                .ctx_size = sizeof(
                        struct CBC_CTX(struct aes192_ctx, AES_BLOCK_SIZE)),
-#ifdef HAVE_NETTLE_CBC_AES128_ENCRYPT
                .encrypt = _cbc_aes192_encrypt,
-#else
-               .encrypt = _cbc_encrypt,
-#endif
                .decrypt = _cbc_decrypt,
                .set_encrypt_key =
                        (nettle_set_key_func *)aes192_set_encrypt_key,
@@ -723,11 +711,7 @@ static const struct nettle_cipher_st builtin_ciphers[] = {
 
                .ctx_size = sizeof(
                        struct CBC_CTX(struct aes256_ctx, AES_BLOCK_SIZE)),
-#ifdef HAVE_NETTLE_CBC_AES128_ENCRYPT
                .encrypt = _cbc_aes256_encrypt,
-#else
-               .encrypt = _cbc_encrypt,
-#endif
                .decrypt = _cbc_decrypt,
                .set_encrypt_key =
                        (nettle_set_key_func *)aes256_set_encrypt_key,