]> asedeno.scripts.mit.edu Git - PuTTY.git/commit
Fix construction of the output bignum in Curve25519 kex.
authorSimon Tatham <anakin@pobox.com>
Tue, 19 May 2015 08:54:17 +0000 (09:54 +0100)
committerSimon Tatham <anakin@pobox.com>
Tue, 19 May 2015 09:01:42 +0000 (10:01 +0100)
commit686ce919051d3bd47c0a6a881a8ce821d565630a
tree96da5561ddd2643f17e2b32cde10f82f949be7ef
parenta209b9044e6536243b4c1b662300b2055776bab2
Fix construction of the output bignum in Curve25519 kex.

We were doing an endianness flip on the output elliptic-curve point.
Endianness flips of bignums, of course, have to specify how many bytes
they're imagining the value to have (that's how you decide whether to
convert 0xA1A2 into 0xA2A1 or 0xA2A10000 or 0xA2A1000000000000 etc),
and we had chosen our byte count based on the highest set bit in the
_output value_ - but in fact we should have chosen it based on the
size of the curve's modulus, leading to a failure about 1/256 of the
time when the MSB happened to come out zero so the two byte counts
differed.

(Also added a missing smemclr, while I was there.)
sshecc.c