aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSrinivas Dasari <dasaris@codeaurora.org>2019-05-16 09:21:36 (GMT)
committerJouni Malinen <j@w1.fi>2019-05-31 13:52:15 (GMT)
commitfb6ebd1cedf34609b737555b3f12f0e50ce8ac02 (patch)
tree1ef194137bf432601773586108030f8bbdbe4028
parent2552a3735a13446fae321509ace4d6888b8dd830 (diff)
downloadhostap-fb6ebd1cedf34609b737555b3f12f0e50ce8ac02.zip
hostap-fb6ebd1cedf34609b737555b3f12f0e50ce8ac02.tar.gz
hostap-fb6ebd1cedf34609b737555b3f12f0e50ce8ac02.tar.bz2
SAE: Send external auth failure status to driver
wpa_supplicant prepares auth commit request as part of the external authentication (first SAE authentication frame), but it fails to get prepared when wpa_supplicant is started without mentioning the SAE password in configuration. Send this failure status to the driver to make it aware that the external authentication has been aborted by wpa_supplicant. Signed-off-by: Srinivas Dasari <dasaris@codeaurora.org>
-rw-r--r--wpa_supplicant/sme.c37
1 files changed, 21 insertions, 16 deletions
diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c
index e2cc439..ded4087 100644
--- a/wpa_supplicant/sme.c
+++ b/wpa_supplicant/sme.c
@@ -932,21 +932,23 @@ static int sme_external_auth_build_buf(struct wpabuf *buf,
}
-static void sme_external_auth_send_sae_commit(struct wpa_supplicant *wpa_s,
- const u8 *bssid,
- struct wpa_ssid *ssid)
+static int sme_external_auth_send_sae_commit(struct wpa_supplicant *wpa_s,
+ const u8 *bssid,
+ struct wpa_ssid *ssid)
{
struct wpabuf *resp, *buf;
resp = sme_auth_build_sae_commit(wpa_s, ssid, bssid, 1, 0);
- if (!resp)
- return;
+ if (!resp) {
+ wpa_printf(MSG_DEBUG, "SAE: Failed to build SAE commit");
+ return -1;
+ }
wpa_s->sme.sae.state = SAE_COMMITTED;
buf = wpabuf_alloc(4 + SAE_COMMIT_MAX_LEN + wpabuf_len(resp));
if (!buf) {
wpabuf_free(resp);
- return;
+ return -1;
}
wpa_s->sme.seq_num++;
@@ -955,6 +957,8 @@ static void sme_external_auth_send_sae_commit(struct wpa_supplicant *wpa_s,
wpa_drv_send_mlme(wpa_s, wpabuf_head(buf), wpabuf_len(buf), 1, 0);
wpabuf_free(resp);
wpabuf_free(buf);
+
+ return 0;
}
@@ -972,8 +976,8 @@ static void sme_send_external_auth_status(struct wpa_supplicant *wpa_s,
}
-static void sme_handle_external_auth_start(struct wpa_supplicant *wpa_s,
- union wpa_event_data *data)
+static int sme_handle_external_auth_start(struct wpa_supplicant *wpa_s,
+ union wpa_event_data *data)
{
struct wpa_ssid *ssid;
size_t ssid_str_len = data->external_auth.ssid_len;
@@ -987,13 +991,12 @@ static void sme_handle_external_auth_start(struct wpa_supplicant *wpa_s,
(ssid->key_mgmt & (WPA_KEY_MGMT_SAE | WPA_KEY_MGMT_FT_SAE)))
break;
}
- if (ssid)
- sme_external_auth_send_sae_commit(wpa_s,
- data->external_auth.bssid,
- ssid);
- else
- sme_send_external_auth_status(wpa_s,
- WLAN_STATUS_UNSPECIFIED_FAILURE);
+ if (!ssid ||
+ sme_external_auth_send_sae_commit(wpa_s, data->external_auth.bssid,
+ ssid) < 0)
+ return -1;
+
+ return 0;
}
@@ -1043,7 +1046,9 @@ void sme_external_auth_trigger(struct wpa_supplicant *wpa_s,
wpa_s->sme.sae.state = SAE_NOTHING;
wpa_s->sme.sae.send_confirm = 0;
wpa_s->sme.sae_group_index = 0;
- sme_handle_external_auth_start(wpa_s, data);
+ if (sme_handle_external_auth_start(wpa_s, data) < 0)
+ sme_send_external_auth_status(wpa_s,
+ WLAN_STATUS_UNSPECIFIED_FAILURE);
} else if (data->external_auth.action == EXT_AUTH_ABORT) {
/* Report failure to driver for the wrong trigger */
sme_send_external_auth_status(wpa_s,