aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/sme.c
diff options
context:
space:
mode:
authorAnkita Bajaj <bankita@codeaurora.org>2018-07-27 08:25:27 (GMT)
committerJouni Malinen <j@w1.fi>2018-08-24 13:27:34 (GMT)
commitaf835d75b7cff0882ebc9397119639b11dd79afe (patch)
tree95bea3a2838d7caef249e866156ae7769063d717 /wpa_supplicant/sme.c
parent1ff8605775c89f4ad1e4c9e5aaef3cba210c6d3b (diff)
downloadhostap-af835d75b7cff0882ebc9397119639b11dd79afe.zip
hostap-af835d75b7cff0882ebc9397119639b11dd79afe.tar.gz
hostap-af835d75b7cff0882ebc9397119639b11dd79afe.tar.bz2
FILS: Fix FILS connect failures after ERP key invalidation
If the RADIUS authentication server dropped the cached ERP keys for any reason, FILS authentication attempts with ERP fails and the previous wpa_supplicant implementation ended up trying to use the same keys for all consecutive attempts as well. This did not allow recovery from state mismatch between the ERP server and peer using full EAP authentication. Address this by trying to use full (non-FILS) authentication when trying to connect to an AP using the same ERP realm with FILS-enabled network profile if the previous authentication attempt had failed. This allows new ERP keys to be established and FILS authentication to be used again for the consecutive connections. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
Diffstat (limited to 'wpa_supplicant/sme.c')
-rw-r--r--wpa_supplicant/sme.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
index d57195f..b685064 100644
--- a/wpa_supplicant/sme.c
+++ b/wpa_supplicant/sme.c
@@ -591,6 +591,9 @@ static void sme_send_authentication(struct wpa_supplicant *wpa_s,
wpa_key_mgmt_fils(ssid->key_mgmt)) {
const u8 *indic;
u16 fils_info;
+ const u8 *realm, *username, *rrk;
+ size_t realm_len, username_len, rrk_len;
+ u16 next_seq_num;
/*
* Check FILS Indication element (FILS Information field) bits
@@ -620,6 +623,19 @@ static void sme_send_authentication(struct wpa_supplicant *wpa_s,
goto no_fils;
}
+ if (wpa_s->last_con_fail_realm &&
+ eapol_sm_get_erp_info(wpa_s->eapol, &ssid->eap,
+ &username, &username_len,
+ &realm, &realm_len, &next_seq_num,
+ &rrk, &rrk_len) == 0 &&
+ realm && realm_len == wpa_s->last_con_fail_realm_len &&
+ os_memcmp(realm, wpa_s->last_con_fail_realm,
+ realm_len) == 0) {
+ wpa_printf(MSG_DEBUG,
+ "SME: FILS authentication for this realm failed last time - try to regenerate ERP key hierarchy");
+ goto no_fils;
+ }
+
if (pmksa_cache_set_current(wpa_s->wpa, NULL, bss->bssid,
ssid, 0,
wpa_bss_get_fils_cache_id(bss),
@@ -1195,6 +1211,12 @@ void sme_event_auth(struct wpa_supplicant *wpa_s, union wpa_event_data *data)
ie_txt ? ie_txt : "");
os_free(ie_txt);
+#ifdef CONFIG_FILS
+ if (wpa_s->sme.auth_alg == WPA_AUTH_ALG_FILS ||
+ wpa_s->sme.auth_alg == WPA_AUTH_ALG_FILS_SK_PFS)
+ fils_connection_failure(wpa_s);
+#endif /* CONFIG_FILS */
+
if (data->auth.status_code !=
WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG ||
wpa_s->sme.auth_alg == data->auth.auth_type ||