linux/lib/crypto
Eric Biggers e073f1238e crypto: aes - Fix conditions for selecting MAC dependencies
Starting in commit 7137cbf2b5 ("crypto: aes - Add cmac, xcbc, and
cbcmac algorithms using library"), the aes module (CRYPTO_AES) supports
CBC based MACs using the corresponding library functions.

To avoid including unneeded functionality, that support honors the
existing CRYPTO_CMAC, CRYPTO_XCBC, and CRYPTO_CCM kconfig options.  The
dependencies are selected if at least one of those is enabled.

However, the select statements don't correctly handle the case where
CRYPTO_AES=y and (for example) CRYPTO_CMAC=m.  In that case the
dependencies get selected at level 'm', due to how the kconfig language
works.  That causes a linker error.

Fix this by changing the selection conditions to use '!= n'.

A similar issue also exists for CRYPTO_LIB_AES's conditional selection
of CRYPTO_LIB_UTILS.  The same '!= n' would work, but instead just make
CRYPTO_LIB_AES always select CRYPTO_LIB_UTILS.  CRYPTO_LIB_UTILS is
lightweight, and it's needed by most AES modes and many other things.

Fixes: 7137cbf2b5 ("crypto: aes - Add cmac, xcbc, and cbcmac algorithms using library")
Fixes: 309a7e514d ("lib/crypto: aes: Add support for CBC-based MACs")
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260709022954.45113-1-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
2026-07-09 11:06:22 -04:00
..
arm lib/crypto: arm/ghash: Migrate optimized code into library 2026-03-23 15:24:54 -07:00
arm64 lib/crypto: arm64: Assume a little-endian kernel 2026-04-01 13:02:15 -07:00
mips lib/crypto: mips: Drop optimized MD5 code 2026-03-30 12:35:05 -07:00
mpi Crypto library fix and documentation update for 7.1 2026-04-21 11:46:22 -07:00
powerpc lib/crypto: powerpc/md5: Drop powerpc optimized MD5 code 2026-05-09 11:41:01 -07:00
riscv lib/crypto: riscv/sm3: Migrate optimized code into library 2026-03-23 17:50:59 -07:00
s390 lib/crypto: s390/ghash: Migrate optimized code into library 2026-03-23 16:44:29 -07:00
sparc lib/crypto: sparc: Drop optimized MD5 code 2026-03-30 12:35:16 -07:00
tests lib/crypto: tests: Migrate ChaCha20Poly1305 self-test to KUnit 2026-03-30 12:35:30 -07:00
x86 lib/crypto: x86/sm3: Migrate optimized code into library 2026-03-23 17:50:59 -07:00
.kunitconfig lib/crypto: tests: Migrate ChaCha20Poly1305 self-test to KUnit 2026-03-30 12:35:30 -07:00
aes.c lib/crypto: aes: Add FIPS self-test for CMAC 2026-03-09 13:27:20 -07:00
aescfb.c lib/crypto: Include <crypto/utils.h> instead of <crypto/algapi.h> 2026-03-31 17:19:31 -07:00
aesgcm.c lib/crypto: aesgcm: Don't disable IRQs during AES block encryption 2026-03-31 17:19:22 -07:00
arc4.c lib/crypto: Explicitly include <linux/export.h> 2025-06-30 09:26:19 -07:00
blake2b.c lib/crypto: blake2b: Roll up BLAKE2b round loop on 32-bit 2025-12-09 15:10:21 -08:00
blake2s.c lib/crypto: blake2s: Replace manual unrolling with unrolled_full 2025-12-09 15:10:21 -08:00
chacha-block-generic.c lib/crypto: chacha: Zeroize permuted_state before it leaves scope 2026-03-27 13:35:35 -07:00
chacha.c lib/crypto: Include <crypto/utils.h> instead of <crypto/algapi.h> 2026-03-31 17:19:31 -07:00
chacha20poly1305.c lib/crypto: tests: Migrate ChaCha20Poly1305 self-test to KUnit 2026-03-30 12:35:30 -07:00
curve25519-fiat32.c
curve25519-hacl64.c
curve25519.c lib/crypto: curve25519: Consolidate into single module 2025-09-06 16:32:43 -07:00
des.c lib/crypto: Explicitly include <linux/export.h> 2025-06-30 09:26:19 -07:00
fips-mldsa.h lib/crypto: mldsa: Add FIPS cryptographic algorithm self-test 2026-01-12 11:07:50 -08:00
fips.h lib/crypto: aes: Add FIPS self-test for CMAC 2026-03-09 13:27:20 -07:00
gf128hash.c lib/crypto: gf128hash: mark clmul32() as noinline_for_stack 2026-06-11 12:57:49 -07:00
gf128mul.c lib/crypto: gf128mul: Remove unused 4k_lle functions 2026-03-23 16:44:30 -07:00
hash_info.c lib/crypto: hash_info: Move hash_info.c into lib/crypto/ 2025-07-08 12:03:44 -07:00
Kconfig crypto: aes - Fix conditions for selecting MAC dependencies 2026-07-09 11:06:22 -04:00
Makefile lib/crypto: powerpc/md5: Drop powerpc optimized MD5 code 2026-05-09 11:41:01 -07:00
md5.c lib/crypto: md5: Remove support for md5_mod_init_arch() 2026-07-05 12:48:50 -07:00
memneq.c lib/crypto: Include <crypto/utils.h> instead of <crypto/algapi.h> 2026-03-31 17:19:31 -07:00
mldsa.c lib/crypto: mldsa: Clarify the documentation for mldsa_verify() slightly 2026-02-03 19:28:51 -08:00
nh.c lib/crypto: nh: Add NH library 2026-01-12 11:07:49 -08:00
poly1305-donna32.c lib/crypto: Explicitly include <linux/export.h> 2025-06-30 09:26:19 -07:00
poly1305-donna64.c lib/crypto: Explicitly include <linux/export.h> 2025-06-30 09:26:19 -07:00
poly1305.c lib/crypto: poly1305: Consolidate into single module 2025-08-29 09:49:18 -07:00
sha1.c lib/crypto: sha1: Remove low-level functions from API 2026-01-27 15:47:41 -08:00
sha3.c lib/crypto: sha3: Support arch overrides of one-shot digest functions 2025-11-05 20:02:35 -08:00
sha256.c lib/crypto: Add FIPS self-tests for SHA-1 and SHA-2 2025-10-29 22:04:24 -07:00
sha512.c lib/crypto: Add FIPS self-tests for SHA-1 and SHA-2 2025-10-29 22:04:24 -07:00
simd.c
sm3.c crypto: sm3 - Remove the original "sm3_block_generic()" 2026-03-23 17:50:59 -07:00
utils.c lib/crypto: Explicitly include <linux/export.h> 2025-06-30 09:26:19 -07:00