[PATCH 1/1] hostapd: Correct PMK copy length in case of SHA384

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Currently in eapol callback PMK update is wrongly done with default
PMK length even in case of SHA384. SHA384 would need higher PMK
length of 48, accordingly correct the PMK length used while PMK
copy.

Signed-off-by: Vinayak Yadawad <vinayak.yadawad@xxxxxxxxxxxx>
---
 wpa_supplicant/wpas_glue.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/wpa_supplicant/wpas_glue.c b/wpa_supplicant/wpas_glue.c
index e776d5f92..a7baf014a 100644
--- a/wpa_supplicant/wpas_glue.c
+++ b/wpa_supplicant/wpas_glue.c
@@ -345,7 +345,11 @@ 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 */
-- 
2.43.4


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux