summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@kernel.org>2026-03-25 17:15:05 -0700
committerHerbert Xu <herbert@gondor.apana.org.au>2026-04-03 08:56:12 +0800
commit65b3c2f6278516397bebcdbf4698bd3102120ca5 (patch)
treec25d669d4c22db493955adefa15edfc7f6573d90 /crypto
parentbdd2cc93bfd051f05084115faad35f9b5402a194 (diff)
downloadlwn-65b3c2f6278516397bebcdbf4698bd3102120ca5.tar.gz
lwn-65b3c2f6278516397bebcdbf4698bd3102120ca5.zip
crypto: rng - Make crypto_stdrng_get_bytes() use normal RNG in non-FIPS mode
"stdrng" is needed only in "FIPS mode". Therefore, make crypto_stdrng_get_bytes() delegate to either the normal Linux RNG or to "stdrng", depending on the current mode. This will eliminate the need to built the SP800-90A DRBG and its dependencies into CRYPTO_FIPS=n kernels. Signed-off-by: Eric Biggers <ebiggers@kernel.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/rng.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/rng.c b/crypto/rng.c
index f52f4793f9ea..1d4b9177bad4 100644
--- a/crypto/rng.c
+++ b/crypto/rng.c
@@ -142,7 +142,7 @@ static void crypto_put_default_rng(void)
mutex_unlock(&crypto_default_rng_lock);
}
-int crypto_stdrng_get_bytes(void *buf, unsigned int len)
+int __crypto_stdrng_get_bytes(void *buf, unsigned int len)
{
int err;
@@ -154,7 +154,7 @@ int crypto_stdrng_get_bytes(void *buf, unsigned int len)
crypto_put_default_rng();
return err;
}
-EXPORT_SYMBOL_GPL(crypto_stdrng_get_bytes);
+EXPORT_SYMBOL_GPL(__crypto_stdrng_get_bytes);
#if defined(CONFIG_CRYPTO_RNG) || defined(CONFIG_CRYPTO_RNG_MODULE)
int crypto_del_default_rng(void)