diff options
author | Niels Möller <nisse@lysator.liu.se> | 2019-01-06 11:11:15 +0100 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2019-01-10 22:13:38 +0100 |
commit | 1f5b9812dec00811344ab080444c0582f6405533 (patch) | |
tree | bd1bdb525a82d2003321deb33e854f2ef6f25657 | |
parent | 19fa22a4183d922ad665aa1fc142cdab750b7963 (diff) | |
download | nettle-1f5b9812dec00811344ab080444c0582f6405533.tar.gz |
tests: Fix assert call with side effects.
(cherry picked from commit 73d3c6d5586cc0fd81eab081078144d621de07b4)
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | testsuite/rsa-compute-root-test.c | 4 |
2 files changed, 8 insertions, 1 deletions
@@ -12,6 +12,11 @@ * sha512-compress.c: Add missing include of sha2-internal.h. +2019-01-06 Niels Möller <nisse@lysator.liu.se> + + * testsuite/rsa-compute-root-test.c (generate_keypair): Fix assert + call with side-effects. + 2018-12-26 Niels Möller <nisse@lysator.liu.se> * examples/hogweed-benchmark.c (make_openssl_rsa_ctx): New helper diff --git a/testsuite/rsa-compute-root-test.c b/testsuite/rsa-compute-root-test.c index e7bdb1f8..42ea0af7 100644 --- a/testsuite/rsa-compute-root-test.c +++ b/testsuite/rsa-compute-root-test.c @@ -86,6 +86,7 @@ generate_keypair (gmp_randstate_t rands, mpz_t q1; mpz_t phi; mpz_t tmp; + int res; mpz_init (p1); mpz_init (q1); @@ -124,7 +125,8 @@ generate_keypair (gmp_randstate_t rands, } mpz_mul(phi, p1, q1); - assert (mpz_invert(key->d, pub->e, phi)); + res = mpz_invert(key->d, pub->e, phi); + assert (res); mpz_fdiv_r (key->a, key->d, p1); mpz_fdiv_r (key->b, key->d, q1); |