[PATCH v2 21/28] sme: Add support to install temporal key for EPPKE Authentication Protocol

Ainy Kumari ainy.kumari at oss.qualcomm.com
Tue Jan 6 05:45:31 PST 2026


From: Kavita Kavita <kavita.kavita at oss.qualcomm.com>

Add support to install the temporal key for Enhanced Privacy Protection
Key Exchange (EPPKE) as specified in section 12.16.9 of
IEEE P802.11bi/D2.0 after authentication completes.

This commit add support to configure temporal key TK with the driver
immediately after authentication completes.

Signed-off-by: Kavita Kavita <kavita.kavita at oss.qualcomm.com>
Signed-off-by: Ainy Kumari <ainy.kumari at oss.qualcomm.com>
---
 wpa_supplicant/sme.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
index 107fd2d15..eaed91c1c 100644
--- a/wpa_supplicant/sme.c
+++ b/wpa_supplicant/sme.c
@@ -2242,6 +2242,9 @@ void sme_event_auth(struct wpa_supplicant *wpa_s, union wpa_event_data *data)
 		struct pasn_data *pasn = &wpa_s->pasn;
 		struct wpa_pasn_params_data pasn_params;
 		int res;
+		enum wpa_alg alg;
+		u8 zero[WPA_TK_MAX_LEN] = {0};
+		struct ptksa_cache_entry *entry;
 
 		res = wpas_parse_pasn_frame(pasn, data->auth.auth_type,
 					    data->auth.auth_transaction,
@@ -2266,6 +2269,14 @@ void sme_event_auth(struct wpa_supplicant *wpa_s, union wpa_event_data *data)
 
 		sme_send_authentication(wpa_s, wpa_s->current_bss,
 					wpa_s->current_ssid, 0);
+
+		alg = wpa_cipher_to_alg(pasn_get_cipher(pasn));
+		entry = ptksa_cache_get(wpa_s->ptksa, pasn->peer_addr,
+					pasn_get_cipher(pasn));
+
+		wpa_drv_set_key(wpa_s, -1, alg, pasn->peer_addr, 0, 1,
+				zero, 6, entry->ptk.tk, entry->ptk.tk_len,
+				KEY_FLAG_PAIRWISE_RX_TX);
 	}
 #endif /* CONFIG_ENC_ASSOC */
 #ifdef CONFIG_SAE
-- 
2.25.1




More information about the Hostap mailing list