diff options
author | Pauli <paul.dale@oracle.com> | 2017-07-06 09:10:28 +1000 |
---|---|---|
committer | Pauli <paul.dale@oracle.com> | 2017-07-14 07:31:29 +1000 |
commit | 9e206ce5f80172136b503ca23fbd8e53b78eb4b7 (patch) | |
tree | d3942855040ebee306a234140f9f62b5d33177f3 /test/exptest.c | |
parent | d72a00416a0691bfd4920008767221bb4082a2ed (diff) |
Fix some issues raise by coverity in the tests.
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3846)
Diffstat (limited to 'test/exptest.c')
-rw-r--r-- | test/exptest.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/test/exptest.c b/test/exptest.c index e6f52139a1..9de922e979 100644 --- a/test/exptest.c +++ b/test/exptest.c @@ -156,10 +156,9 @@ static int test_mod_exp(int round) c = (c % BN_BITS) - BN_BITS2; BN_rand(m, NUM_BITS + c, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ODD); - BN_mod(a, a, m, ctx); - BN_mod(b, b, m, ctx); - - if (!TEST_true(BN_mod_exp_mont(r_mont, a, b, m, ctx, NULL)) + if (!TEST_true(BN_mod(a, a, m, ctx)) + || !TEST_true(BN_mod(b, b, m, ctx)) + || !TEST_true(BN_mod_exp_mont(r_mont, a, b, m, ctx, NULL)) || !TEST_true(BN_mod_exp_recp(r_recp, a, b, m, ctx)) || !TEST_true(BN_mod_exp_simple(r_simple, a, b, m, ctx)) || !TEST_true(BN_mod_exp_mont_consttime(r_mont_const, a, b, m, ctx, NULL))) |