Commit f5a3a224 authored by Niels Möller's avatar Niels Möller

Fix accidental use of C99 for loop.

* rsa-sign-tr.c (sec_equal): Fix accidental use of C99 for loop.
Reported by Andreas Gustafsson.
* testsuite/rsa-sec-decrypt-test.c (test_main): Likewise.
parent 4fc52f4d
2018-12-26 Niels Möller <nisse@lysator.liu.se>
* rsa-sign-tr.c (sec_equal): Fix accidental use of C99 for loop.
Reported by Andreas Gustafsson.
* testsuite/rsa-sec-decrypt-test.c (test_main): Likewise.
2018-12-04 Niels Möller <nisse@lysator.liu.se>
* Released nettle-3.4.1.
......
......@@ -239,8 +239,9 @@ static int
sec_equal(const mp_limb_t *a, const mp_limb_t *b, size_t limbs)
{
volatile mp_limb_t z = 0;
size_t i;
for (size_t i = 0; i < limbs; i++)
for (i = 0; i < limbs; i++)
{
z |= (a[i] ^ b[i]);
}
......
......@@ -68,6 +68,7 @@ test_main(void)
unsigned n_size = 1024;
mpz_t gibberish;
mpz_t garbage;
size_t size;
rsa_private_key_init(&key);
rsa_public_key_init(&pub);
......@@ -78,7 +79,7 @@ test_main(void)
memset(verifybad, 'A', PAYLOAD_SIZE);
for (size_t size = 1; size < 51; size++)
for (size = 1; size < 51; size++)
{
ASSERT (rsa_generate_keypair(&pub, &key, &random_ctx,
(nettle_random_func *) knuth_lfib_random,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment