]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
crypto: drbg - make drbg_fips_continuous_test() return bool
authorSergey Shtylyov <s.shtylyov@omp.ru>
Wed, 17 Dec 2025 20:21:44 +0000 (23:21 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 29 Dec 2025 00:48:35 +0000 (08:48 +0800)
commit6acd394367ab145b1cc26e66aac3bb40b968e893
tree174482f945c2a07ecc735875300c3968093f9579
parenteb6449aa7b32259a8b59e0c9602b32dcaf1fba58
crypto: drbg - make drbg_fips_continuous_test() return bool

Currently, drbg_fips_continuous_test() only returns 0 and -EAGAIN, so an
early return from the *do*/*while* loop in drbg_get_random_bytes() just
isn't possible. Make drbg_fips_continuous_test() return bool instead of
*int* (using true instead of 0 and false instead of -EAGAIN). This way,
we can further simplify drbg_get_random_bytes()...

Found by Linux Verification Center (linuxtesting.org) with the Svace static
analysis tool.

Suggested-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/drbg.c