From da53435d4d11db827e3661be372e7b9773eaa842 Mon Sep 17 00:00:00 2001
From: JasonHuang <Jason.Huang2@infineon.com>
Date: Thu, 8 Sep 2022 03:26:23 -0500
Subject: [PATCH 34/49] wpa_supplicant: Set PMKSA to driver while key mgmt is
 FT

When the fast roaming is determined by the firmware, the
firmware needs the pmk to calculate PMK-R0name.

Signed-off-by: JasonHuang <Jason.Huang2@infineon.com>
---
 src/rsn_supp/wpa.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c
index 3eaa759f6..ce01990e5 100644
--- a/src/rsn_supp/wpa.c
+++ b/src/rsn_supp/wpa.c
@@ -1831,8 +1831,10 @@ static void wpa_supplicant_process_3_of_4(struct wpa_sm *sm,
 	 * existing PMKSA entry after each 4-way handshake (i.e., new KCK/PMKID)
 	 * to avoid unnecessary changes of PMKID while continuing to use the
 	 * same PMK. */
-	if (sm->proto == WPA_PROTO_RSN && wpa_key_mgmt_suite_b(sm->key_mgmt) &&
-	    !sm->cur_pmksa) {
+	/* Add ft case for driver base roaming. FW needs PMK to calculate
+	 * PMK-R0name */
+	if (sm->proto == WPA_PROTO_RSN && (wpa_key_mgmt_suite_b(sm->key_mgmt) ||
+	    wpa_key_mgmt_ft(sm->key_mgmt)) && !sm->cur_pmksa) {
 		struct rsn_pmksa_cache_entry *sa;
 
 		sa = pmksa_cache_add(sm->pmksa, sm->pmk, sm->pmk_len, NULL,
-- 
2.17.1

