]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
DPP: Fix EAPOL-Key Key MIC calculation
authorJouni Malinen <jouni@qca.qualcomm.com>
Sun, 8 Oct 2017 13:40:51 +0000 (16:40 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 8 Oct 2017 14:12:35 +0000 (17:12 +0300)
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 <jouni@qca.qualcomm.com>
src/common/wpa_common.c

index 966d737c9b32b3983c550018b4653bc0151b3e14..46e2b8e555f0248d03f269a35c169f445254a874 100644 (file)
@@ -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: