SME: Do not try to use FT over-the-air if PTK is not available

This commit is contained in:
Jouni Malinen 2010-04-10 22:39:49 +03:00
parent 3b4f6dac19
commit 0d7b44099f
3 changed files with 16 additions and 1 deletions

View 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;
}

View 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 */

View 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;