summaryrefslogtreecommitdiffstats
path: root/test/drbgtest.c
diff options
context:
space:
mode:
authorPeiwei Hu <jlu.hpw@foxmail.com>2022-05-28 23:46:33 +0800
committerTodd Short <todd.short@me.com>2022-06-02 10:54:14 -0400
commit6d5f63e57b7d7294b891b6de406d767468314dfe (patch)
treeda8d58609f0bed2cc466bc74a6b27ba5d9aed971 /test/drbgtest.c
parent142e280924f8bcd4e86ddc539ac0687f2239373e (diff)
Fix the checks of RAND_bytes
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Todd Short <todd.short@me.com> (Merged from https://github.com/openssl/openssl/pull/18424) (cherry picked from commit c2f7614fb7b93fe3792068077ff01384f42f39bc)
Diffstat (limited to 'test/drbgtest.c')
-rw-r--r--test/drbgtest.c2
1 files changed, 1 insertions, 1 deletions
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;