From ce16c489d835a2f438bdd760e457e071ef1d8258 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 22 Oct 2016 17:11:11 +0300 Subject: [PATCH] Rename sae_data to more generic auth_data This makes it cleaner for the FILS implementation to use the same design for setting Authentication frame elements as was already done with SAE. Signed-off-by: Jouni Malinen --- src/common/privsep_commands.h | 4 ++-- src/drivers/driver.h | 11 ++++++----- src/drivers/driver_nl80211.c | 10 +++++----- src/drivers/driver_privsep.c | 6 +++--- wpa_supplicant/sme.c | 4 ++-- wpa_supplicant/wpa_priv.c | 8 ++++---- 6 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/common/privsep_commands.h b/src/common/privsep_commands.h index 8dff30382..f017f08e7 100644 --- a/src/common/privsep_commands.h +++ b/src/common/privsep_commands.h @@ -42,9 +42,9 @@ struct privsep_cmd_authenticate int wep_tx_keyidx; int local_state_change; int p2p; - size_t sae_data_len; + size_t auth_data_len; /* followed by ie_len bytes of ie */ - /* followed by sae_data_len bytes of sae_data */ + /* followed by auth_data_len bytes of auth_data */ }; struct privsep_cmd_associate diff --git a/src/drivers/driver.h b/src/drivers/driver.h index ea4a41f9f..8abb035d2 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -488,17 +488,18 @@ struct wpa_driver_auth_params { int p2p; /** - * sae_data - SAE elements for Authentication frame + * auth_data - Additional elements for Authentication frame * * This buffer starts with the Authentication transaction sequence - * number field. If SAE is not used, this pointer is %NULL. + * number field. If no special handling of such elements is needed, this + * pointer is %NULL. This is used with SAE and FILS. */ - const u8 *sae_data; + const u8 *auth_data; /** - * sae_data_len - Length of sae_data buffer in octets + * auth_data_len - Length of auth_data buffer in octets */ - size_t sae_data_len; + size_t auth_data_len; }; /** diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 1210d4356..5b2a3476f 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -3095,11 +3095,11 @@ retry: if (params->ie && nla_put(msg, NL80211_ATTR_IE, params->ie_len, params->ie)) goto fail; - if (params->sae_data) { - wpa_hexdump(MSG_DEBUG, " * SAE data", params->sae_data, - params->sae_data_len); - if (nla_put(msg, NL80211_ATTR_SAE_DATA, params->sae_data_len, - params->sae_data)) + if (params->auth_data) { + wpa_hexdump(MSG_DEBUG, " * auth_data", params->auth_data, + params->auth_data_len); + if (nla_put(msg, NL80211_ATTR_SAE_DATA, params->auth_data_len, + params->auth_data)) goto fail; } if (params->auth_alg & WPA_AUTH_ALG_OPEN) diff --git a/src/drivers/driver_privsep.c b/src/drivers/driver_privsep.c index 43d41937d..5d8503301 100644 --- a/src/drivers/driver_privsep.c +++ b/src/drivers/driver_privsep.c @@ -234,7 +234,7 @@ static int wpa_driver_privsep_authenticate( __func__, priv, params->freq, MAC2STR(params->bssid), params->auth_alg, params->local_state_change, params->p2p); - buflen = sizeof(*data) + params->ie_len + params->sae_data_len; + buflen = sizeof(*data) + params->ie_len + params->auth_data_len; data = os_zalloc(buflen); if (data == NULL) return -1; @@ -259,8 +259,8 @@ static int wpa_driver_privsep_authenticate( os_memcpy(pos, params->ie, params->ie_len); pos += params->ie_len; } - if (params->sae_data_len) - os_memcpy(pos, params->sae_data, params->sae_data_len); + if (params->auth_data_len) + os_memcpy(pos, params->auth_data, params->auth_data_len); res = wpa_priv_cmd(drv, PRIVSEP_CMD_AUTHENTICATE, data, buflen, NULL, NULL); diff --git a/wpa_supplicant/sme.c b/wpa_supplicant/sme.c index 61fd3b245..d830fca99 100644 --- a/wpa_supplicant/sme.c +++ b/wpa_supplicant/sme.c @@ -543,8 +543,8 @@ static void sme_send_authentication(struct wpa_supplicant *wpa_s, wpas_connection_failed(wpa_s, bss->bssid); return; } - params.sae_data = wpabuf_head(resp); - params.sae_data_len = wpabuf_len(resp); + params.auth_data = wpabuf_head(resp); + params.auth_data_len = wpabuf_len(resp); wpa_s->sme.sae.state = start ? SAE_COMMITTED : SAE_CONFIRMED; } #endif /* CONFIG_SAE */ diff --git a/wpa_supplicant/wpa_priv.c b/wpa_supplicant/wpa_priv.c index 511df4f18..b36d19539 100644 --- a/wpa_supplicant/wpa_priv.c +++ b/wpa_supplicant/wpa_priv.c @@ -218,7 +218,7 @@ static void wpa_priv_cmd_authenticate(struct wpa_priv_interface *iface, } auth = buf; - if (sizeof(*auth) + auth->ie_len + auth->sae_data_len > len) { + if (sizeof(*auth) + auth->ie_len + auth->auth_data_len > len) { wpa_printf(MSG_DEBUG, "Authentication request overflow"); return; } @@ -244,9 +244,9 @@ static void wpa_priv_cmd_authenticate(struct wpa_priv_interface *iface, params.ie = (u8 *) (auth + 1); params.ie_len = auth->ie_len; } - if (auth->sae_data_len) { - params.sae_data = ((u8 *) (auth + 1)) + auth->ie_len; - params.sae_data_len = auth->sae_data_len; + if (auth->auth_data_len) { + params.auth_data = ((u8 *) (auth + 1)) + auth->ie_len; + params.auth_data_len = auth->auth_data_len; } res = iface->driver->authenticate(iface->drv_priv, ¶ms);