From 6d5f63e57b7d7294b891b6de406d767468314dfe Mon Sep 17 00:00:00 2001 From: Peiwei Hu Date: Sat, 28 May 2022 23:46:33 +0800 Subject: Fix the checks of RAND_bytes Reviewed-by: Tomas Mraz Reviewed-by: Paul Dale Reviewed-by: Todd Short (Merged from https://github.com/openssl/openssl/pull/18424) (cherry picked from commit c2f7614fb7b93fe3792068077ff01384f42f39bc) --- test/drbgtest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/drbgtest.c') diff --git a/test/drbgtest.c b/test/drbgtest.c index a6fd46595a..8af64d23b0 100644 --- a/test/drbgtest.c +++ b/test/drbgtest.c @@ -531,7 +531,7 @@ static int test_rand_fork_safety(int i) success = 0; /* request a single byte from each of the DRBGs before the next run */ - if (!TEST_true(RAND_bytes(random, 1) && RAND_priv_bytes(random, 1))) + if (!TEST_int_gt(RAND_bytes(random, 1), 0) || !TEST_int_gt(RAND_priv_bytes(random, 1), 0)) success = 0; return success; -- cgit v1.2.3