Fix internal DH implementation not to pad shared key
authorJouni Malinen <jouni.malinen@atheros.com>
Mon, 12 Apr 2010 09:25:21 +0000 (12:25 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 12 Apr 2010 09:25:21 +0000 (12:25 +0300)
commit0cb445a4725a69a245a60569dd67e6d960d808ed
treebd2263309e05c4fc8d55172185c602475dfe3d60
parent20e26395c81c24a622481467f28e39b137dcd798
Fix internal DH implementation not to pad shared key

The returned buffer length was hardcoded to be the prime length
which resulted in shorter results being padded in the end. However,
the results from DH code are supposed to be unpadded (and when used
with WPS, the padding is done in WPS code and it is added to the
beginning of the buffer). This fixes WPS key derivation errors
in about 1/256 of runs ("WPS: Incorrect Authenticator") when using
the internal crypto code.
src/crypto/dh_groups.c