]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
tests: Fix assert call with side effects.
authorNiels Möller <nisse@lysator.liu.se>
Sun, 6 Jan 2019 10:11:15 +0000 (11:11 +0100)
committerNiels Möller <nisse@lysator.liu.se>
Thu, 10 Jan 2019 21:13:38 +0000 (22:13 +0100)
(cherry picked from commit 73d3c6d5586cc0fd81eab081078144d621de07b4)

ChangeLog
testsuite/rsa-compute-root-test.c

index cdf215bd8b77ac9ea6e1dbe1f75ec8a972de72d2..d7dac085cfff17f3a397f69149b2a28ad29d21c6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 
        * 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
index e7bdb1f8ebccb65681f2520397cdf1845edb9d66..42ea0af786b9724f2f57e0ab8fd45526cec9271d 100644 (file)
@@ -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);