]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
SME: Do not try to use FT over-the-air if PTK is not available
authorJouni Malinen <j@w1.fi>
Sat, 10 Apr 2010 19:39:49 +0000 (22:39 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 10 Apr 2010 19:39:49 +0000 (22:39 +0300)
src/rsn_supp/wpa.c
src/rsn_supp/wpa.h
wpa_supplicant/sme.c

index 09b1619959eaf078a43c38a1988c11c8ae9e4290..885d173268afbdef93199116dd8523e9ab10d381 100644 (file)
@@ -2548,3 +2548,11 @@ void wpa_sm_drop_sa(struct wpa_sm *sm)
        os_memset(&sm->ptk, 0, sizeof(sm->ptk));
        os_memset(&sm->tptk, 0, sizeof(sm->tptk));
 }
+
+
+int wpa_sm_has_ptk(struct wpa_sm *sm)
+{
+       if (sm == NULL)
+               return 0;
+       return sm->ptk_set;
+}
index 72bf8f4552b060d5c20213943ce570faaeaaab20..4faea8d5b7354d7efdf2678ca3370f567c3d6a1c 100644 (file)
@@ -124,6 +124,7 @@ int wpa_sm_rx_eapol(struct wpa_sm *sm, const u8 *src_addr,
 int wpa_sm_parse_own_wpa_ie(struct wpa_sm *sm, struct wpa_ie_data *data);
 int wpa_sm_pmksa_cache_list(struct wpa_sm *sm, char *buf, size_t len);
 void wpa_sm_drop_sa(struct wpa_sm *sm);
+int wpa_sm_has_ptk(struct wpa_sm *sm);
 
 #else /* CONFIG_NO_WPA */
 
@@ -323,6 +324,11 @@ wpa_ft_validate_reassoc_resp(struct wpa_sm *sm, const u8 *ies, size_t ies_len,
        return -1;
 }
 
+static inline int wpa_sm_has_ptk(struct wpa_sm *sm)
+{
+       return 0;
+}
+
 #endif /* CONFIG_IEEE80211R */
 
 #endif /* WPA_H */
index a31f2dbaa2c3451493c76ff330ea64e76aca41b2..32c35be87a1184e37b8e78e2b6f0a6e1dde42201 100644 (file)
@@ -183,7 +183,8 @@ void sme_authenticate(struct wpa_supplicant *wpa_s,
                }
 
                if (wpa_s->sme.ft_used &&
-                   os_memcmp(md, wpa_s->sme.mobility_domain, 2) == 0) {
+                   os_memcmp(md, wpa_s->sme.mobility_domain, 2) == 0 &&
+                   wpa_sm_has_ptk(wpa_s->wpa)) {
                        wpa_printf(MSG_DEBUG, "SME: Trying to use FT "
                                   "over-the-air");
                        params.auth_alg = WPA_AUTH_ALG_FT;