diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2023-03-28 11:35:23 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-05-17 11:13:13 +0200 |
commit | 1fd247c1ded58f9bc1130fe4b26fb187fa1af55d (patch) | |
tree | e4d89c344d9989e26b4e5bc43c8c07bde43254a0 /crypto | |
parent | f1943e5703861f89f4376596e3d28d0dd52c5ead (diff) | |
download | linux-stable-1fd247c1ded58f9bc1130fe4b26fb187fa1af55d.tar.gz linux-stable-1fd247c1ded58f9bc1130fe4b26fb187fa1af55d.tar.bz2 linux-stable-1fd247c1ded58f9bc1130fe4b26fb187fa1af55d.zip |
crypto: drbg - Only fail when jent is unavailable in FIPS mode
[ Upstream commit 686cd976b6ddedeeb1a1fb09ba53a891d3cc9a03 ]
When jent initialisation fails for any reason other than ENOENT,
the entire drbg fails to initialise, even when we're not in FIPS
mode. This is wrong because we can still use the kernel RNG when
we're not in FIPS mode.
Change it so that it only fails when we are in FIPS mode.
Fixes: 57225e679788 ("crypto: drbg - Use callback API for random readiness")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Reviewed-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/drbg.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/drbg.c b/crypto/drbg.c index 8b80fd3690ff..0df8cc9bb563 100644 --- a/crypto/drbg.c +++ b/crypto/drbg.c @@ -1516,7 +1516,7 @@ static int drbg_prepare_hrng(struct drbg_state *drbg) const int err = PTR_ERR(drbg->jent); drbg->jent = NULL; - if (fips_enabled || err != -ENOENT) + if (fips_enabled) return err; pr_info("DRBG: Continuing without Jitter RNG\n"); } |