diff options
author | Klavishnik <evg.shtanov@gmail.com> | 2023-08-10 13:56:24 +0300 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2023-10-10 17:18:47 +0200 |
commit | f5fb3acc1f4dd97bdc475e27938108b4cc4bd7b0 (patch) | |
tree | ab86c59e88c1325b506a12d1888325c3d8a9c1ec /apps | |
parent | 73c5668a968bd47262ef8acd96d18c044b97d550 (diff) |
Added check for the return value of the RAND_bytes() function
Call app_bail_out if RAND_bytes() fails.
Also changed the output parameter of RAND_bytes() to inp as
writing to encrypted output buffer does not make sense.
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21706)
(cherry picked from commit 8d120aef951d7bb7deac0b8b559f8003f5ea6384)
Diffstat (limited to 'apps')
-rw-r--r-- | apps/speed.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/speed.c b/apps/speed.c index f30435704d..1113d775b8 100644 --- a/apps/speed.c +++ b/apps/speed.c @@ -3700,7 +3700,8 @@ static void multiblock_speed(const EVP_CIPHER *evp_cipher, int lengths_single, } else { int pad; - RAND_bytes(out, 16); + if (RAND_bytes(inp, 16) <= 0) + app_bail_out("error setting random bytes\n"); len += 16; aad[11] = (unsigned char)(len >> 8); aad[12] = (unsigned char)(len); |