]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
SAE: Fix FT-SAE key derivation for a case where PMKID in msg 1/4 matches
authorJouni Malinen <jouni@codeaurora.org>
Fri, 23 Mar 2018 16:42:21 +0000 (18:42 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 23 Mar 2018 16:44:48 +0000 (18:44 +0200)
Previously, matching PMKSA cache entry ended up clearing XXKey. However,
that XXKey is needed in the specific case where FT-SAE goes through the
initial mobility domain association with SAE authentication. FT-SAE
worked previously since the hostapd side generation of the particular
PMKID value in msg 1/4 was broken, but once that PMKID is fixed,
wpa_supplicant will need this fix to allow FT-SAE to be used.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/rsn_supp/wpa.c

index ea54f327ec82e6e93b52ad20f2cba25352221274..5ebd4cb990fd644f70b4be2dd1e1c2b364170fdb 100644 (file)
@@ -288,6 +288,18 @@ static int wpa_supplicant_get_pmk(struct wpa_sm *sm,
                eapol_sm_notify_cached(sm->eapol);
 #ifdef CONFIG_IEEE80211R
                sm->xxkey_len = 0;
+#ifdef CONFIG_SAE
+               if (sm->key_mgmt == WPA_KEY_MGMT_FT_SAE &&
+                   sm->pmk_len == PMK_LEN) {
+                       /* Need to allow FT key derivation to proceed with
+                        * PMK from SAE being used as the XXKey in cases where
+                        * the PMKID in msg 1/4 matches the PMKSA entry that was
+                        * just added based on SAE authentication for the
+                        * initial mobility domain association. */
+                       os_memcpy(sm->xxkey, sm->pmk, sm->pmk_len);
+                       sm->xxkey_len = sm->pmk_len;
+               }
+#endif /* CONFIG_SAE */
 #endif /* CONFIG_IEEE80211R */
        } else if (wpa_key_mgmt_wpa_ieee8021x(sm->key_mgmt) && sm->eapol) {
                int res, pmk_len;