diff options
author | Peiwei Hu <jlu.hpw@foxmail.com> | 2022-05-28 23:46:33 +0800 |
---|---|---|
committer | Todd Short <todd.short@me.com> | 2022-06-02 10:54:14 -0400 |
commit | 6d5f63e57b7d7294b891b6de406d767468314dfe (patch) | |
tree | da8d58609f0bed2cc466bc74a6b27ba5d9aed971 /test/exptest.c | |
parent | 142e280924f8bcd4e86ddc539ac0687f2239373e (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/exptest.c')
-rw-r--r-- | test/exptest.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/exptest.c b/test/exptest.c index 84d972afe3..c2acc40bcd 100644 --- a/test/exptest.c +++ b/test/exptest.c @@ -144,21 +144,21 @@ static int test_mod_exp(int round) || !TEST_ptr(m = BN_new())) goto err; - if (!TEST_true(RAND_bytes(&c, 1))) + if (!TEST_int_gt(RAND_bytes(&c, 1), 0)) goto err; c = (c % BN_BITS) - BN_BITS2; if (!TEST_true(BN_rand(a, NUM_BITS + c, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ANY))) goto err; - if (!TEST_true(RAND_bytes(&c, 1))) + if (!TEST_int_gt(RAND_bytes(&c, 1), 0)) goto err; c = (c % BN_BITS) - BN_BITS2; if (!TEST_true(BN_rand(b, NUM_BITS + c, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ANY))) goto err; - if (!TEST_true(RAND_bytes(&c, 1))) + if (!TEST_int_gt(RAND_bytes(&c, 1), 0)) goto err; c = (c % BN_BITS) - BN_BITS2; if (!TEST_true(BN_rand(m, NUM_BITS + c, BN_RAND_TOP_ONE, |