Commit 2b552abd authored by Niels Möller's avatar Niels Möller
Browse files

Fixed mpn_get_base256_le buffer overwrite.

parent c9879bcb
2014-09-17 Niels Möller <nisse@lysator.liu.se> 2014-09-17 Niels Möller <nisse@lysator.liu.se>
* gmp-glue.c (mpn_get_base256_le): Fixed missing update of rn
counter, making the function clear some bytes beyond the end of
the output buffer. The bug triggered a make check failure on ARM.
* testsuite/testutils.c (ecc_curves): Include curve25519 in list. * testsuite/testutils.c (ecc_curves): Include curve25519 in list.
(test_ecc_mul_a): Include reference points for curve25519 (with (test_ecc_mul_a): Include reference points for curve25519 (with
Edwards coordinates). Allow n == 0 and n == 1, comparing to zero Edwards coordinates). Allow n == 0 and n == 1, comparing to zero
......
...@@ -293,6 +293,7 @@ mpn_get_base256_le (uint8_t *rp, size_t rn, ...@@ -293,6 +293,7 @@ mpn_get_base256_le (uint8_t *rp, size_t rn,
in = *xp++; in = *xp++;
xn--; xn--;
*rp++ = old | (in << bits); *rp++ = old | (in << bits);
rn--;
in >>= (8 - bits); in >>= (8 - bits);
bits += GMP_NUMB_BITS - 8; bits += GMP_NUMB_BITS - 8;
} }
......
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