mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-22 14:39:24 -05:00
Fix an assertion failure when loading Ed25519 keys.
"amax == 0 || a[amax] != 0" Essentially, when decodepoint_ed() clears the top bit of the key, it needs to call bn_restore_invariant() in case that left the high-order word zero. Bug found with the help of afl-fuzz.
This commit is contained in:
parent
b94a076955
commit
0629f1dfa5
1
sshecc.c
1
sshecc.c
@ -1648,6 +1648,7 @@ static int decodepoint_ed(const char *p, int length, struct ec_point *point)
|
|||||||
/* Read x bit and then reset it */
|
/* Read x bit and then reset it */
|
||||||
negative = bignum_bit(point->y, point->curve->fieldBits - 1);
|
negative = bignum_bit(point->y, point->curve->fieldBits - 1);
|
||||||
bignum_set_bit(point->y, point->curve->fieldBits - 1, 0);
|
bignum_set_bit(point->y, point->curve->fieldBits - 1, 0);
|
||||||
|
bn_restore_invariant(point->y);
|
||||||
|
|
||||||
/* Get the x from the y */
|
/* Get the x from the y */
|
||||||
point->x = ecp_edx(point->curve, point->y);
|
point->x = ecp_edx(point->curve, point->y);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user