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>
This commit is contained in:
Srinivas Dasari 2019-05-16 14:51:36 +05:30 committed by Jouni Malinen
parent 2552a3735a
commit fb6ebd1ced

View file

@ -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, static int sme_external_auth_send_sae_commit(struct wpa_supplicant *wpa_s,
const u8 *bssid, const u8 *bssid,
struct wpa_ssid *ssid) struct wpa_ssid *ssid)
{ {
struct wpabuf *resp, *buf; struct wpabuf *resp, *buf;
resp = sme_auth_build_sae_commit(wpa_s, ssid, bssid, 1, 0); resp = sme_auth_build_sae_commit(wpa_s, ssid, bssid, 1, 0);
if (!resp) if (!resp) {
return; wpa_printf(MSG_DEBUG, "SAE: Failed to build SAE commit");
return -1;
}
wpa_s->sme.sae.state = SAE_COMMITTED; wpa_s->sme.sae.state = SAE_COMMITTED;
buf = wpabuf_alloc(4 + SAE_COMMIT_MAX_LEN + wpabuf_len(resp)); buf = wpabuf_alloc(4 + SAE_COMMIT_MAX_LEN + wpabuf_len(resp));
if (!buf) { if (!buf) {
wpabuf_free(resp); wpabuf_free(resp);
return; return -1;
} }
wpa_s->sme.seq_num++; 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); wpa_drv_send_mlme(wpa_s, wpabuf_head(buf), wpabuf_len(buf), 1, 0);
wpabuf_free(resp); wpabuf_free(resp);
wpabuf_free(buf); wpabuf_free(buf);
return 0;
} }
@ -972,7 +976,7 @@ static void sme_send_external_auth_status(struct wpa_supplicant *wpa_s,
} }
static void sme_handle_external_auth_start(struct wpa_supplicant *wpa_s, static int sme_handle_external_auth_start(struct wpa_supplicant *wpa_s,
union wpa_event_data *data) union wpa_event_data *data)
{ {
struct wpa_ssid *ssid; struct wpa_ssid *ssid;
@ -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))) (ssid->key_mgmt & (WPA_KEY_MGMT_SAE | WPA_KEY_MGMT_FT_SAE)))
break; break;
} }
if (ssid) if (!ssid ||
sme_external_auth_send_sae_commit(wpa_s, sme_external_auth_send_sae_commit(wpa_s, data->external_auth.bssid,
data->external_auth.bssid, ssid) < 0)
ssid); return -1;
else
sme_send_external_auth_status(wpa_s, return 0;
WLAN_STATUS_UNSPECIFIED_FAILURE);
} }
@ -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.state = SAE_NOTHING;
wpa_s->sme.sae.send_confirm = 0; wpa_s->sme.sae.send_confirm = 0;
wpa_s->sme.sae_group_index = 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) { } else if (data->external_auth.action == EXT_AUTH_ABORT) {
/* Report failure to driver for the wrong trigger */ /* Report failure to driver for the wrong trigger */
sme_send_external_auth_status(wpa_s, sme_send_external_auth_status(wpa_s,