mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
crypto: drbg - Fix returning success on failure in CTR_DRBG
drbg_ctr_generate() sometimes returns success when it fails, leaving the
output buffer uninitialized. Fix it.
Fixes: cde001e4c3 ("crypto: rng - RNGs must return 0 in success case")
Cc: stable@vger.kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
edcc5d486a
commit
39a31ad9e2
|
|
@ -377,7 +377,7 @@ static int drbg_ctr_generate(struct drbg_state *drbg,
|
|||
if (addtl && !list_empty(addtl)) {
|
||||
ret = drbg_ctr_update(drbg, addtl, 2);
|
||||
if (ret)
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* 10.2.1.5.2 step 4.1 */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user