mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
UPSTREAM: crypto: kdf - skip self-test when tests disabled
Make kdf_sp800108 honor the CONFIG_CRYPTO_MANAGER_DISABLE_TESTS kconfig
option, so that it doesn't always waste time running its self-test.
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Bug: 256875295
(cherry picked from commit 0bf365c0ef)
Change-Id: Ib189f727a7bb1a231cc8ec4ca6450e685bd678f7
Signed-off-by: Eric Biggers <ebiggers@google.com>
This commit is contained in:
@@ -125,9 +125,13 @@ static const struct kdf_testvec kdf_ctr_hmac_sha256_tv_template[] = {
|
||||
|
||||
static int __init crypto_kdf108_init(void)
|
||||
{
|
||||
int ret = kdf_test(&kdf_ctr_hmac_sha256_tv_template[0], "hmac(sha256)",
|
||||
crypto_kdf108_setkey, crypto_kdf108_ctr_generate);
|
||||
int ret;
|
||||
|
||||
if (IS_ENABLED(CONFIG_CRYPTO_MANAGER_DISABLE_TESTS))
|
||||
return 0;
|
||||
|
||||
ret = kdf_test(&kdf_ctr_hmac_sha256_tv_template[0], "hmac(sha256)",
|
||||
crypto_kdf108_setkey, crypto_kdf108_ctr_generate);
|
||||
if (ret) {
|
||||
if (fips_enabled)
|
||||
panic("alg: self-tests for CTR-KDF (hmac(sha256)) failed (rc=%d)\n",
|
||||
|
||||
Reference in New Issue
Block a user