Fix RAND_(pseudo_)?_bytes returns
Ensure all calls to RAND_bytes and RAND_pseudo_bytes have their return
value checked correctly
Reviewed-by: Richard Levitte <levitte@openssl.org>
(cherry picked from commit 8f8e4e4f52)
Conflicts:
crypto/evp/e_des3.c
This commit is contained in:
@@ -296,8 +296,8 @@ int test_builtin(BIO *out)
|
||||
int nid, ret = 0;
|
||||
|
||||
/* fill digest values with some random data */
|
||||
if (!RAND_pseudo_bytes(digest, 20) ||
|
||||
!RAND_pseudo_bytes(wrong_digest, 20)) {
|
||||
if (RAND_pseudo_bytes(digest, 20) <= 0 ||
|
||||
RAND_pseudo_bytes(wrong_digest, 20) <= 0) {
|
||||
BIO_printf(out, "ERROR: unable to get random data\n");
|
||||
goto builtin_err;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user