ric_start = pos;
if (wpa_ft_parse_ies(req_ies, req_ies_len, &parse,
- sm->wpa_key_mgmt) == 0 && parse.ric) {
+ sm->wpa_key_mgmt, false) == 0 && parse.ric) {
pos = wpa_ft_process_ric(sm, pos, end, parse.ric,
parse.ric_len);
if (auth_alg == WLAN_AUTH_FT)
wpa_hexdump(MSG_DEBUG, "FT: Received authentication frame IEs",
ies, ies_len);
- if (wpa_ft_parse_ies(ies, ies_len, &parse, 0)) {
+ if (wpa_ft_parse_ies(ies, ies_len, &parse, 0, false)) {
wpa_printf(MSG_DEBUG, "FT: Failed to parse FT IEs");
return WLAN_STATUS_UNSPECIFIED_FAILURE;
}
wpa_hexdump(MSG_DEBUG, "FT: Reassoc Req IEs", ies, ies_len);
- if (wpa_ft_parse_ies(ies, ies_len, &parse, sm->wpa_key_mgmt) < 0) {
+ if (wpa_ft_parse_ies(ies, ies_len, &parse, sm->wpa_key_mgmt,
+ false) < 0) {
wpa_printf(MSG_DEBUG, "FT: Failed to parse FT IEs");
return WLAN_STATUS_UNSPECIFIED_FAILURE;
}
int wpa_ft_parse_ies(const u8 *ies, size_t ies_len, struct wpa_ft_ies *parse,
- int key_mgmt)
+ int key_mgmt, bool reassoc_resp)
{
const u8 *end, *pos;
struct wpa_ie_data data;
const u8 *fte = NULL;
size_t fte_len = 0;
bool is_fte = false;
+ struct ieee802_11_elems elems;
os_memset(parse, 0, sizeof(*parse));
if (ies == NULL)
return 0;
+ if (ieee802_11_parse_elems(ies, ies_len, &elems, 0) == ParseFailed) {
+ wpa_printf(MSG_DEBUG, "FT: Failed to parse elements");
+ return -1;
+ }
+
pos = ies;
end = ies + ies_len;
while (end - pos >= 2) {
* Check that the protected IE count matches with IEs included in the
* frame.
*/
- if (parse->rsn)
- prot_ie_count--;
+ if (reassoc_resp && elems.basic_mle) {
+ unsigned int link_id;
+
+ /* TODO: This count should be done based on all _requested_,
+ * not _accepted_ links. */
+ for (link_id = 0; link_id < MAX_NUM_MLO_LINKS; link_id++) {
+ if (parse->mlo_gtk[link_id]) {
+ if (parse->rsn)
+ prot_ie_count--;
+ if (parse->rsnxe)
+ prot_ie_count--;
+ }
+ }
+ } else {
+ if (parse->rsn)
+ prot_ie_count--;
+ if (parse->rsnxe)
+ prot_ie_count--;
+ }
if (parse->mdie)
prot_ie_count--;
if (parse->ftie)
prot_ie_count--;
- if (parse->rsnxe)
- prot_ie_count--;
if (prot_ie_count < 0) {
wpa_printf(MSG_DEBUG, "FT: Some required IEs not included in "
"the protected IE count");
#define WPA_PASN_PUBKEY_UNCOMPRESSED 0x04
int wpa_ft_parse_ies(const u8 *ies, size_t ies_len, struct wpa_ft_ies *parse,
- int key_mgmt);
+ int key_mgmt, bool reassoc_resp);
struct wpa_eapol_ie_parse {
const u8 *wpa_ie;
}
if (wpa_ft_parse_ies(pos, end - pos, &parse,
- sm->key_mgmt) < 0) {
+ sm->key_mgmt, false) < 0) {
wpa_printf(MSG_DEBUG, "FILS+FT: Failed to parse IEs");
goto fail;
}
return 0;
}
- if (wpa_ft_parse_ies(ies, ies_len, &ft, sm->key_mgmt) < 0)
+ if (wpa_ft_parse_ies(ies, ies_len, &ft, sm->key_mgmt, false) < 0)
return -1;
if (ft.mdie_len < MOBILITY_DOMAIN_ID_LEN + 1)
return -1;
}
- if (wpa_ft_parse_ies(ies, ies_len, &parse, sm->key_mgmt) < 0) {
+ if (wpa_ft_parse_ies(ies, ies_len, &parse, sm->key_mgmt,
+ !ft_action) < 0) {
wpa_printf(MSG_DEBUG, "FT: Failed to parse IEs");
return -1;
}
return 0;
}
- if (wpa_ft_parse_ies(ies, ies_len, &parse, sm->key_mgmt) < 0) {
+ if (wpa_ft_parse_ies(ies, ies_len, &parse, sm->key_mgmt, true) < 0) {
wpa_printf(MSG_DEBUG, "FT: Failed to parse IEs");
return -1;
}
if (wpa_ft_parse_ies(mgmt->u.auth.variable,
len - IEEE80211_HDRLEN - sizeof(mgmt->u.auth),
- &parse, 0)) {
+ &parse, 0, false)) {
add_note(wt, MSG_INFO,
"Could not parse FT Authentication Response frame");
return;
sta->state = STATE3;
}
- if (wpa_ft_parse_ies(ies, ies_len, &parse, 0) == 0) {
+ if (wpa_ft_parse_ies(ies, ies_len, &parse, 0, false) == 0) {
if (parse.r0kh_id) {
os_memcpy(bss->r0kh_id, parse.r0kh_id,
parse.r0kh_id_len);
use_sha384 = wpa_key_mgmt_sha384(sta->key_mgmt);
- if (wpa_ft_parse_ies(ie, ie_len, &parse, sta->key_mgmt) < 0) {
+ if (wpa_ft_parse_ies(ie, ie_len, &parse, sta->key_mgmt,
+ false) < 0) {
add_note(wt, MSG_INFO, "FT: Failed to parse FT IEs");
return;
}
use_sha384 = wpa_key_mgmt_sha384(sta->key_mgmt);
- if (wpa_ft_parse_ies(ies, ies_len, &parse, sta->key_mgmt) < 0) {
+ if (wpa_ft_parse_ies(ies, ies_len, &parse, sta->key_mgmt,
+ true) < 0) {
add_note(wt, MSG_INFO, "FT: Failed to parse FT IEs");
return;
}
ies_len = len - (24 + 2 + 2 * ETH_ALEN);
wpa_hexdump(MSG_DEBUG, "FT Request frame body", ies, ies_len);
- if (wpa_ft_parse_ies(ies, ies_len, &parse, 0)) {
+ if (wpa_ft_parse_ies(ies, ies_len, &parse, 0, false)) {
add_note(wt, MSG_INFO, "Could not parse FT Request frame body");
return;
}
ies_len = len - (24 + 2 + 2 * ETH_ALEN);
wpa_hexdump(MSG_DEBUG, "FT Response frame body", ies, ies_len);
- if (wpa_ft_parse_ies(ies, ies_len, &parse, 0)) {
+ if (wpa_ft_parse_ies(ies, ies_len, &parse, 0, false)) {
add_note(wt, MSG_INFO,
"Could not parse FT Response frame body");
return;