From: Eric Biggers <ebiggers@kernel.org>
To: linux-crypto@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH v2 9/9] crypto: testmgr - enable CRYPTO_MANAGER when CRYPTO_SELFTESTS
Date: Tue, 22 Apr 2025 08:21:51 -0700 [thread overview]
Message-ID: <20250422152151.3691-10-ebiggers@kernel.org> (raw)
In-Reply-To: <20250422152151.3691-1-ebiggers@kernel.org>
From: Eric Biggers <ebiggers@google.com>
crypto/testmgr.c is compiled only when CRYPTO_MANAGER is enabled. To
make CRYPTO_SELFTESTS work as expected when CRYPTO_MANAGER doesn't get
enabled for another reason, automatically set CRYPTO_MANAGER to the
value of CRYPTO_ALGAPI when CRYPTO_SELFTESTS is enabled.
Signed-off-by: Eric Biggers <ebiggers@google.com>
---
crypto/Kconfig | 5 +++--
crypto/algapi.c | 3 +--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/crypto/Kconfig b/crypto/Kconfig
index fa354b54d09b1..0577cfb942fb0 100644
--- a/crypto/Kconfig
+++ b/crypto/Kconfig
@@ -147,14 +147,15 @@ config CRYPTO_HKDF
select CRYPTO_SHA512 if CRYPTO_SELFTESTS
select CRYPTO_HASH2
config CRYPTO_MANAGER
tristate
+ default CRYPTO_ALGAPI if CRYPTO_SELFTESTS
select CRYPTO_MANAGER2
help
- Create default cryptographic template instantiations such as
- cbc(aes).
+ This provides the support for instantiating templates such as
+ cbc(aes), and the support for the crypto self-tests.
config CRYPTO_MANAGER2
def_tristate CRYPTO_MANAGER || (CRYPTO_MANAGER!=n && CRYPTO_ALGAPI=y)
select CRYPTO_ACOMP2
select CRYPTO_AEAD2
diff --git a/crypto/algapi.c b/crypto/algapi.c
index 9030a30c89e84..25b5519e3b711 100644
--- a/crypto/algapi.c
+++ b/crypto/algapi.c
@@ -272,12 +272,11 @@ static void crypto_alg_finish_registration(struct crypto_alg *alg,
static struct crypto_larval *crypto_alloc_test_larval(struct crypto_alg *alg)
{
struct crypto_larval *larval;
- if (!IS_ENABLED(CONFIG_CRYPTO_MANAGER) ||
- !IS_ENABLED(CONFIG_CRYPTO_SELFTESTS) ||
+ if (!IS_ENABLED(CONFIG_CRYPTO_SELFTESTS) ||
(alg->cra_flags & CRYPTO_ALG_INTERNAL))
return NULL; /* No self-test needed */
larval = crypto_larval_alloc(alg->cra_name,
alg->cra_flags | CRYPTO_ALG_TESTED, 0);
--
2.49.0
next prev parent reply other threads:[~2025-04-22 15:22 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-22 15:21 [PATCH v2 0/9] Clean up the crypto testing options Eric Biggers
2025-04-22 15:21 ` [PATCH v2 1/9] crypto: tcrypt - remove CRYPTO_TEST from defconfigs Eric Biggers
2025-04-23 6:49 ` Geert Uytterhoeven
2025-04-23 23:20 ` Eric Biggers
2025-04-24 7:43 ` Geert Uytterhoeven
2025-04-22 15:21 ` [PATCH v2 2/9] crypto: tcrypt - rename CRYPTO_TEST to CRYPTO_BENCHMARK Eric Biggers
2025-04-22 15:21 ` [PATCH v2 3/9] crypto: testmgr - remove CRYPTO_MANAGER_DISABLE_TESTS from defconfigs Eric Biggers
2025-04-22 15:21 ` [PATCH v2 4/9] crypto: testmgr - remove panic_on_fail Eric Biggers
2025-04-22 15:21 ` [PATCH v2 5/9] crypto: testmgr - replace CRYPTO_MANAGER_DISABLE_TESTS with CRYPTO_SELFTESTS Eric Biggers
2025-04-24 9:53 ` Herbert Xu
2025-04-24 15:56 ` Eric Biggers
2025-04-25 2:50 ` Herbert Xu
2025-04-22 15:21 ` [PATCH v2 6/9] crypto: testmgr - make it easier to enable the full set of tests Eric Biggers
2025-04-22 15:21 ` [PATCH v2 7/9] crypto: testmgr - rename noextratests to noslowtests Eric Biggers
2025-04-22 15:21 ` [PATCH v2 8/9] crypto: Kconfig - make CRYPTO_MANAGER a hidden symbol Eric Biggers
2025-04-22 15:21 ` Eric Biggers [this message]
2025-04-26 20:31 ` [PATCH v2 0/9] Clean up the crypto testing options Corentin Labbe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250422152151.3691-10-ebiggers@kernel.org \
--to=ebiggers@kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.