[PATCH] lib/crypto: tests: Fix aes_cbc_macs dependency and add to kunitconfig

From: Eric Biggers

Date: Thu Mar 05 2026 - 19:20:35 EST


Update the dependency of CRYPTO_LIB_AES_CBC_MACS_KUNIT_TEST to match the
new convention established by commit 4478e8eeb871 ("lib/crypto: tests:
Depend on library options rather than selecting them"), and add this
test to the kunitconfig file added by commit 20d6f07004d6 ("lib/crypto:
tests: Add a .kunitconfig file").

Signed-off-by: Eric Biggers <ebiggers@xxxxxxxxxx>
---

This is targeting libcrypto-next. This patch is needed because the
aes_cbc_macs test is queued for 7.1 and wasn't handled by the commits
mentioned above which were merged into 7.0.

lib/crypto/.kunitconfig | 3 +++
lib/crypto/tests/Kconfig | 3 +--
2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/crypto/.kunitconfig b/lib/crypto/.kunitconfig
index 6b2ce28ae509..8cfd213bded9 100644
--- a/lib/crypto/.kunitconfig
+++ b/lib/crypto/.kunitconfig
@@ -3,12 +3,14 @@ CONFIG_KUNIT=y
# These kconfig options select all the CONFIG_CRYPTO_LIB_* symbols that have a
# corresponding KUnit test. Those symbols cannot be directly enabled here,
# since they are hidden symbols.
CONFIG_CRYPTO=y
CONFIG_CRYPTO_ADIANTUM=y
+CONFIG_CRYPTO_AES=y
CONFIG_CRYPTO_BLAKE2B=y
CONFIG_CRYPTO_CHACHA20POLY1305=y
+CONFIG_CRYPTO_CMAC=y
CONFIG_CRYPTO_HCTR2=y
CONFIG_CRYPTO_MD5=y
CONFIG_CRYPTO_MLDSA=y
CONFIG_CRYPTO_SHA1=y
CONFIG_CRYPTO_SHA256=y
@@ -18,10 +20,11 @@ CONFIG_INET=y
CONFIG_IPV6=y
CONFIG_NET=y
CONFIG_NETDEVICES=y
CONFIG_WIREGUARD=y

+CONFIG_CRYPTO_LIB_AES_CBC_MACS_KUNIT_TEST=y
CONFIG_CRYPTO_LIB_BLAKE2B_KUNIT_TEST=y
CONFIG_CRYPTO_LIB_BLAKE2S_KUNIT_TEST=y
CONFIG_CRYPTO_LIB_CURVE25519_KUNIT_TEST=y
CONFIG_CRYPTO_LIB_MD5_KUNIT_TEST=y
CONFIG_CRYPTO_LIB_MLDSA_KUNIT_TEST=y
diff --git a/lib/crypto/tests/Kconfig b/lib/crypto/tests/Kconfig
index f6b842cad97e..0d71de3da15d 100644
--- a/lib/crypto/tests/Kconfig
+++ b/lib/crypto/tests/Kconfig
@@ -1,13 +1,12 @@
# SPDX-License-Identifier: GPL-2.0-or-later

config CRYPTO_LIB_AES_CBC_MACS_KUNIT_TEST
tristate "KUnit tests for AES-CMAC, AES-XCBC-MAC, and AES-CBC-MAC" if !KUNIT_ALL_TESTS
- depends on KUNIT
+ depends on KUNIT && CRYPTO_LIB_AES_CBC_MACS
default KUNIT_ALL_TESTS || CRYPTO_SELFTESTS
select CRYPTO_LIB_BENCHMARK_VISIBLE
- select CRYPTO_LIB_AES_CBC_MACS
help
KUnit tests for the AES-CMAC, AES-XCBC-MAC, and AES-CBC-MAC message
authentication codes.

config CRYPTO_LIB_BLAKE2B_KUNIT_TEST

base-commit: 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f