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 <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2016-10-22 17:11:11 +03:00 committed by Jouni Malinen
parent 6eb1a569ca
commit ce16c489d8
6 changed files with 22 additions and 21 deletions

View file

@ -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

View file

@ -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;
};
/**

View file

@ -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)

View file

@ -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);

View file

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

View file

@ -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, &params);