From 8b5579e17a83b441e2480b2e82f7b85090766697 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 8 Oct 2017 16:40:51 +0300 Subject: [PATCH] DPP: Fix EAPOL-Key Key MIC calculation The Key MIC field value got truncated for all cases and incorrect HMAC hash algorithm was used for the SHA512 cases. Signed-off-by: Jouni Malinen --- src/common/wpa_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/wpa_common.c b/src/common/wpa_common.c index 966d737c9..46e2b8e55 100644 --- a/src/common/wpa_common.c +++ b/src/common/wpa_common.c @@ -184,7 +184,7 @@ int wpa_eapol_key_mic(const u8 *key, size_t key_len, int akmp, int ver, if (hmac_sha384(key, key_len, buf, len, hash)) return -1; } else if (key_len == 256 / 8) { - if (hmac_sha256(key, key_len, buf, len, hash)) + if (hmac_sha512(key, key_len, buf, len, hash)) return -1; } else { wpa_printf(MSG_INFO, @@ -192,7 +192,7 @@ int wpa_eapol_key_mic(const u8 *key, size_t key_len, int akmp, int ver, (unsigned int) key_len); return -1; } - os_memcpy(mic, hash, key_len / 8); + os_memcpy(mic, hash, key_len); break; #endif /* CONFIG_DPP */ default: