]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
EAPOL: Fix PMK setting for driver-based FT-SHA384
authorVinayak Yadawad <vinayak.yadawad@broadcom.com>
Wed, 4 Dec 2024 09:13:59 +0000 (14:43 +0530)
committerJouni Malinen <j@w1.fi>
Sun, 22 Dec 2024 22:27:29 +0000 (00:27 +0200)
Currently in eapol callback PMK update for FT is done wrongly with the
default PMK length even in case of SHA384. SHA384 needs longer 48-octet
PMK. Accordingly, fix the offset and length of the PMK that is
configured to the driver for driver-based FT.

Signed-off-by: Vinayak Yadawad <vinayak.yadawad@broadcom.com>
wpa_supplicant/wpas_glue.c

index ec363c9bb8b67bdca70cfd23b02cbe1a351bbddb..a1927374c7c1f2f3c43966f1693e12af9e328fc2 100644 (file)
@@ -345,7 +345,10 @@ static void wpa_supplicant_eapol_cb(struct eapol_sm *eapol,
                           "driver-based 4-way hs and FT");
                res = eapol_sm_get_key(eapol, buf, 2 * PMK_LEN);
                if (res == 0) {
-                       os_memcpy(pmk, buf + PMK_LEN, PMK_LEN);
+                       if (wpa_key_mgmt_sha384(wpa_s->key_mgmt))
+                               os_memcpy(pmk, buf, pmk_len);
+                       else
+                               os_memcpy(pmk, buf + PMK_LEN, PMK_LEN);
                        os_memset(buf, 0, sizeof(buf));
                }
 #else /* CONFIG_IEEE80211R */