FT: Fix PMK-R0 derivation for FT-SAE-EXT-KEY with SHA512

Not only the hash[] array, but also the r0_key_data[] array needs to be
extended in size to fit the longer key and salt.

Fixes: a76a314c15 ("FT: Extend PMK-R0 derivation for FT-SAE-EXT-KEY")
Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2022-11-07 00:29:39 +02:00
parent 2f61d703a1
commit 271ce71c7a

View file

@ -2063,7 +2063,7 @@ int wpa_derive_pmk_r0(const u8 *xxkey, size_t xxkey_len,
{
u8 buf[1 + SSID_MAX_LEN + MOBILITY_DOMAIN_ID_LEN + 1 +
FT_R0KH_ID_MAX_LEN + ETH_ALEN];
u8 *pos, r0_key_data[64], hash[64];
u8 *pos, r0_key_data[64 + 16], hash[64];
const u8 *addr[2];
size_t len[2];
size_t q, r0_key_data_len;