mirror of
https://github.com/openssl/openssl.git
synced 2025-02-17 14:32:04 +08:00
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)
This commit is contained in:
parent
d0bf0106a5
commit
8d120aef95
@ -4747,7 +4747,8 @@ static void multiblock_speed(const EVP_CIPHER *evp_cipher, int lengths_single,
|
|||||||
} else {
|
} else {
|
||||||
int pad;
|
int pad;
|
||||||
|
|
||||||
RAND_bytes(out, 16);
|
if (RAND_bytes(inp, 16) <= 0)
|
||||||
|
app_bail_out("error setting random bytes\n");
|
||||||
len += 16;
|
len += 16;
|
||||||
aad[11] = (unsigned char)(len >> 8);
|
aad[11] = (unsigned char)(len >> 8);
|
||||||
aad[12] = (unsigned char)(len);
|
aad[12] = (unsigned char)(len);
|
||||||
|
Loading…
Reference in New Issue
Block a user