Commit 14246db8 authored by Herbert Xu's avatar Herbert Xu Committed by Lu Jialin
Browse files

crypto: drbg - Only fail when jent is unavailable in FIPS mode

stable inclusion
from stable-v5.10.180
commit 2a67bc52cd3f0783ac412d8007ae7bdd04911b10
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I88MMY

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=2a67bc52cd3f0783ac412d8007ae7bdd04911b10



--------------------------------

[ Upstream commit 686cd976 ]

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: 57225e67 ("crypto: drbg - Use callback API for random readiness")
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Reviewed-by: default avatarStephan Mueller <smueller@chronox.de>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Conflict:
	crypto/drbg.c
Signed-off-by: default avatarLu Jialin <lujialin4@huawei.com>
parent f6603b4a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment