crypto: cryptomgr - Select algorithm types only when CRYPTO_SELFTESTS

Enabling any template selects CRYPTO_MANAGER, which causes
CRYPTO_MANAGER2 to enable itself, which selects every algorithm type
option.  However, pulling in all algorithm types is needed only when the
self-tests are enabled.  So condition the selections accordingly.

To make this possible, also add the missing selections to various
symbols that were relying on transitive selections via CRYPTO_MANAGER.

Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Eric Biggers
2026-03-27 16:08:18 -07:00
committed by Herbert Xu
parent 51d0f5020d
commit cdadc14359
4 changed files with 23 additions and 8 deletions

View File

@@ -153,19 +153,20 @@ config CRYPTO_MANAGER
config CRYPTO_MANAGER2
def_tristate CRYPTO_MANAGER || (CRYPTO_MANAGER!=n && CRYPTO_ALGAPI=y)
select CRYPTO_ACOMP2
select CRYPTO_AEAD2
select CRYPTO_AKCIPHER2
select CRYPTO_SIG2
select CRYPTO_HASH2
select CRYPTO_KPP2
select CRYPTO_RNG2
select CRYPTO_SKCIPHER2
select CRYPTO_ACOMP2 if CRYPTO_SELFTESTS
select CRYPTO_AEAD2 if CRYPTO_SELFTESTS
select CRYPTO_AKCIPHER2 if CRYPTO_SELFTESTS
select CRYPTO_SIG2 if CRYPTO_SELFTESTS
select CRYPTO_HASH2 if CRYPTO_SELFTESTS
select CRYPTO_KPP2 if CRYPTO_SELFTESTS
select CRYPTO_RNG2 if CRYPTO_SELFTESTS
select CRYPTO_SKCIPHER2 if CRYPTO_SELFTESTS
config CRYPTO_USER
tristate "Userspace cryptographic algorithm configuration"
depends on NET
select CRYPTO_MANAGER
select CRYPTO_RNG
help
Userspace configuration for cryptographic instantiations such as
cbc(aes).
@@ -220,6 +221,7 @@ config CRYPTO_PCRYPT
config CRYPTO_CRYPTD
tristate "Software async crypto daemon"
select CRYPTO_AEAD
select CRYPTO_SKCIPHER
select CRYPTO_HASH
select CRYPTO_MANAGER
@@ -253,7 +255,10 @@ config CRYPTO_KRB5ENC
config CRYPTO_BENCHMARK
tristate "Crypto benchmarking module"
depends on m || EXPERT
select CRYPTO_AEAD
select CRYPTO_HASH
select CRYPTO_MANAGER
select CRYPTO_SKCIPHER
help
Quick & dirty crypto benchmarking module.
@@ -263,10 +268,16 @@ config CRYPTO_BENCHMARK
config CRYPTO_SIMD
tristate
select CRYPTO_AEAD
select CRYPTO_CRYPTD
config CRYPTO_ENGINE
tristate
select CRYPTO_AEAD
select CRYPTO_AKCIPHER
select CRYPTO_HASH
select CRYPTO_KPP
select CRYPTO_SKCIPHER
endmenu

View File

@@ -301,6 +301,7 @@ config CRYPTO_DEV_PPC4XX
select CRYPTO_CCM
select CRYPTO_CTR
select CRYPTO_GCM
select CRYPTO_RNG
select CRYPTO_SKCIPHER
help
This option allows you to have support for AMCC crypto acceleration.

View File

@@ -14,6 +14,7 @@ config CRYPTO_DEV_SUN4I_SS
select CRYPTO_SHA1
select CRYPTO_AES
select CRYPTO_LIB_DES
select CRYPTO_RNG
select CRYPTO_SKCIPHER
help
Some Allwinner SoC have a crypto accelerator named
@@ -49,6 +50,7 @@ config CRYPTO_DEV_SUN8I_CE
select CRYPTO_CBC
select CRYPTO_AES
select CRYPTO_DES
select CRYPTO_RNG
depends on CRYPTO_DEV_ALLWINNER
depends on PM
help

View File

@@ -1,6 +1,7 @@
# SPDX-License-Identifier: GPL-2.0-only
config CRYPTO_DEV_QAT
tristate
select CRYPTO_ACOMP
select CRYPTO_AEAD
select CRYPTO_AUTHENC
select CRYPTO_SKCIPHER