Revert "Cumulative patch from commit 4ec1fd8e42bad9390f14a58225b6e5f6fb691950"
This reverts commit 78a5dac804c22aa6e4ec8226a864d3b0d6ccddbb.
Test: None
diff --git a/src/ap/Makefile b/src/ap/Makefile
index 3b01e63..98788fe 100644
--- a/src/ap/Makefile
+++ b/src/ap/Makefile
@@ -12,7 +12,7 @@
CFLAGS += -DNEED_AP_MLME
CFLAGS += -DCONFIG_HS20
CFLAGS += -DCONFIG_INTERWORKING
-CFLAGS += -DCONFIG_IEEE80211R_AP
+CFLAGS += -DCONFIG_IEEE80211R
CFLAGS += -DCONFIG_IEEE80211W
CFLAGS += -DCONFIG_WPS
CFLAGS += -DCONFIG_PROXYARP
diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c
index c986574..228de2b 100644
--- a/src/ap/ap_config.c
+++ b/src/ap/ap_config.c
@@ -88,9 +88,9 @@
/* Set to -1 as defaults depends on HT in setup */
bss->wmm_enabled = -1;
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
bss->ft_over_ds = 1;
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
bss->radius_das_time_window = 300;
@@ -477,7 +477,7 @@
hostapd_config_free_vlan(conf);
os_free(conf->time_zone);
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
{
struct ft_remote_r0kh *r0kh, *r0kh_prev;
struct ft_remote_r1kh *r1kh, *r1kh_prev;
@@ -498,7 +498,7 @@
os_free(r1kh_prev);
}
}
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
#ifdef CONFIG_WPS
os_free(conf->wps_pin_requests);
@@ -802,7 +802,7 @@
}
}
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
if (full_config && wpa_key_mgmt_ft(bss->wpa_key_mgmt) &&
(bss->nas_identifier == NULL ||
os_strlen(bss->nas_identifier) < 1 ||
@@ -812,7 +812,7 @@
"string");
return -1;
}
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
#ifdef CONFIG_IEEE80211N
if (full_config && conf->ieee80211n &&
@@ -848,16 +848,6 @@
wpa_printf(MSG_ERROR,
"VHT (IEEE 802.11ac) with WEP is not allowed, disabling VHT capabilities");
}
-
- if (full_config && conf->ieee80211ac && bss->wpa &&
- !(bss->wpa_pairwise & WPA_CIPHER_CCMP) &&
- !(bss->rsn_pairwise & (WPA_CIPHER_CCMP | WPA_CIPHER_GCMP |
- WPA_CIPHER_CCMP_256 | WPA_CIPHER_GCMP_256)))
- {
- bss->disable_11ac = 1;
- wpa_printf(MSG_ERROR,
- "VHT (IEEE 802.11ac) with WPA/WPA2 requires CCMP/GCMP to be enabled, disabling VHT capabilities");
- }
#endif /* CONFIG_IEEE80211AC */
#ifdef CONFIG_WPS
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
index cace34c..8c8f7e2 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@@ -329,7 +329,7 @@
char *rsn_preauth_interfaces;
int peerkey;
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
/* IEEE 802.11r - Fast BSS Transition */
u8 mobility_domain[MOBILITY_DOMAIN_ID_LEN];
u8 r1_key_holder[FT_R1KH_ID_LEN];
@@ -339,8 +339,7 @@
struct ft_remote_r1kh *r1kh_list;
int pmk_r1_push;
int ft_over_ds;
- int ft_psk_generate_local;
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
char *ctrl_interface; /* directory for UNIX domain sockets */
#ifndef CONFIG_NATIVE_WINDOWS
@@ -596,11 +595,6 @@
int ftm_responder;
int ftm_initiator;
-
-#ifdef CONFIG_FILS
- u8 fils_cache_id[FILS_CACHE_ID_LEN];
- int fils_cache_id_set;
-#endif /* CONFIG_FILS */
};
@@ -713,7 +707,6 @@
struct wpabuf *lci;
struct wpabuf *civic;
- int stationary_ap;
};
diff --git a/src/ap/ap_mlme.c b/src/ap/ap_mlme.c
index db8a267..e7308a0 100644
--- a/src/ap/ap_mlme.c
+++ b/src/ap/ap_mlme.c
@@ -57,11 +57,7 @@
HOSTAPD_LEVEL_DEBUG,
"MLME-AUTHENTICATE.indication(" MACSTR ", %s)",
MAC2STR(sta->addr), mlme_auth_alg_str(sta->auth_alg));
- if (sta->auth_alg != WLAN_AUTH_FT &&
- sta->auth_alg != WLAN_AUTH_FILS_SK &&
- sta->auth_alg != WLAN_AUTH_FILS_SK_PFS &&
- sta->auth_alg != WLAN_AUTH_FILS_PK &&
- !(sta->flags & WLAN_STA_MFP))
+ if (sta->auth_alg != WLAN_AUTH_FT && !(sta->flags & WLAN_STA_MFP))
mlme_deletekeys_request(hapd, sta);
ap_sta_clear_disconnect_timeouts(hapd, sta);
}
@@ -109,10 +105,7 @@
HOSTAPD_LEVEL_DEBUG,
"MLME-ASSOCIATE.indication(" MACSTR ")",
MAC2STR(sta->addr));
- if (sta->auth_alg != WLAN_AUTH_FT &&
- sta->auth_alg != WLAN_AUTH_FILS_SK &&
- sta->auth_alg != WLAN_AUTH_FILS_SK_PFS &&
- sta->auth_alg != WLAN_AUTH_FILS_PK)
+ if (sta->auth_alg != WLAN_AUTH_FT)
mlme_deletekeys_request(hapd, sta);
ap_sta_clear_disconnect_timeouts(hapd, sta);
}
@@ -137,10 +130,7 @@
HOSTAPD_LEVEL_DEBUG,
"MLME-REASSOCIATE.indication(" MACSTR ")",
MAC2STR(sta->addr));
- if (sta->auth_alg != WLAN_AUTH_FT &&
- sta->auth_alg != WLAN_AUTH_FILS_SK &&
- sta->auth_alg != WLAN_AUTH_FILS_SK_PFS &&
- sta->auth_alg != WLAN_AUTH_FILS_PK)
+ if (sta->auth_alg != WLAN_AUTH_FT)
mlme_deletekeys_request(hapd, sta);
ap_sta_clear_disconnect_timeouts(hapd, sta);
}
diff --git a/src/ap/beacon.c b/src/ap/beacon.c
index 811bede..233320d 100644
--- a/src/ap/beacon.c
+++ b/src/ap/beacon.c
@@ -491,11 +491,6 @@
pos = hostapd_eid_txpower_envelope(hapd, pos);
pos = hostapd_eid_wb_chsw_wrapper(hapd, pos);
}
-#endif /* CONFIG_IEEE80211AC */
-
- pos = hostapd_eid_fils_indic(hapd, pos, 0);
-
-#ifdef CONFIG_IEEE80211AC
if (hapd->conf->vendor_vht)
pos = hostapd_eid_vendor_vht(hapd, pos);
#endif /* CONFIG_IEEE80211AC */
@@ -623,7 +618,7 @@
}
-void sta_track_add(struct hostapd_iface *iface, const u8 *addr, int ssi_signal)
+void sta_track_add(struct hostapd_iface *iface, const u8 *addr)
{
struct hostapd_sta_info *info;
@@ -633,7 +628,6 @@
dl_list_del(&info->list);
dl_list_add_tail(&iface->sta_seen, &info->list);
os_get_reltime(&info->last_seen);
- info->ssi_signal = ssi_signal;
return;
}
@@ -643,7 +637,6 @@
return;
os_memcpy(info->addr, addr, ETH_ALEN);
os_get_reltime(&info->last_seen);
- info->ssi_signal = ssi_signal;
if (iface->num_sta_seen >= iface->conf->track_sta_max_num) {
/* Expire oldest entry to make room for a new one */
@@ -719,7 +712,7 @@
return;
ie = ((const u8 *) mgmt) + IEEE80211_HDRLEN;
if (hapd->iconf->track_sta_max_num)
- sta_track_add(hapd->iface, mgmt->sa, ssi_signal);
+ sta_track_add(hapd->iface, mgmt->sa);
ie_len = len - IEEE80211_HDRLEN;
for (i = 0; hapd->probereq_cb && i < hapd->num_probereq_cb; i++)
@@ -1162,11 +1155,6 @@
tailpos = hostapd_eid_txpower_envelope(hapd, tailpos);
tailpos = hostapd_eid_wb_chsw_wrapper(hapd, tailpos);
}
-#endif /* CONFIG_IEEE80211AC */
-
- tailpos = hostapd_eid_fils_indic(hapd, tailpos, 0);
-
-#ifdef CONFIG_IEEE80211AC
if (hapd->conf->vendor_vht)
tailpos = hostapd_eid_vendor_vht(hapd, tailpos);
#endif /* CONFIG_IEEE80211AC */
diff --git a/src/ap/beacon.h b/src/ap/beacon.h
index a26e308..fc71181 100644
--- a/src/ap/beacon.h
+++ b/src/ap/beacon.h
@@ -21,7 +21,7 @@
int ieee802_11_build_ap_params(struct hostapd_data *hapd,
struct wpa_driver_ap_params *params);
void ieee802_11_free_ap_params(struct wpa_driver_ap_params *params);
-void sta_track_add(struct hostapd_iface *iface, const u8 *addr, int ssi_signal);
+void sta_track_add(struct hostapd_iface *iface, const u8 *addr);
void sta_track_del(struct hostapd_sta_info *info);
void sta_track_expire(struct hostapd_iface *iface, int force);
struct hostapd_data *
diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
index f69c655..3552b3e 100644
--- a/src/ap/drv_callbacks.c
+++ b/src/ap/drv_callbacks.c
@@ -45,10 +45,10 @@
struct ieee802_11_elems elems;
const u8 *ie;
size_t ielen;
-#if defined(CONFIG_IEEE80211R_AP) || defined(CONFIG_IEEE80211W)
+#if defined(CONFIG_IEEE80211R) || defined(CONFIG_IEEE80211W)
u8 buf[sizeof(struct ieee80211_mgmt) + 1024];
u8 *p = buf;
-#endif /* CONFIG_IEEE80211R_AP || CONFIG_IEEE80211W */
+#endif /* CONFIG_IEEE80211R || CONFIG_IEEE80211W */
u16 reason = WLAN_REASON_UNSPECIFIED;
u16 status = WLAN_STATUS_SUCCESS;
const u8 *p2p_dev_addr = NULL;
@@ -293,7 +293,7 @@
sta->flags &= ~WLAN_STA_MFP;
#endif /* CONFIG_IEEE80211W */
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
if (sta->auth_alg == WLAN_AUTH_FT) {
status = wpa_ft_validate_reassoc(sta->wpa_sm, req_ies,
req_ies_len);
@@ -307,7 +307,7 @@
goto fail;
}
}
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
} else if (hapd->conf->wps_state) {
#ifdef CONFIG_WPS
struct wpabuf *wps;
@@ -375,7 +375,7 @@
skip_wpa_check:
#endif /* CONFIG_WPS */
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
p = wpa_sm_write_assoc_resp_ies(sta->wpa_sm, buf, sizeof(buf),
sta->auth_alg, req_ies, req_ies_len);
@@ -383,11 +383,11 @@
if (sta->auth_alg == WLAN_AUTH_FT)
ap_sta_set_authorized(hapd, sta, 1);
-#else /* CONFIG_IEEE80211R_AP */
+#else /* CONFIG_IEEE80211R */
/* Keep compiler silent about unused variables */
if (status) {
}
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
new_assoc = (sta->flags & WLAN_STA_ASSOC) == 0;
sta->flags |= WLAN_STA_AUTH | WLAN_STA_ASSOC;
@@ -414,9 +414,9 @@
return 0;
fail:
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
hostapd_sta_assoc(hapd, addr, reassoc, status, buf, p - buf);
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
hostapd_drv_sta_disassoc(hapd, sta->addr, reason);
ap_free_sta(hapd, sta);
return -1;
@@ -471,7 +471,8 @@
HOSTAPD_LEVEL_INFO,
"disconnected due to excessive missing ACKs");
hostapd_drv_sta_disassoc(hapd, addr, WLAN_REASON_DISASSOC_LOW_ACK);
- ap_sta_disassociate(hapd, sta, WLAN_REASON_DISASSOC_LOW_ACK);
+ if (sta)
+ ap_sta_disassociate(hapd, sta, WLAN_REASON_DISASSOC_LOW_ACK);
}
@@ -689,7 +690,7 @@
#ifdef HOSTAPD
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
static void hostapd_notify_auth_ft_finish(void *ctx, const u8 *dst,
const u8 *bssid,
u16 auth_transaction, u16 status,
@@ -708,7 +709,7 @@
hostapd_sta_auth(hapd, dst, auth_transaction, status, ies, ies_len);
}
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
static void hostapd_notif_auth(struct hostapd_data *hapd,
@@ -729,7 +730,7 @@
}
sta->flags &= ~WLAN_STA_PREAUTH;
ieee802_1x_notify_pre_auth(sta->eapol_sm, 0);
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
if (rx_auth->auth_type == WLAN_AUTH_FT && hapd->wpa_auth) {
sta->auth_alg = WLAN_AUTH_FT;
if (sta->wpa_sm == NULL)
@@ -747,7 +748,7 @@
hostapd_notify_auth_ft_finish, hapd);
return;
}
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
fail:
hostapd_sta_auth(hapd, rx_auth->peer, rx_auth->auth_transaction + 1,
status, resp_ies, resp_ies_len);
@@ -780,13 +781,13 @@
wpa_printf(MSG_DEBUG, "%s: station not found", __func__);
return;
}
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
if (mgmt->u.action.category == WLAN_ACTION_FT) {
const u8 *payload = drv_mgmt->frame + 24 + 1;
wpa_ft_action_rx(sta->wpa_sm, payload, plen);
}
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
#ifdef CONFIG_IEEE80211W
if (mgmt->u.action.category == WLAN_ACTION_SA_QUERY && plen >= 4) {
ieee802_11_sa_query_action(
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index 21a5408..9fafc7f 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -956,10 +956,10 @@
if (conf->wmm_enabled < 0)
conf->wmm_enabled = hapd->iconf->ieee80211n;
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
if (is_zero_ether_addr(conf->r1_key_holder))
os_memcpy(conf->r1_key_holder, hapd->own_addr, ETH_ALEN);
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
#ifdef CONFIG_MESH
if (hapd->iface->mconf == NULL)
@@ -1561,7 +1561,7 @@
int vht = hapd->iconf->ieee80211ac && !hapd->conf->disable_11ac;
struct wpa_ssid_value ssid;
u8 channel, op_class;
- u8 center_freq1_idx = 0, center_freq2_idx = 0;
+ int center_freq1 = 0, center_freq2 = 0;
enum nr_chan_width width;
u32 bssid_info;
struct wpabuf *nr;
@@ -1604,14 +1604,16 @@
&op_class, &channel);
width = hostapd_get_nr_chan_width(hapd, ht, vht);
if (vht) {
- center_freq1_idx = hapd->iconf->vht_oper_centr_freq_seg0_idx;
+ center_freq1 = ieee80211_chan_to_freq(
+ NULL, op_class,
+ hapd->iconf->vht_oper_centr_freq_seg0_idx);
if (width == NR_CHAN_WIDTH_80P80)
- center_freq2_idx =
- hapd->iconf->vht_oper_centr_freq_seg1_idx;
+ center_freq2 = ieee80211_chan_to_freq(
+ NULL, op_class,
+ hapd->iconf->vht_oper_centr_freq_seg1_idx);
} else if (ht) {
- ieee80211_freq_to_chan(hapd->iface->freq +
- 10 * hapd->iconf->secondary_channel,
- ¢er_freq1_idx);
+ center_freq1 = hapd->iface->freq +
+ 10 * hapd->iconf->secondary_channel;
}
ssid.ssid_len = hapd->conf->ssid.ssid_len;
@@ -1639,11 +1641,11 @@
wpabuf_put_u8(nr, WNM_NEIGHBOR_WIDE_BW_CHAN);
wpabuf_put_u8(nr, 3);
wpabuf_put_u8(nr, width);
- wpabuf_put_u8(nr, center_freq1_idx);
- wpabuf_put_u8(nr, center_freq2_idx);
+ wpabuf_put_u8(nr, center_freq1);
+ wpabuf_put_u8(nr, center_freq2);
hostapd_neighbor_set(hapd, hapd->own_addr, &ssid, nr, hapd->iconf->lci,
- hapd->iconf->civic, hapd->iconf->stationary_ap);
+ hapd->iconf->civic);
wpabuf_free(nr);
#endif /* NEED_AP_MLME */
diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
index fd5aaed..dec46f6 100644
--- a/src/ap/hostapd.h
+++ b/src/ap/hostapd.h
@@ -109,7 +109,6 @@
struct wpabuf *civic;
/* LCI update time */
struct os_time lci_date;
- int stationary;
};
/**
@@ -312,7 +311,6 @@
struct dl_list list;
u8 addr[ETH_ALEN];
struct os_reltime last_seen;
- int ssi_signal;
#ifdef CONFIG_TAXONOMY
struct wpabuf *probe_ie_taxonomy;
#endif /* CONFIG_TAXONOMY */
diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
index 0b3d2f2..f1c396b 100644
--- a/src/ap/ieee802_11.c
+++ b/src/ap/ieee802_11.c
@@ -303,7 +303,7 @@
}
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
static void handle_auth_ft_finish(void *ctx, const u8 *dst, const u8 *bssid,
u16 auth_transaction, u16 status,
const u8 *ies, size_t ies_len)
@@ -334,7 +334,7 @@
sta->flags |= WLAN_STA_AUTH;
mlme_authenticate_indication(hapd, sta);
}
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
#ifdef CONFIG_SAE
@@ -619,7 +619,7 @@
* message now to get alternating sequence of
* Authentication frames between the AP and STA.
* Confirm will be sent in
- * Committed -> Confirmed/Accepted transition
+ * Commited -> Confirmed/Accepted transition
* when receiving Confirm from STA.
*/
}
@@ -980,318 +980,6 @@
#endif /* CONFIG_SAE */
-static u16 wpa_res_to_status_code(int res)
-{
- if (res == WPA_INVALID_GROUP)
- return WLAN_STATUS_GROUP_CIPHER_NOT_VALID;
- if (res == WPA_INVALID_PAIRWISE)
- return WLAN_STATUS_PAIRWISE_CIPHER_NOT_VALID;
- if (res == WPA_INVALID_AKMP)
- return WLAN_STATUS_AKMP_NOT_VALID;
- if (res == WPA_ALLOC_FAIL)
- return WLAN_STATUS_UNSPECIFIED_FAILURE;
-#ifdef CONFIG_IEEE80211W
- if (res == WPA_MGMT_FRAME_PROTECTION_VIOLATION)
- return WLAN_STATUS_ROBUST_MGMT_FRAME_POLICY_VIOLATION;
- if (res == WPA_INVALID_MGMT_GROUP_CIPHER)
- return WLAN_STATUS_ROBUST_MGMT_FRAME_POLICY_VIOLATION;
-#endif /* CONFIG_IEEE80211W */
- if (res == WPA_INVALID_MDIE)
- return WLAN_STATUS_INVALID_MDIE;
- if (res != WPA_IE_OK)
- return WLAN_STATUS_INVALID_IE;
- return WLAN_STATUS_SUCCESS;
-}
-
-
-#ifdef CONFIG_FILS
-
-static void handle_auth_fils_finish(struct hostapd_data *hapd,
- struct sta_info *sta, u16 resp,
- struct rsn_pmksa_cache_entry *pmksa,
- struct wpabuf *erp_resp,
- const u8 *msk, size_t msk_len);
-
-static void handle_auth_fils(struct hostapd_data *hapd, struct sta_info *sta,
- const struct ieee80211_mgmt *mgmt, size_t len,
- u16 auth_transaction, u16 status_code)
-{
- u16 resp = WLAN_STATUS_SUCCESS;
- const u8 *pos, *end;
- struct ieee802_11_elems elems;
- int res;
- struct wpa_ie_data rsn;
- struct rsn_pmksa_cache_entry *pmksa = NULL;
-
- if (auth_transaction != 1 || status_code != WLAN_STATUS_SUCCESS)
- return;
-
- pos = mgmt->u.auth.variable;
- end = ((const u8 *) mgmt) + len;
-
- wpa_hexdump(MSG_DEBUG, "FILS: Authentication frame fields",
- pos, end - pos);
-
- /* TODO: Finite Cyclic Group when using PK or PFS */
- /* TODO: Element when using PK or PFS */
-
- wpa_hexdump(MSG_DEBUG, "FILS: Remaining IEs", pos, end - pos);
- if (ieee802_11_parse_elems(pos, end - pos, &elems, 1) == ParseFailed) {
- wpa_printf(MSG_DEBUG, "FILS: Could not parse elements");
- resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
- goto fail;
- }
-
- /* RSNE */
- wpa_hexdump(MSG_DEBUG, "FILS: RSN element",
- elems.rsn_ie, elems.rsn_ie_len);
- if (!elems.rsn_ie ||
- wpa_parse_wpa_ie_rsn(elems.rsn_ie - 2, elems.rsn_ie_len + 2,
- &rsn) < 0) {
- wpa_printf(MSG_DEBUG, "FILS: No valid RSN element");
- resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
- goto fail;
- }
-
- if (!sta->wpa_sm)
- sta->wpa_sm = wpa_auth_sta_init(hapd->wpa_auth, sta->addr,
- NULL);
- if (!sta->wpa_sm) {
- wpa_printf(MSG_DEBUG,
- "FILS: Failed to initialize RSN state machine");
- resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
- goto fail;
- }
-
- res = wpa_validate_wpa_ie(hapd->wpa_auth, sta->wpa_sm,
- elems.rsn_ie - 2, elems.rsn_ie_len + 2,
- elems.mdie, elems.mdie_len);
- resp = wpa_res_to_status_code(res);
- if (resp != WLAN_STATUS_SUCCESS)
- goto fail;
-
- /* TODO: MDE when using FILS+FT */
- /* TODO: FTE when using FILS+FT */
-
- if (!elems.fils_nonce) {
- wpa_printf(MSG_DEBUG, "FILS: No FILS Nonce field");
- resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
- goto fail;
- }
- wpa_hexdump(MSG_DEBUG, "FILS: SNonce", elems.fils_nonce,
- FILS_NONCE_LEN);
- os_memcpy(sta->fils_snonce, elems.fils_nonce, FILS_NONCE_LEN);
-
- /* PMKID List */
- if (rsn.pmkid && rsn.num_pmkid > 0) {
- u8 num;
- const u8 *pmkid;
-
- wpa_hexdump(MSG_DEBUG, "FILS: PMKID List",
- rsn.pmkid, rsn.num_pmkid * PMKID_LEN);
-
- pmkid = rsn.pmkid;
- num = rsn.num_pmkid;
- while (num) {
- wpa_hexdump(MSG_DEBUG, "FILS: PMKID", pmkid, PMKID_LEN);
- pmksa = wpa_auth_pmksa_get(hapd->wpa_auth, sta->addr,
- pmkid);
- if (pmksa)
- break;
- pmkid += PMKID_LEN;
- num--;
- }
- }
- if (pmksa && wpa_auth_sta_key_mgmt(sta->wpa_sm) != pmksa->akmp) {
- wpa_printf(MSG_DEBUG,
- "FILS: Matching PMKSA cache entry has different AKMP (0x%x != 0x%x) - ignore",
- wpa_auth_sta_key_mgmt(sta->wpa_sm), pmksa->akmp);
- pmksa = NULL;
- }
- if (pmksa)
- wpa_printf(MSG_DEBUG, "FILS: Found matching PMKSA cache entry");
-
- /* FILS Session */
- if (!elems.fils_session) {
- wpa_printf(MSG_DEBUG, "FILS: No FILS Session element");
- resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
- goto fail;
- }
- wpa_hexdump(MSG_DEBUG, "FILS: FILS Session", elems.fils_session,
- FILS_SESSION_LEN);
- os_memcpy(sta->fils_session, elems.fils_session, FILS_SESSION_LEN);
-
- /* FILS Wrapped Data */
- if (elems.fils_wrapped_data) {
- wpa_hexdump(MSG_DEBUG, "FILS: Wrapped Data",
- elems.fils_wrapped_data,
- elems.fils_wrapped_data_len);
- if (!pmksa) {
-#ifndef CONFIG_NO_RADIUS
- if (!sta->eapol_sm) {
- sta->eapol_sm =
- ieee802_1x_alloc_eapol_sm(hapd, sta);
- }
- wpa_printf(MSG_DEBUG,
- "FILS: Forward EAP-Identity/Re-auth Start to authentication server");
- ieee802_1x_encapsulate_radius(
- hapd, sta, elems.fils_wrapped_data,
- elems.fils_wrapped_data_len);
- wpa_printf(MSG_DEBUG,
- "FILS: Will send Authentication frame once the response from authentication server is available");
- sta->flags |= WLAN_STA_PENDING_FILS_ERP;
- return;
-#else /* CONFIG_NO_RADIUS */
- resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
- goto fail;
-#endif /* CONFIG_NO_RADIUS */
- }
- }
-
-fail:
- handle_auth_fils_finish(hapd, sta, resp, pmksa, NULL, NULL, 0);
-}
-
-
-static void handle_auth_fils_finish(struct hostapd_data *hapd,
- struct sta_info *sta, u16 resp,
- struct rsn_pmksa_cache_entry *pmksa,
- struct wpabuf *erp_resp,
- const u8 *msk, size_t msk_len)
-{
- u8 fils_nonce[FILS_NONCE_LEN];
- size_t ielen;
- struct wpabuf *data = NULL;
- const u8 *ie;
- u8 *ie_buf = NULL;
- const u8 *pmk = NULL;
- size_t pmk_len = 0;
-
- if (resp != WLAN_STATUS_SUCCESS)
- goto fail;
-
- ie = wpa_auth_get_wpa_ie(hapd->wpa_auth, &ielen);
- if (!ie) {
- resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
- goto fail;
- }
- if (pmksa) {
- /* Add PMKID of the selected PMKSA into RSNE */
- ie_buf = os_malloc(ielen + 2 + 2 + PMKID_LEN);
- if (!ie_buf) {
- resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
- goto fail;
- }
- os_memcpy(ie_buf, ie, ielen);
- if (wpa_insert_pmkid(ie_buf, &ielen, pmksa->pmkid) < 0) {
- resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
- goto fail;
- }
- ie = ie_buf;
- }
-
- if (random_get_bytes(fils_nonce, FILS_NONCE_LEN) < 0) {
- resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
- goto fail;
- }
- wpa_hexdump(MSG_DEBUG, "RSN: Generated FILS Nonce",
- fils_nonce, FILS_NONCE_LEN);
-
- data = wpabuf_alloc(1000 + ielen);
- if (!data) {
- resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
- goto fail;
- }
-
- /* TODO: Finite Cyclic Group when using PK or PFS */
- /* TODO: Element when using PK or PFS */
-
- /* RSNE */
- wpabuf_put_data(data, ie, ielen);
-
- /* TODO: MDE when using FILS+FT */
- /* TODO: FTE when using FILS+FT */
-
- /* FILS Nonce */
- wpabuf_put_u8(data, WLAN_EID_EXTENSION); /* Element ID */
- wpabuf_put_u8(data, 1 + FILS_NONCE_LEN); /* Length */
- /* Element ID Extension */
- wpabuf_put_u8(data, WLAN_EID_EXT_FILS_NONCE);
- wpabuf_put_data(data, fils_nonce, FILS_NONCE_LEN);
-
- /* FILS Session */
- wpabuf_put_u8(data, WLAN_EID_EXTENSION); /* Element ID */
- wpabuf_put_u8(data, 1 + FILS_SESSION_LEN); /* Length */
- /* Element ID Extension */
- wpabuf_put_u8(data, WLAN_EID_EXT_FILS_SESSION);
- wpabuf_put_data(data, sta->fils_session, FILS_SESSION_LEN);
-
- /* FILS Wrapped Data */
- if (!pmksa && erp_resp) {
- wpabuf_put_u8(data, WLAN_EID_EXTENSION); /* Element ID */
- wpabuf_put_u8(data, 1 + wpabuf_len(erp_resp)); /* Length */
- /* Element ID Extension */
- wpabuf_put_u8(data, WLAN_EID_EXT_FILS_WRAPPED_DATA);
- wpabuf_put_buf(data, erp_resp);
-
- pmk = msk;
- pmk_len = msk_len > PMK_LEN ? PMK_LEN : msk_len;
- } else if (pmksa) {
- pmk = pmksa->pmk;
- pmk_len = pmksa->pmk_len;
- }
-
- if (!pmk) {
- wpa_printf(MSG_DEBUG, "FILS: No PMK available");
- resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
- wpabuf_free(data);
- data = NULL;
- goto fail;
- }
-
- if (fils_auth_pmk_to_ptk(sta->wpa_sm, pmk, pmk_len,
- sta->fils_snonce, fils_nonce) < 0) {
- resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
- wpabuf_free(data);
- data = NULL;
- goto fail;
- }
-
-fail:
- send_auth_reply(hapd, sta->addr, hapd->own_addr, WLAN_AUTH_FILS_SK, 2,
- resp,
- data ? wpabuf_head(data) : (u8 *) "",
- data ? wpabuf_len(data) : 0);
- wpabuf_free(data);
-
- if (resp == WLAN_STATUS_SUCCESS) {
- hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211,
- HOSTAPD_LEVEL_DEBUG,
- "authentication OK (FILS)");
- sta->flags |= WLAN_STA_AUTH;
- wpa_auth_sm_event(sta->wpa_sm, WPA_AUTH);
- sta->auth_alg = WLAN_AUTH_FILS_SK;
- mlme_authenticate_indication(hapd, sta);
- }
-
- os_free(ie_buf);
-}
-
-
-void ieee802_11_finish_fils_auth(struct hostapd_data *hapd,
- struct sta_info *sta, int success,
- struct wpabuf *erp_resp,
- const u8 *msk, size_t msk_len)
-{
- sta->flags &= ~WLAN_STA_PENDING_FILS_ERP;
- handle_auth_fils_finish(hapd, sta, success ? WLAN_STATUS_SUCCESS :
- WLAN_STATUS_UNSPECIFIED_FAILURE, NULL,
- erp_resp, msk, msk_len);
-}
-
-#endif /* CONFIG_FILS */
-
-
static void handle_auth(struct hostapd_data *hapd,
const struct ieee80211_mgmt *mgmt, size_t len)
{
@@ -1365,18 +1053,14 @@
if (!(((hapd->conf->auth_algs & WPA_AUTH_ALG_OPEN) &&
auth_alg == WLAN_AUTH_OPEN) ||
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
(hapd->conf->wpa && wpa_key_mgmt_ft(hapd->conf->wpa_key_mgmt) &&
auth_alg == WLAN_AUTH_FT) ||
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
#ifdef CONFIG_SAE
(hapd->conf->wpa && wpa_key_mgmt_sae(hapd->conf->wpa_key_mgmt) &&
auth_alg == WLAN_AUTH_SAE) ||
#endif /* CONFIG_SAE */
-#ifdef CONFIG_FILS
- (hapd->conf->wpa && wpa_key_mgmt_fils(hapd->conf->wpa_key_mgmt) &&
- auth_alg == WLAN_AUTH_FILS_SK) ||
-#endif /* CONFIG_FILS */
((hapd->conf->auth_algs & WPA_AUTH_ALG_SHARED) &&
auth_alg == WLAN_AUTH_SHARED_KEY))) {
wpa_printf(MSG_INFO, "Unsupported authentication algorithm (%d)",
@@ -1478,7 +1162,6 @@
sta = ap_get_sta(hapd, mgmt->sa);
if (sta) {
- sta->flags &= ~WLAN_STA_PENDING_FILS_ERP;
if ((fc & WLAN_FC_RETRY) &&
sta->last_seq_ctrl != WLAN_INVALID_MGMT_SEQ &&
sta->last_seq_ctrl == seq_ctrl &&
@@ -1633,7 +1316,7 @@
}
break;
#endif /* CONFIG_NO_RC4 */
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
case WLAN_AUTH_FT:
sta->auth_alg = WLAN_AUTH_FT;
if (sta->wpa_sm == NULL)
@@ -1652,7 +1335,7 @@
handle_auth_ft_finish, hapd);
/* handle_auth_ft_finish() callback will complete auth. */
return;
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
#ifdef CONFIG_SAE
case WLAN_AUTH_SAE:
#ifdef CONFIG_MESH
@@ -1674,12 +1357,6 @@
status_code);
return;
#endif /* CONFIG_SAE */
-#ifdef CONFIG_FILS
- case WLAN_AUTH_FILS_SK:
- handle_auth_fils(hapd, sta, mgmt, len, auth_transaction,
- status_code);
- return;
-#endif /* CONFIG_FILS */
}
fail:
@@ -1968,7 +1645,24 @@
res = wpa_validate_wpa_ie(hapd->wpa_auth, sta->wpa_sm,
wpa_ie, wpa_ie_len,
elems.mdie, elems.mdie_len);
- resp = wpa_res_to_status_code(res);
+ if (res == WPA_INVALID_GROUP)
+ resp = WLAN_STATUS_GROUP_CIPHER_NOT_VALID;
+ else if (res == WPA_INVALID_PAIRWISE)
+ resp = WLAN_STATUS_PAIRWISE_CIPHER_NOT_VALID;
+ else if (res == WPA_INVALID_AKMP)
+ resp = WLAN_STATUS_AKMP_NOT_VALID;
+ else if (res == WPA_ALLOC_FAIL)
+ resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
+#ifdef CONFIG_IEEE80211W
+ else if (res == WPA_MGMT_FRAME_PROTECTION_VIOLATION)
+ resp = WLAN_STATUS_ROBUST_MGMT_FRAME_POLICY_VIOLATION;
+ else if (res == WPA_INVALID_MGMT_GROUP_CIPHER)
+ resp = WLAN_STATUS_ROBUST_MGMT_FRAME_POLICY_VIOLATION;
+#endif /* CONFIG_IEEE80211W */
+ else if (res == WPA_INVALID_MDIE)
+ resp = WLAN_STATUS_INVALID_MDIE;
+ else if (res != WPA_IE_OK)
+ resp = WLAN_STATUS_INVALID_IE;
if (resp != WLAN_STATUS_SUCCESS)
return resp;
#ifdef CONFIG_IEEE80211W
@@ -1996,7 +1690,7 @@
sta->flags &= ~WLAN_STA_MFP;
#endif /* CONFIG_IEEE80211W */
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
if (sta->auth_alg == WLAN_AUTH_FT) {
if (!reassoc) {
wpa_printf(MSG_DEBUG, "FT: " MACSTR " tried "
@@ -2011,7 +1705,7 @@
if (resp != WLAN_STATUS_SUCCESS)
return resp;
}
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
#ifdef CONFIG_SAE
if (wpa_auth_uses_sae(sta->wpa_sm) &&
@@ -2229,7 +1923,7 @@
/* Extended supported rates */
p = hostapd_eid_ext_supp_rates(hapd, p);
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
if (status_code == WLAN_STATUS_SUCCESS) {
/* IEEE 802.11r: Mobility Domain Information, Fast BSS
* Transition Information, RSN, [RIC Response] */
@@ -2237,7 +1931,7 @@
buf + sizeof(buf) - p,
sta->auth_alg, ies, ies_len);
}
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
#ifdef CONFIG_IEEE80211W
if (status_code == WLAN_STATUS_ASSOC_REJECTED_TEMPORARILY)
@@ -2347,31 +2041,6 @@
send_len += p - reply->u.assoc_resp.variable;
-#ifdef CONFIG_FILS
- if ((sta->auth_alg == WLAN_AUTH_FILS_SK ||
- sta->auth_alg == WLAN_AUTH_FILS_SK_PFS ||
- sta->auth_alg == WLAN_AUTH_FILS_PK) &&
- status_code == WLAN_STATUS_SUCCESS) {
- struct ieee802_11_elems elems;
-
- if (ieee802_11_parse_elems(ies, ies_len, &elems, 0) ==
- ParseFailed || !elems.fils_session)
- return WLAN_STATUS_UNSPECIFIED_FAILURE;
-
- /* FILS Session */
- *p++ = WLAN_EID_EXTENSION; /* Element ID */
- *p++ = 1 + FILS_SESSION_LEN; /* Length */
- *p++ = WLAN_EID_EXT_FILS_SESSION; /* Element ID Extension */
- os_memcpy(p, elems.fils_session, FILS_SESSION_LEN);
- send_len += 2 + 1 + FILS_SESSION_LEN;
-
- send_len = fils_encrypt_assoc(sta->wpa_sm, buf, send_len,
- sizeof(buf));
- if (send_len < 0)
- return WLAN_STATUS_UNSPECIFIED_FAILURE;
- }
-#endif /* CONFIG_FILS */
-
if (hostapd_drv_send_mlme(hapd, reply, send_len, 0) < 0) {
wpa_printf(MSG_INFO, "Failed to send assoc resp: %s",
strerror(errno));
@@ -2391,7 +2060,6 @@
const u8 *pos;
int left, i;
struct sta_info *sta;
- u8 *tmp = NULL;
if (len < IEEE80211_HDRLEN + (reassoc ? sizeof(mgmt->u.reassoc_req) :
sizeof(mgmt->u.assoc_req))) {
@@ -2449,7 +2117,7 @@
}
sta = ap_get_sta(hapd, mgmt->sa);
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
if (sta && sta->auth_alg == WLAN_AUTH_FT &&
(sta->flags & WLAN_STA_AUTH) == 0) {
wpa_printf(MSG_DEBUG, "FT: Allow STA " MACSTR " to associate "
@@ -2462,7 +2130,7 @@
*/
sta->flags |= WLAN_STA_AUTH;
} else
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
if (sta == NULL || (sta->flags & WLAN_STA_AUTH) == 0) {
hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211,
HOSTAPD_LEVEL_INFO, "Station tried to "
@@ -2517,30 +2185,6 @@
*/
sta->capability = capab_info;
-#ifdef CONFIG_FILS
- if (sta->auth_alg == WLAN_AUTH_FILS_SK ||
- sta->auth_alg == WLAN_AUTH_FILS_SK_PFS ||
- sta->auth_alg == WLAN_AUTH_FILS_PK) {
- /* The end of the payload is encrypted. Need to decrypt it
- * before parsing. */
-
- tmp = os_malloc(left);
- if (!tmp) {
- resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
- goto fail;
- }
- os_memcpy(tmp, pos, left);
-
- left = fils_decrypt_assoc(sta->wpa_sm, sta->fils_session, mgmt,
- len, tmp, left);
- if (left < 0) {
- resp = WLAN_STATUS_UNSPECIFIED_FAILURE;
- goto fail;
- }
- pos = tmp;
- }
-#endif /* CONFIG_FILS */
-
/* followed by SSID and Supported rates; and HT capabilities if 802.11n
* is used */
resp = check_assoc_ies(hapd, sta, pos, left, reassoc);
@@ -2650,7 +2294,6 @@
resp = WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA;
reply_res = send_assoc_resp(hapd, sta, resp, reassoc, pos, left);
- os_free(tmp);
/*
* Remove the station in case tranmission of a success response fails
@@ -2863,14 +2506,14 @@
}
switch (mgmt->u.action.category) {
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
case WLAN_ACTION_FT:
if (!sta ||
wpa_ft_action_rx(sta->wpa_sm, (u8 *) &mgmt->u.action,
len - IEEE80211_HDRLEN))
break;
return 1;
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
case WLAN_ACTION_WMM:
hostapd_wmm_action(hapd, mgmt, len);
return 1;
@@ -3029,7 +2672,7 @@
}
if (hapd->iconf->track_sta_max_num)
- sta_track_add(hapd->iface, mgmt->sa, fi->ssi_signal);
+ sta_track_add(hapd->iface, mgmt->sa);
switch (stype) {
case WLAN_FC_STYPE_AUTH:
@@ -3203,15 +2846,11 @@
new_assoc = 0;
sta->flags |= WLAN_STA_ASSOC;
sta->flags &= ~WLAN_STA_WNM_SLEEP_MODE;
- if ((!hapd->conf->ieee802_1x && !hapd->conf->wpa &&
- !hapd->conf->osen) ||
- sta->auth_alg == WLAN_AUTH_FILS_SK ||
- sta->auth_alg == WLAN_AUTH_FILS_SK_PFS ||
- sta->auth_alg == WLAN_AUTH_FILS_PK ||
+ if ((!hapd->conf->ieee802_1x && !hapd->conf->wpa && !hapd->conf->osen) ||
sta->auth_alg == WLAN_AUTH_FT) {
/*
- * Open, static WEP, FT protocol, or FILS; no separate
- * authorization step.
+ * Open, static WEP, or FT protocol; no separate authorization
+ * step.
*/
ap_sta_set_authorized(hapd, sta, 1);
}
@@ -3258,18 +2897,6 @@
hapd->new_assoc_sta_cb(hapd, sta, !new_assoc);
ieee802_1x_notify_port_enabled(sta->eapol_sm, 1);
-#ifdef CONFIG_FILS
- if ((sta->auth_alg == WLAN_AUTH_FILS_SK ||
- sta->auth_alg == WLAN_AUTH_FILS_SK_PFS ||
- sta->auth_alg == WLAN_AUTH_FILS_PK) &&
- fils_set_tk(sta->wpa_sm) < 0) {
- wpa_printf(MSG_DEBUG, "FILS: TK configuration failed");
- ap_sta_disconnect(hapd, sta, sta->addr,
- WLAN_REASON_UNSPECIFIED);
- return;
- }
-#endif /* CONFIG_FILS */
-
if (sta->pending_eapol_rx) {
struct os_reltime now, age;
diff --git a/src/ap/ieee802_11.h b/src/ap/ieee802_11.h
index 46c92b7..0327dec 100644
--- a/src/ap/ieee802_11.h
+++ b/src/ap/ieee802_11.h
@@ -135,10 +135,4 @@
const u8 *supp_op_classes,
size_t supp_op_classes_len);
-u8 * hostapd_eid_fils_indic(struct hostapd_data *hapd, u8 *eid, int hessid);
-void ieee802_11_finish_fils_auth(struct hostapd_data *hapd,
- struct sta_info *sta, int success,
- struct wpabuf *erp_resp,
- const u8 *msk, size_t msk_len);
-
#endif /* IEEE802_11_H */
diff --git a/src/ap/ieee802_11_shared.c b/src/ap/ieee802_11_shared.c
index 97b1d67..259413b 100644
--- a/src/ap/ieee802_11_shared.c
+++ b/src/ap/ieee802_11_shared.c
@@ -218,19 +218,11 @@
if (hapd->conf->ssid.utf8_ssid)
*pos |= 0x01; /* Bit 48 - UTF-8 SSID */
break;
- case 7: /* Bits 56-63 */
- break;
case 8: /* Bits 64-71 */
if (hapd->conf->ftm_responder)
*pos |= 0x40; /* Bit 70 - FTM responder */
if (hapd->conf->ftm_initiator)
*pos |= 0x80; /* Bit 71 - FTM initiator */
- case 9: /* Bits 72-79 */
-#ifdef CONFIG_FILS
- if ((hapd->conf->wpa & WPA_PROTO_RSN) &&
- wpa_key_mgmt_fils(hapd->conf->wpa_key_mgmt))
- *pos |= 0x01;
-#endif /* CONFIG_FILS */
break;
}
}
@@ -266,11 +258,6 @@
if (hapd->conf->mbo_enabled && len < 6)
len = 6;
#endif /* CONFIG_MBO */
-#ifdef CONFIG_FILS
- if ((!(hapd->conf->wpa & WPA_PROTO_RSN) ||
- !wpa_key_mgmt_fils(hapd->conf->wpa_key_mgmt)) && len < 10)
- len = 10;
-#endif /* CONFIG_FILS */
if (len < hapd->iface->extended_capa_len)
len = hapd->iface->extended_capa_len;
if (len == 0)
@@ -597,56 +584,3 @@
os_memcpy(sta->supp_op_classes + 1, supp_op_classes,
supp_op_classes_len);
}
-
-
-u8 * hostapd_eid_fils_indic(struct hostapd_data *hapd, u8 *eid, int hessid)
-{
- u8 *pos = eid;
-#ifdef CONFIG_FILS
- u8 *len;
- u16 fils_info = 0;
-
- if (!(hapd->conf->wpa & WPA_PROTO_RSN) ||
- !wpa_key_mgmt_fils(hapd->conf->wpa_key_mgmt))
- return pos;
-
- *pos++ = WLAN_EID_FILS_INDICATION;
- len = pos++;
- /* TODO: B0..B2: Number of Public Key Identifiers */
- if (hapd->conf->erp_domain) {
- /* TODO: Support for setting multiple domain identifiers */
- /* B3..B5: Number of Realm Identifiers */
- fils_info |= BIT(3);
- }
- /* TODO: B6: FILS IP Address Configuration */
- if (hapd->conf->fils_cache_id_set)
- fils_info |= BIT(7);
- if (hessid && !is_zero_ether_addr(hapd->conf->hessid))
- fils_info |= BIT(8); /* HESSID Included */
- /* FILS Shared Key Authentication without PFS Supported */
- fils_info |= BIT(9);
- /* TODO: B10: FILS Shared Key Authentication with PFS Supported */
- /* TODO: B11: FILS Public Key Authentication Supported */
- /* B12..B15: Reserved */
- WPA_PUT_LE16(pos, fils_info);
- pos += 2;
- if (hapd->conf->fils_cache_id_set) {
- os_memcpy(pos, hapd->conf->fils_cache_id, FILS_CACHE_ID_LEN);
- pos += FILS_CACHE_ID_LEN;
- }
- if (hessid && !is_zero_ether_addr(hapd->conf->hessid)) {
- os_memcpy(pos, hapd->conf->hessid, ETH_ALEN);
- pos += ETH_ALEN;
- }
- if (hapd->conf->erp_domain) {
- u16 hash;
-
- hash = fils_domain_name_hash(hapd->conf->erp_domain);
- WPA_PUT_LE16(pos, hash);
- pos += 2;
- }
- *len = pos - len - 1;
-#endif /* CONFIG_FILS */
-
- return pos;
-}
diff --git a/src/ap/ieee802_1x.c b/src/ap/ieee802_1x.c
index 7ac337d..80ff996 100644
--- a/src/ap/ieee802_1x.c
+++ b/src/ap/ieee802_1x.c
@@ -31,8 +31,6 @@
#include "ap_drv_ops.h"
#include "wps_hostapd.h"
#include "hs20.h"
-/* FIX: Not really a good thing to require ieee802_11.h here.. (FILS) */
-#include "ieee802_11.h"
#include "ieee802_1x.h"
@@ -318,7 +316,6 @@
hdr->code != EAP_CODE_INITIATE))
return;
- eap_erp_update_identity(sm->eap, eap, len);
identity = eap_get_identity(sm->eap, &identity_len);
if (identity == NULL)
return;
@@ -475,7 +472,7 @@
}
}
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
if (hapd->conf->wpa && wpa_key_mgmt_ft(hapd->conf->wpa_key_mgmt) &&
sta->wpa_sm &&
(wpa_key_mgmt_ft(wpa_auth_sta_key_mgmt(sta->wpa_sm)) ||
@@ -488,7 +485,7 @@
wpa_printf(MSG_ERROR, "Could not add Mobility-Domain-Id");
return -1;
}
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
if ((hapd->conf->wpa || hapd->conf->osen) && sta->wpa_sm &&
add_common_radius_sta_attr_rsn(hapd, req_attr, sta, msg) < 0)
@@ -591,9 +588,9 @@
}
-void ieee802_1x_encapsulate_radius(struct hostapd_data *hapd,
- struct sta_info *sta,
- const u8 *eap, size_t len)
+static void ieee802_1x_encapsulate_radius(struct hostapd_data *hapd,
+ struct sta_info *sta,
+ const u8 *eap, size_t len)
{
struct radius_msg *msg;
struct eapol_state_machine *sm = sta->eapol_sm;
@@ -848,7 +845,7 @@
}
-struct eapol_state_machine *
+static struct eapol_state_machine *
ieee802_1x_alloc_eapol_sm(struct hostapd_data *hapd, struct sta_info *sta)
{
int flags = 0;
@@ -1157,7 +1154,7 @@
sta->eapol_sm->eap_if->portEnabled = TRUE;
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
if (sta->auth_alg == WLAN_AUTH_FT) {
hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X,
HOSTAPD_LEVEL_DEBUG,
@@ -1176,29 +1173,7 @@
/* TODO: get vlan_id from R0KH using RRB message */
return;
}
-#endif /* CONFIG_IEEE80211R_AP */
-
-#ifdef CONFIG_FILS
- if (sta->auth_alg == WLAN_AUTH_FILS_SK ||
- sta->auth_alg == WLAN_AUTH_FILS_SK_PFS ||
- sta->auth_alg == WLAN_AUTH_FILS_PK) {
- hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X,
- HOSTAPD_LEVEL_DEBUG,
- "PMK from FILS - skip IEEE 802.1X/EAP");
- /* Setup EAPOL state machines to already authenticated state
- * because of existing FILS information. */
- sta->eapol_sm->keyRun = TRUE;
- sta->eapol_sm->eap_if->eapKeyAvailable = TRUE;
- sta->eapol_sm->auth_pae_state = AUTH_PAE_AUTHENTICATING;
- sta->eapol_sm->be_auth_state = BE_AUTH_SUCCESS;
- sta->eapol_sm->authSuccess = TRUE;
- sta->eapol_sm->authFail = FALSE;
- sta->eapol_sm->portValid = TRUE;
- if (sta->eapol_sm->eap)
- eap_sm_notify_cached(sta->eapol_sm->eap);
- return;
- }
-#endif /* CONFIG_FILS */
+#endif /* CONFIG_IEEE80211R */
pmksa = wpa_auth_sta_get_pmksa(sta->wpa_sm);
if (pmksa) {
@@ -1862,19 +1837,6 @@
if (override_eapReq)
sm->eap_if->aaaEapReq = FALSE;
-#ifdef CONFIG_FILS
-#ifdef NEED_AP_MLME
- if (sta->flags & WLAN_STA_PENDING_FILS_ERP) {
- /* TODO: Add a PMKSA entry on success? */
- ieee802_11_finish_fils_auth(
- hapd, sta, hdr->code == RADIUS_CODE_ACCESS_ACCEPT,
- sm->eap_if->aaaEapReqData,
- sm->eap_if->aaaEapKeyData,
- sm->eap_if->aaaEapKeyDataLen);
- }
-#endif /* NEED_AP_MLME */
-#endif /* CONFIG_FILS */
-
eapol_auth_step(sm);
return RADIUS_RX_QUEUED;
diff --git a/src/ap/ieee802_1x.h b/src/ap/ieee802_1x.h
index 9594661..ec80199 100644
--- a/src/ap/ieee802_1x.h
+++ b/src/ap/ieee802_1x.h
@@ -57,10 +57,5 @@
struct hostapd_radius_attr *req_attr,
struct sta_info *sta,
struct radius_msg *msg);
-void ieee802_1x_encapsulate_radius(struct hostapd_data *hapd,
- struct sta_info *sta,
- const u8 *eap, size_t len);
-struct eapol_state_machine *
-ieee802_1x_alloc_eapol_sm(struct hostapd_data *hapd, struct sta_info *sta);
#endif /* IEEE802_1X_H */
diff --git a/src/ap/neighbor_db.c b/src/ap/neighbor_db.c
index b8fd592..a2efff6 100644
--- a/src/ap/neighbor_db.c
+++ b/src/ap/neighbor_db.c
@@ -43,7 +43,6 @@
nr->civic = NULL;
os_memset(nr->bssid, 0, sizeof(nr->bssid));
os_memset(&nr->ssid, 0, sizeof(nr->ssid));
- nr->stationary = 0;
}
@@ -65,7 +64,7 @@
int hostapd_neighbor_set(struct hostapd_data *hapd, const u8 *bssid,
const struct wpa_ssid_value *ssid,
const struct wpabuf *nr, const struct wpabuf *lci,
- const struct wpabuf *civic, int stationary)
+ const struct wpabuf *civic)
{
struct hostapd_neighbor_entry *entry;
@@ -84,20 +83,18 @@
if (!entry->nr)
goto fail;
- if (lci && wpabuf_len(lci)) {
+ if (lci) {
entry->lci = wpabuf_dup(lci);
if (!entry->lci || os_get_time(&entry->lci_date))
goto fail;
}
- if (civic && wpabuf_len(civic)) {
+ if (civic) {
entry->civic = wpabuf_dup(civic);
if (!entry->civic)
goto fail;
}
- entry->stationary = stationary;
-
return 0;
fail:
diff --git a/src/ap/neighbor_db.h b/src/ap/neighbor_db.h
index ba46d88..c22e043 100644
--- a/src/ap/neighbor_db.h
+++ b/src/ap/neighbor_db.h
@@ -16,7 +16,7 @@
int hostapd_neighbor_set(struct hostapd_data *hapd, const u8 *bssid,
const struct wpa_ssid_value *ssid,
const struct wpabuf *nr, const struct wpabuf *lci,
- const struct wpabuf *civic, int stationary);
+ const struct wpabuf *civic);
int hostapd_neighbor_remove(struct hostapd_data *hapd, const u8 *bssid,
const struct wpa_ssid_value *ssid);
void hostpad_free_neighbor_db(struct hostapd_data *hapd);
diff --git a/src/ap/rrm.c b/src/ap/rrm.c
index 5ca87c0..3569f95 100644
--- a/src/ap/rrm.c
+++ b/src/ap/rrm.c
@@ -129,12 +129,12 @@
struct os_time curr, diff;
unsigned long diff_l;
- if (nr->stationary || max_age == 0xffff)
- return 1;
-
if (!max_age)
return 0;
+ if (max_age == 0xffff)
+ return 1;
+
if (os_get_time(&curr))
return 0;
diff --git a/src/ap/sta_info.h b/src/ap/sta_info.h
index a416337..099de62 100644
--- a/src/ap/sta_info.h
+++ b/src/ap/sta_info.h
@@ -17,7 +17,6 @@
#include "list.h"
#include "vlan.h"
-#include "common/ieee802_11_defs.h"
/* STA flags */
#define WLAN_STA_AUTH BIT(0)
@@ -39,7 +38,6 @@
#define WLAN_STA_WNM_SLEEP_MODE BIT(19)
#define WLAN_STA_VHT_OPMODE_ENABLED BIT(20)
#define WLAN_STA_VENDOR_VHT BIT(21)
-#define WLAN_STA_PENDING_FILS_ERP BIT(22)
#define WLAN_STA_PENDING_DISASSOC_CB BIT(29)
#define WLAN_STA_PENDING_DEAUTH_CB BIT(30)
#define WLAN_STA_NONERP BIT(31)
@@ -220,11 +218,6 @@
struct wpabuf *probe_ie_taxonomy;
struct wpabuf *assoc_ie_taxonomy;
#endif /* CONFIG_TAXONOMY */
-
-#ifdef CONFIG_FILS
- u8 fils_snonce[FILS_NONCE_LEN];
- u8 fils_session[FILS_SESSION_LEN];
-#endif /* CONFIG_FILS */
};
diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c
index 43e3558..3587086 100644
--- a/src/ap/wpa_auth.c
+++ b/src/ap/wpa_auth.c
@@ -13,9 +13,7 @@
#include "utils/state_machine.h"
#include "utils/bitfield.h"
#include "common/ieee802_11_defs.h"
-#include "crypto/aes.h"
#include "crypto/aes_wrap.h"
-#include "crypto/aes_siv.h"
#include "crypto/crypto.h"
#include "crypto/sha1.h"
#include "crypto/sha256.h"
@@ -37,10 +35,6 @@
static int wpa_sm_step(struct wpa_state_machine *sm);
static int wpa_verify_key_mic(int akmp, struct wpa_ptk *PTK, u8 *data,
size_t data_len);
-#ifdef CONFIG_FILS
-static int wpa_aead_decrypt(struct wpa_state_machine *sm, struct wpa_ptk *ptk,
- u8 *buf, size_t buf_len, u16 *_key_data_len);
-#endif /* CONFIG_FILS */
static void wpa_sm_call_step(void *eloop_ctx, void *timeout_ctx);
static void wpa_group_sm_step(struct wpa_authenticator *wpa_auth,
struct wpa_group *group);
@@ -58,7 +52,6 @@
struct wpa_group *group);
static void wpa_group_put(struct wpa_authenticator *wpa_auth,
struct wpa_group *group);
-static u8 * ieee80211w_kde_add(struct wpa_state_machine *sm, u8 *pos);
static const u32 dot11RSNAConfigGroupUpdateCount = 4;
static const u32 dot11RSNAConfigPairwiseUpdateCount = 4;
@@ -239,10 +232,10 @@
static int wpa_use_aes_cmac(struct wpa_state_machine *sm)
{
int ret = 0;
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
if (wpa_key_mgmt_ft(sm->wpa_key_mgmt))
ret = 1;
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
#ifdef CONFIG_IEEE80211W
if (wpa_key_mgmt_sha256(sm->wpa_key_mgmt))
ret = 1;
@@ -450,7 +443,7 @@
return NULL;
}
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
wpa_auth->ft_pmk_cache = wpa_ft_pmk_cache_init();
if (wpa_auth->ft_pmk_cache == NULL) {
wpa_printf(MSG_ERROR, "FT PMK cache initialization failed.");
@@ -460,7 +453,7 @@
os_free(wpa_auth);
return NULL;
}
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
if (wpa_auth->conf.wpa_gmk_rekey) {
eloop_register_timeout(wpa_auth->conf.wpa_gmk_rekey, 0,
@@ -520,10 +513,10 @@
pmksa_cache_auth_deinit(wpa_auth->pmksa);
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
wpa_ft_pmk_cache_deinit(wpa_auth->ft_pmk_cache);
wpa_auth->ft_pmk_cache = NULL;
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
#ifdef CONFIG_P2P
bitfield_free(wpa_auth->ip_pool);
@@ -606,7 +599,7 @@
if (wpa_auth == NULL || !wpa_auth->conf.wpa || sm == NULL)
return -1;
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
if (sm->ft_completed) {
wpa_auth_logger(wpa_auth, sm->addr, LOGGER_DEBUG,
"FT authentication already completed - do not "
@@ -615,17 +608,7 @@
sm->wpa_ptk_state = WPA_PTK_PTKINITDONE;
return 0;
}
-#endif /* CONFIG_IEEE80211R_AP */
-
-#ifdef CONFIG_FILS
- if (sm->fils_completed) {
- wpa_auth_logger(wpa_auth, sm->addr, LOGGER_DEBUG,
- "FILS authentication already completed - do not start 4-way handshake");
- /* Go to PTKINITDONE state to allow GTK rekeying */
- sm->wpa_ptk_state = WPA_PTK_PTKINITDONE;
- return 0;
- }
-#endif /* CONFIG_FILS */
+#endif /* CONFIG_IEEE80211R */
if (sm->started) {
os_memset(&sm->key_replay, 0, sizeof(sm->key_replay));
@@ -677,10 +660,10 @@
sm->group->GKeyDoneStations--;
sm->GUpdateStationKeys = FALSE;
}
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
os_free(sm->assoc_resp_ftie);
wpabuf_free(sm->ft_pending_req_ies);
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
os_free(sm->last_rx_eapol_key);
os_free(sm->wpa_ie);
wpa_group_put(sm->wpa_auth, sm->group);
@@ -756,7 +739,7 @@
}
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
static int ft_check_msg_2_of_4(struct wpa_authenticator *wpa_auth,
struct wpa_state_machine *sm,
struct wpa_eapol_ie_parse *kde)
@@ -803,7 +786,7 @@
return 0;
}
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
static int wpa_receive_error_report(struct wpa_authenticator *wpa_auth,
@@ -847,7 +830,6 @@
const u8 *pmk = NULL;
unsigned int pmk_len;
- os_memset(&PTK, 0, sizeof(PTK));
for (;;) {
if (wpa_key_mgmt_wpa_psk(sm->wpa_key_mgmt)) {
pmk = wpa_auth_get_psk(sm->wpa_auth, sm->addr,
@@ -895,42 +877,39 @@
{
struct ieee802_1x_hdr *hdr;
struct wpa_eapol_key *key;
+ struct wpa_eapol_key_192 *key192;
u16 key_info, key_data_length;
enum { PAIRWISE_2, PAIRWISE_4, GROUP_2, REQUEST,
SMK_M1, SMK_M3, SMK_ERROR } msg;
char *msgtxt;
struct wpa_eapol_ie_parse kde;
- const u8 *key_data;
- size_t keyhdrlen, mic_len;
- u8 *mic;
+ int ft;
+ const u8 *eapol_key_ie, *key_data;
+ size_t eapol_key_ie_len, keyhdrlen, mic_len;
if (wpa_auth == NULL || !wpa_auth->conf.wpa || sm == NULL)
return;
- wpa_hexdump(MSG_MSGDUMP, "WPA: RX EAPOL data", data, data_len);
mic_len = wpa_mic_len(sm->wpa_key_mgmt);
- keyhdrlen = sizeof(*key) + mic_len + 2;
+ keyhdrlen = mic_len == 24 ? sizeof(*key192) : sizeof(*key);
- if (data_len < sizeof(*hdr) + keyhdrlen) {
- wpa_printf(MSG_DEBUG, "WPA: Ignore too short EAPOL-Key frame");
+ if (data_len < sizeof(*hdr) + keyhdrlen)
return;
- }
hdr = (struct ieee802_1x_hdr *) data;
key = (struct wpa_eapol_key *) (hdr + 1);
- mic = (u8 *) (key + 1);
+ key192 = (struct wpa_eapol_key_192 *) (hdr + 1);
key_info = WPA_GET_BE16(key->key_info);
- key_data = mic + mic_len + 2;
- key_data_length = WPA_GET_BE16(mic + mic_len);
+ if (mic_len == 24) {
+ key_data = (const u8 *) (key192 + 1);
+ key_data_length = WPA_GET_BE16(key192->key_data_length);
+ } else {
+ key_data = (const u8 *) (key + 1);
+ key_data_length = WPA_GET_BE16(key->key_data_length);
+ }
wpa_printf(MSG_DEBUG, "WPA: Received EAPOL-Key from " MACSTR
- " key_info=0x%x type=%u mic_len=%u key_data_length=%u",
- MAC2STR(sm->addr), key_info, key->type,
- (unsigned int) mic_len, key_data_length);
- wpa_hexdump(MSG_MSGDUMP,
- "WPA: EAPOL-Key header (ending before Key MIC)",
- key, sizeof(*key));
- wpa_hexdump(MSG_MSGDUMP, "WPA: EAPOL-Key Key MIC",
- mic, mic_len);
+ " key_info=0x%x type=%u key_data_length=%u",
+ MAC2STR(sm->addr), key_info, key->type, key_data_length);
if (key_data_length > data_len - sizeof(*hdr) - keyhdrlen) {
wpa_printf(MSG_INFO, "WPA: Invalid EAPOL-Key frame - "
"key_data overflow (%d > %lu)",
@@ -989,9 +968,7 @@
} else if (!(key_info & WPA_KEY_INFO_KEY_TYPE)) {
msg = GROUP_2;
msgtxt = "2/2 Group";
- } else if (key_data_length == 0 ||
- (mic_len == 0 && (key_info & WPA_KEY_INFO_ENCR_KEY_DATA) &&
- key_data_length == AES_BLOCK_SIZE)) {
+ } else if (key_data_length == 0) {
msg = PAIRWISE_4;
msgtxt = "4/4 Pairwise";
} else {
@@ -1008,7 +985,6 @@
if (wpa_use_aes_cmac(sm) &&
sm->wpa_key_mgmt != WPA_KEY_MGMT_OSEN &&
!wpa_key_mgmt_suite_b(sm->wpa_key_mgmt) &&
- !wpa_key_mgmt_fils(sm->wpa_key_mgmt) &&
ver != WPA_KEY_INFO_TYPE_AES_128_CMAC) {
wpa_auth_logger(wpa_auth, sm->addr,
LOGGER_WARNING,
@@ -1019,7 +995,6 @@
}
if (!wpa_use_aes_cmac(sm) &&
- !wpa_key_mgmt_fils(sm->wpa_key_mgmt) &&
ver != WPA_KEY_INFO_TYPE_HMAC_SHA1_AES) {
wpa_auth_logger(wpa_auth, sm->addr,
LOGGER_WARNING,
@@ -1029,8 +1004,7 @@
}
}
- if ((wpa_key_mgmt_suite_b(sm->wpa_key_mgmt) ||
- wpa_key_mgmt_fils(sm->wpa_key_mgmt)) &&
+ if (wpa_key_mgmt_suite_b(sm->wpa_key_mgmt) &&
ver != WPA_KEY_INFO_TYPE_AKM_DEFINED) {
wpa_auth_logger(wpa_auth, sm->addr, LOGGER_WARNING,
"did not use EAPOL-Key descriptor version 0 as required for AKM-defined cases");
@@ -1118,15 +1092,6 @@
}
continue_processing:
-#ifdef CONFIG_FILS
- if (sm->wpa == WPA_VERSION_WPA2 && mic_len == 0 &&
- !(key_info & WPA_KEY_INFO_ENCR_KEY_DATA)) {
- wpa_auth_vlogger(wpa_auth, sm->addr, LOGGER_DEBUG,
- "WPA: Encr Key Data bit not set even though AEAD cipher is supposed to be used - drop frame");
- return;
- }
-#endif /* CONFIG_FILS */
-
switch (msg) {
case PAIRWISE_2:
if (sm->wpa_ptk_state != WPA_PTK_PTKSTART &&
@@ -1157,6 +1122,67 @@
wpa_sta_disconnect(wpa_auth, sm->addr);
return;
}
+ if (wpa_parse_kde_ies(key_data, key_data_length, &kde) < 0) {
+ wpa_auth_vlogger(wpa_auth, sm->addr, LOGGER_INFO,
+ "received EAPOL-Key msg 2/4 with "
+ "invalid Key Data contents");
+ return;
+ }
+ if (kde.rsn_ie) {
+ eapol_key_ie = kde.rsn_ie;
+ eapol_key_ie_len = kde.rsn_ie_len;
+ } else if (kde.osen) {
+ eapol_key_ie = kde.osen;
+ eapol_key_ie_len = kde.osen_len;
+ } else {
+ eapol_key_ie = kde.wpa_ie;
+ eapol_key_ie_len = kde.wpa_ie_len;
+ }
+ ft = sm->wpa == WPA_VERSION_WPA2 &&
+ wpa_key_mgmt_ft(sm->wpa_key_mgmt);
+ if (sm->wpa_ie == NULL ||
+ wpa_compare_rsn_ie(ft,
+ sm->wpa_ie, sm->wpa_ie_len,
+ eapol_key_ie, eapol_key_ie_len)) {
+ wpa_auth_logger(wpa_auth, sm->addr, LOGGER_INFO,
+ "WPA IE from (Re)AssocReq did not "
+ "match with msg 2/4");
+ if (sm->wpa_ie) {
+ wpa_hexdump(MSG_DEBUG, "WPA IE in AssocReq",
+ sm->wpa_ie, sm->wpa_ie_len);
+ }
+ wpa_hexdump(MSG_DEBUG, "WPA IE in msg 2/4",
+ eapol_key_ie, eapol_key_ie_len);
+ /* MLME-DEAUTHENTICATE.request */
+ wpa_sta_disconnect(wpa_auth, sm->addr);
+ return;
+ }
+#ifdef CONFIG_IEEE80211R
+ if (ft && ft_check_msg_2_of_4(wpa_auth, sm, &kde) < 0) {
+ wpa_sta_disconnect(wpa_auth, sm->addr);
+ return;
+ }
+#endif /* CONFIG_IEEE80211R */
+#ifdef CONFIG_P2P
+ if (kde.ip_addr_req && kde.ip_addr_req[0] &&
+ wpa_auth->ip_pool && WPA_GET_BE32(sm->ip_addr) == 0) {
+ int idx;
+ wpa_printf(MSG_DEBUG, "P2P: IP address requested in "
+ "EAPOL-Key exchange");
+ idx = bitfield_get_first_zero(wpa_auth->ip_pool);
+ if (idx >= 0) {
+ u32 start = WPA_GET_BE32(wpa_auth->conf.
+ ip_addr_start);
+ bitfield_set(wpa_auth->ip_pool, idx);
+ WPA_PUT_BE32(sm->ip_addr, start + idx);
+ wpa_printf(MSG_DEBUG, "P2P: Assigned IP "
+ "address %u.%u.%u.%u to " MACSTR,
+ sm->ip_addr[0], sm->ip_addr[1],
+ sm->ip_addr[2], sm->ip_addr[3],
+ MAC2STR(sm->addr));
+ }
+ }
+#endif /* CONFIG_P2P */
break;
case PAIRWISE_4:
if (sm->wpa_ptk_state != WPA_PTK_PTKINITNEGOTIATING ||
@@ -1213,26 +1239,15 @@
return;
}
- if (!wpa_key_mgmt_fils(sm->wpa_key_mgmt) &&
- !(key_info & WPA_KEY_INFO_MIC)) {
+ if (!(key_info & WPA_KEY_INFO_MIC)) {
wpa_auth_logger(wpa_auth, sm->addr, LOGGER_INFO,
"received invalid EAPOL-Key: Key MIC not set");
return;
}
-#ifdef CONFIG_FILS
- if (wpa_key_mgmt_fils(sm->wpa_key_mgmt) &&
- (key_info & WPA_KEY_INFO_MIC)) {
- wpa_auth_logger(wpa_auth, sm->addr, LOGGER_INFO,
- "received invalid EAPOL-Key: Key MIC set");
- return;
- }
-#endif /* CONFIG_FILS */
-
sm->MICVerified = FALSE;
if (sm->PTK_valid && !sm->update_snonce) {
- if (mic_len &&
- wpa_verify_key_mic(sm->wpa_key_mgmt, &sm->PTK, data,
+ if (wpa_verify_key_mic(sm->wpa_key_mgmt, &sm->PTK, data,
data_len) &&
(msg != PAIRWISE_4 || !sm->alt_snonce_valid ||
wpa_try_alt_snonce(sm, data, data_len))) {
@@ -1240,15 +1255,6 @@
"received EAPOL-Key with invalid MIC");
return;
}
-#ifdef CONFIG_FILS
- if (!mic_len &&
- wpa_aead_decrypt(sm, &sm->PTK, data, data_len,
- &key_data_length) < 0) {
- wpa_auth_logger(wpa_auth, sm->addr, LOGGER_INFO,
- "received EAPOL-Key with invalid MIC");
- return;
- }
-#endif /* CONFIG_FILS */
sm->MICVerified = TRUE;
eloop_cancel_timeout(wpa_send_eapol_timeout, wpa_auth, sm);
sm->pending_1_of_4_timeout = 0;
@@ -1406,24 +1412,24 @@
{
struct ieee802_1x_hdr *hdr;
struct wpa_eapol_key *key;
+ struct wpa_eapol_key_192 *key192;
size_t len, mic_len, keyhdrlen;
int alg;
int key_data_len, pad_len = 0;
u8 *buf, *pos;
int version, pairwise;
int i;
- u8 *key_mic, *key_data;
+ u8 *key_data;
mic_len = wpa_mic_len(sm->wpa_key_mgmt);
- keyhdrlen = sizeof(*key) + mic_len + 2;
+ keyhdrlen = mic_len == 24 ? sizeof(*key192) : sizeof(*key);
len = sizeof(struct ieee802_1x_hdr) + keyhdrlen;
if (force_version)
version = force_version;
else if (sm->wpa_key_mgmt == WPA_KEY_MGMT_OSEN ||
- wpa_key_mgmt_suite_b(sm->wpa_key_mgmt) ||
- wpa_key_mgmt_fils(sm->wpa_key_mgmt))
+ wpa_key_mgmt_suite_b(sm->wpa_key_mgmt))
version = WPA_KEY_INFO_TYPE_AKM_DEFINED;
else if (wpa_use_aes_cmac(sm))
version = WPA_KEY_INFO_TYPE_AES_128_CMAC;
@@ -1457,8 +1463,6 @@
}
len += key_data_len;
- if (!mic_len && encr)
- len += AES_BLOCK_SIZE;
hdr = os_zalloc(len);
if (hdr == NULL)
@@ -1467,7 +1471,7 @@
hdr->type = IEEE802_1X_TYPE_EAPOL_KEY;
hdr->length = host_to_be16(len - sizeof(*hdr));
key = (struct wpa_eapol_key *) (hdr + 1);
- key_mic = (u8 *) (key + 1);
+ key192 = (struct wpa_eapol_key_192 *) (hdr + 1);
key_data = ((u8 *) (hdr + 1)) + keyhdrlen;
key->type = sm->wpa == WPA_VERSION_WPA2 ?
@@ -1506,31 +1510,10 @@
if (kde && !encr) {
os_memcpy(key_data, kde, kde_len);
- WPA_PUT_BE16(key_mic + mic_len, kde_len);
-#ifdef CONFIG_FILS
- } else if (!mic_len) {
- const u8 *aad[1];
- size_t aad_len[1];
-
- WPA_PUT_BE16(key_mic, AES_BLOCK_SIZE + kde_len);
- wpa_hexdump_key(MSG_DEBUG, "Plaintext EAPOL-Key Key Data",
- kde, kde_len);
-
- wpa_hexdump_key(MSG_DEBUG, "WPA: KEK",
- sm->PTK.kek, sm->PTK.kek_len);
- /* AES-SIV AAD from EAPOL protocol version field (inclusive) to
- * to Key Data (exclusive). */
- aad[0] = (u8 *) hdr;
- aad_len[0] = key_mic + 2 - (u8 *) hdr;
- if (aes_siv_encrypt(sm->PTK.kek, sm->PTK.kek_len, kde, kde_len,
- 1, aad, aad_len, key_mic + 2) < 0) {
- wpa_printf(MSG_DEBUG, "WPA: AES-SIV encryption failed");
- return;
- }
-
- wpa_hexdump(MSG_DEBUG, "WPA: Encrypted Key Data from SIV",
- key_mic + 2, AES_BLOCK_SIZE + kde_len);
-#endif /* CONFIG_FILS */
+ if (mic_len == 24)
+ WPA_PUT_BE16(key192->key_data_length, kde_len);
+ else
+ WPA_PUT_BE16(key->key_data_length, kde_len);
} else if (encr && kde) {
buf = os_zalloc(key_data_len);
if (buf == NULL) {
@@ -1556,7 +1539,12 @@
os_free(buf);
return;
}
- WPA_PUT_BE16(key_mic + mic_len, key_data_len);
+ if (mic_len == 24)
+ WPA_PUT_BE16(key192->key_data_length,
+ key_data_len);
+ else
+ WPA_PUT_BE16(key->key_data_length,
+ key_data_len);
#ifndef CONFIG_NO_RC4
} else if (sm->PTK.kek_len == 16) {
u8 ek[32];
@@ -1567,7 +1555,12 @@
os_memcpy(ek + 16, sm->PTK.kek, sm->PTK.kek_len);
os_memcpy(key_data, buf, key_data_len);
rc4_skip(ek, 32, 256, key_data, key_data_len);
- WPA_PUT_BE16(key_mic + mic_len, key_data_len);
+ if (mic_len == 24)
+ WPA_PUT_BE16(key192->key_data_length,
+ key_data_len);
+ else
+ WPA_PUT_BE16(key->key_data_length,
+ key_data_len);
#endif /* CONFIG_NO_RC4 */
} else {
os_free(hdr);
@@ -1578,7 +1571,9 @@
}
if (key_info & WPA_KEY_INFO_MIC) {
- if (!sm->PTK_valid || !mic_len) {
+ u8 *key_mic;
+
+ if (!sm->PTK_valid) {
wpa_auth_logger(wpa_auth, sm->addr, LOGGER_DEBUG,
"PTK not valid when sending EAPOL-Key "
"frame");
@@ -1586,6 +1581,7 @@
return;
}
+ key_mic = key192->key_mic; /* same offset for key and key192 */
wpa_eapol_key_mic(sm->PTK.kck, sm->PTK.kck_len,
sm->wpa_key_mgmt, version,
(u8 *) hdr, len, key_mic);
@@ -1645,9 +1641,10 @@
{
struct ieee802_1x_hdr *hdr;
struct wpa_eapol_key *key;
+ struct wpa_eapol_key_192 *key192;
u16 key_info;
int ret = 0;
- u8 mic[WPA_EAPOL_KEY_MIC_MAX_LEN], *mic_pos;
+ u8 mic[WPA_EAPOL_KEY_MIC_MAX_LEN];
size_t mic_len = wpa_mic_len(akmp);
if (data_len < sizeof(*hdr) + sizeof(*key))
@@ -1655,16 +1652,16 @@
hdr = (struct ieee802_1x_hdr *) data;
key = (struct wpa_eapol_key *) (hdr + 1);
- mic_pos = (u8 *) (key + 1);
+ key192 = (struct wpa_eapol_key_192 *) (hdr + 1);
key_info = WPA_GET_BE16(key->key_info);
- os_memcpy(mic, mic_pos, mic_len);
- os_memset(mic_pos, 0, mic_len);
+ os_memcpy(mic, key192->key_mic, mic_len);
+ os_memset(key192->key_mic, 0, mic_len);
if (wpa_eapol_key_mic(PTK->kck, PTK->kck_len, akmp,
key_info & WPA_KEY_INFO_TYPE_MASK,
- data, data_len, mic_pos) ||
- os_memcmp_const(mic, mic_pos, mic_len) != 0)
+ data, data_len, key192->key_mic) ||
+ os_memcmp_const(mic, key192->key_mic, mic_len) != 0)
ret = -1;
- os_memcpy(mic_pos, mic, mic_len);
+ os_memcpy(key192->key_mic, mic, mic_len);
return ret;
}
@@ -1673,10 +1670,7 @@
{
sm->PTK_valid = FALSE;
os_memset(&sm->PTK, 0, sizeof(sm->PTK));
- if (wpa_auth_set_key(sm->wpa_auth, 0, WPA_ALG_NONE, sm->addr, 0, NULL,
- 0))
- wpa_printf(MSG_DEBUG,
- "RSN: PTK removal from the driver failed");
+ wpa_auth_set_key(sm->wpa_auth, 0, WPA_ALG_NONE, sm->addr, 0, NULL, 0);
sm->pairwise_set = FALSE;
eloop_cancel_timeout(wpa_rekey_ptk, sm->wpa_auth, sm);
}
@@ -1740,7 +1734,7 @@
sm->ReAuthenticationRequest = TRUE;
break;
case WPA_ASSOC_FT:
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
wpa_printf(MSG_DEBUG, "FT: Retry PTK configuration "
"after association");
wpa_ft_install_ptk(sm);
@@ -1748,24 +1742,19 @@
/* Using FT protocol, not WPA auth state machine */
sm->ft_completed = 1;
return 0;
-#else /* CONFIG_IEEE80211R_AP */
+#else /* CONFIG_IEEE80211R */
break;
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
}
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
sm->ft_completed = 0;
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
#ifdef CONFIG_IEEE80211W
if (sm->mgmt_frame_prot && event == WPA_AUTH)
remove_ptk = 0;
#endif /* CONFIG_IEEE80211W */
-#ifdef CONFIG_FILS
- if (wpa_key_mgmt_fils(sm->wpa_key_mgmt) &&
- (event == WPA_AUTH || event == WPA_ASSOC))
- remove_ptk = 0;
-#endif /* CONFIG_FILS */
if (remove_ptk) {
sm->PTK_valid = FALSE;
@@ -1915,9 +1904,9 @@
size_t len = 2 * PMK_LEN;
SM_ENTRY_MA(WPA_PTK, INITPMK, wpa_ptk);
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
sm->xxkey_len = 0;
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
if (sm->pmksa) {
wpa_printf(MSG_DEBUG, "WPA: PMK from PMKSA cache");
os_memcpy(sm->PMK, sm->pmksa->pmk, sm->pmksa->pmk_len);
@@ -1941,12 +1930,12 @@
}
os_memcpy(sm->PMK, msk, pmk_len);
sm->pmk_len = pmk_len;
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
if (len >= 2 * PMK_LEN) {
os_memcpy(sm->xxkey, msk + PMK_LEN, PMK_LEN);
sm->xxkey_len = PMK_LEN;
}
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
} else {
wpa_printf(MSG_DEBUG, "WPA: Could not get PMK, get_msk: %p",
sm->wpa_auth->cb.get_msk);
@@ -1976,10 +1965,10 @@
if (psk) {
os_memcpy(sm->PMK, psk, PMK_LEN);
sm->pmk_len = PMK_LEN;
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
os_memcpy(sm->xxkey, psk, PMK_LEN);
sm->xxkey_len = PMK_LEN;
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
}
sm->req_replay_counter_used = 0;
}
@@ -2042,10 +2031,10 @@
const u8 *pmk, unsigned int pmk_len,
struct wpa_ptk *ptk)
{
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
if (wpa_key_mgmt_ft(sm->wpa_key_mgmt))
return wpa_auth_derive_ptk_ft(sm, pmk, ptk);
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
return wpa_pmk_to_ptk(pmk, pmk_len, "Pairwise key expansion",
sm->wpa_auth->addr, sm->addr, sm->ANonce, snonce,
@@ -2053,398 +2042,16 @@
}
-#ifdef CONFIG_FILS
-
-int fils_auth_pmk_to_ptk(struct wpa_state_machine *sm, const u8 *pmk,
- size_t pmk_len, const u8 *snonce, const u8 *anonce)
-{
- u8 ick[FILS_ICK_MAX_LEN];
- size_t ick_len;
- int res;
-
- res = fils_pmk_to_ptk(pmk, pmk_len, sm->addr, sm->wpa_auth->addr,
- snonce, anonce, &sm->PTK, ick, &ick_len,
- sm->wpa_key_mgmt, sm->pairwise);
- if (res < 0)
- return res;
- sm->PTK_valid = TRUE;
-
- res = fils_key_auth_sk(ick, ick_len, snonce, anonce,
- sm->addr, sm->wpa_auth->addr,
- NULL, 0, NULL, 0, /* TODO: SK+PFS */
- sm->wpa_key_mgmt, sm->fils_key_auth_sta,
- sm->fils_key_auth_ap,
- &sm->fils_key_auth_len);
- os_memset(ick, 0, sizeof(ick));
-
- /* Store nonces for (Re)Association Request/Response frame processing */
- os_memcpy(sm->SNonce, snonce, FILS_NONCE_LEN);
- os_memcpy(sm->ANonce, anonce, FILS_NONCE_LEN);
-
- return res;
-}
-
-
-static int wpa_aead_decrypt(struct wpa_state_machine *sm, struct wpa_ptk *ptk,
- u8 *buf, size_t buf_len, u16 *_key_data_len)
-{
- struct ieee802_1x_hdr *hdr;
- struct wpa_eapol_key *key;
- u8 *pos;
- u16 key_data_len;
- u8 *tmp;
- const u8 *aad[1];
- size_t aad_len[1];
-
- hdr = (struct ieee802_1x_hdr *) buf;
- key = (struct wpa_eapol_key *) (hdr + 1);
- pos = (u8 *) (key + 1);
- key_data_len = WPA_GET_BE16(pos);
- if (key_data_len < AES_BLOCK_SIZE ||
- key_data_len > buf_len - sizeof(*hdr) - sizeof(*key) - 2) {
- wpa_auth_logger(sm->wpa_auth, sm->addr, LOGGER_INFO,
- "No room for AES-SIV data in the frame");
- return -1;
- }
- pos += 2; /* Pointing at the Encrypted Key Data field */
-
- tmp = os_malloc(key_data_len);
- if (!tmp)
- return -1;
-
- /* AES-SIV AAD from EAPOL protocol version field (inclusive) to
- * to Key Data (exclusive). */
- aad[0] = buf;
- aad_len[0] = pos - buf;
- if (aes_siv_decrypt(ptk->kek, ptk->kek_len, pos, key_data_len,
- 1, aad, aad_len, tmp) < 0) {
- wpa_auth_logger(sm->wpa_auth, sm->addr, LOGGER_INFO,
- "Invalid AES-SIV data in the frame");
- bin_clear_free(tmp, key_data_len);
- return -1;
- }
-
- /* AEAD decryption and validation completed successfully */
- key_data_len -= AES_BLOCK_SIZE;
- wpa_hexdump_key(MSG_DEBUG, "WPA: Decrypted Key Data",
- tmp, key_data_len);
-
- /* Replace Key Data field with the decrypted version */
- os_memcpy(pos, tmp, key_data_len);
- pos -= 2; /* Key Data Length field */
- WPA_PUT_BE16(pos, key_data_len);
- bin_clear_free(tmp, key_data_len);
- if (_key_data_len)
- *_key_data_len = key_data_len;
- return 0;
-}
-
-
-int fils_decrypt_assoc(struct wpa_state_machine *sm, const u8 *fils_session,
- const struct ieee80211_mgmt *mgmt, size_t frame_len,
- u8 *pos, size_t left)
-{
- u16 fc, stype;
- const u8 *end, *ie_start, *ie, *session, *crypt;
- struct ieee802_11_elems elems;
- const u8 *aad[5];
- size_t aad_len[5];
-
- if (!sm || !sm->PTK_valid) {
- wpa_printf(MSG_DEBUG,
- "FILS: No KEK to decrypt Assocication Request frame");
- return -1;
- }
-
- if (!wpa_key_mgmt_fils(sm->wpa_key_mgmt)) {
- wpa_printf(MSG_DEBUG,
- "FILS: Not a FILS AKM - reject association");
- return -1;
- }
-
- end = ((const u8 *) mgmt) + frame_len;
- fc = le_to_host16(mgmt->frame_control);
- stype = WLAN_FC_GET_STYPE(fc);
- if (stype == WLAN_FC_STYPE_REASSOC_REQ)
- ie_start = mgmt->u.reassoc_req.variable;
- else
- ie_start = mgmt->u.assoc_req.variable;
- ie = ie_start;
-
- /*
- * Find FILS Session element which is the last unencrypted element in
- * the frame.
- */
- session = NULL;
- while (ie + 1 < end) {
- if (ie + 2 + ie[1] > end)
- break;
- if (ie[0] == WLAN_EID_EXTENSION &&
- ie[1] >= 1 + FILS_SESSION_LEN &&
- ie[2] == WLAN_EID_EXT_FILS_SESSION) {
- session = ie;
- break;
- }
- ie += 2 + ie[1];
- }
-
- if (!session) {
- wpa_printf(MSG_DEBUG,
- "FILS: Could not find FILS Session element in Association Request frame - reject");
- return -1;
- }
- if (os_memcmp(fils_session, session + 3, FILS_SESSION_LEN) != 0) {
- wpa_printf(MSG_DEBUG, "FILS: Session mismatch");
- wpa_hexdump(MSG_DEBUG, "FILS: Expected FILS Session",
- fils_session, FILS_SESSION_LEN);
- wpa_hexdump(MSG_DEBUG, "FILS: Received FILS Session",
- session + 3, FILS_SESSION_LEN);
- return -1;
- }
- crypt = session + 2 + session[1];
-
- if (end - crypt < AES_BLOCK_SIZE) {
- wpa_printf(MSG_DEBUG,
- "FILS: Too short frame to include AES-SIV data");
- return -1;
- }
-
- /* AES-SIV AAD vectors */
-
- /* The STA's MAC address */
- aad[0] = mgmt->sa;
- aad_len[0] = ETH_ALEN;
- /* The AP's BSSID */
- aad[1] = mgmt->da;
- aad_len[1] = ETH_ALEN;
- /* The STA's nonce */
- aad[2] = sm->SNonce;
- aad_len[2] = FILS_NONCE_LEN;
- /* The AP's nonce */
- aad[3] = sm->ANonce;
- aad_len[3] = FILS_NONCE_LEN;
- /*
- * The (Re)Association Request frame from the Capability Information
- * field to the FILS Session element (both inclusive).
- */
- aad[4] = (const u8 *) &mgmt->u.assoc_req.capab_info;
- aad_len[4] = crypt - aad[0];
-
- if (aes_siv_decrypt(sm->PTK.kek, sm->PTK.kek_len, crypt, end - crypt,
- 1, aad, aad_len, pos + (crypt - ie_start)) < 0) {
- wpa_printf(MSG_DEBUG,
- "FILS: Invalid AES-SIV data in the frame");
- return -1;
- }
- wpa_hexdump(MSG_DEBUG, "FILS: Decrypted Association Request elements",
- pos, left - AES_BLOCK_SIZE);
-
- if (ieee802_11_parse_elems(pos, left - AES_BLOCK_SIZE, &elems, 1) ==
- ParseFailed) {
- wpa_printf(MSG_DEBUG,
- "FILS: Failed to parse decrypted elements");
- return -1;
- }
- if (!elems.fils_key_confirm) {
- wpa_printf(MSG_DEBUG, "FILS: No FILS Key Confirm element");
- return -1;
- }
- if (elems.fils_key_confirm_len != sm->fils_key_auth_len) {
- wpa_printf(MSG_DEBUG,
- "FILS: Unexpected Key-Auth length %d (expected %d)",
- elems.fils_key_confirm_len,
- (int) sm->fils_key_auth_len);
- return -1;
- }
- if (os_memcmp(elems.fils_key_confirm, sm->fils_key_auth_sta,
- sm->fils_key_auth_len) != 0) {
- wpa_printf(MSG_DEBUG, "FILS: Key-Auth mismatch");
- wpa_hexdump(MSG_DEBUG, "FILS: Received Key-Auth",
- elems.fils_key_confirm,
- elems.fils_key_confirm_len);
- wpa_hexdump(MSG_DEBUG, "FILS: Expected Key-Auth",
- sm->fils_key_auth_sta, sm->fils_key_auth_len);
- return -1;
- }
-
- return left - AES_BLOCK_SIZE;
-}
-
-
-int fils_encrypt_assoc(struct wpa_state_machine *sm, u8 *buf,
- size_t current_len, size_t max_len)
-{
- u8 *end = buf + max_len;
- u8 *pos = buf + current_len;
- struct ieee80211_mgmt *mgmt;
- struct wpabuf *plain;
- u8 *len, *tmp, *tmp2;
- u8 hdr[2];
- u8 *gtk, dummy_gtk[32];
- size_t gtk_len;
- struct wpa_group *gsm;
- const u8 *aad[5];
- size_t aad_len[5];
-
- if (!sm || !sm->PTK_valid)
- return -1;
-
- wpa_hexdump(MSG_DEBUG,
- "FILS: Association Response frame before FILS processing",
- buf, current_len);
-
- mgmt = (struct ieee80211_mgmt *) buf;
-
- /* AES-SIV AAD vectors */
-
- /* The AP's BSSID */
- aad[0] = mgmt->sa;
- aad_len[0] = ETH_ALEN;
- /* The STA's MAC address */
- aad[1] = mgmt->da;
- aad_len[1] = ETH_ALEN;
- /* The AP's nonce */
- aad[2] = sm->ANonce;
- aad_len[2] = FILS_NONCE_LEN;
- /* The STA's nonce */
- aad[3] = sm->SNonce;
- aad_len[3] = FILS_NONCE_LEN;
- /*
- * The (Re)Association Response frame from the Capability Information
- * field (the same offset in both Association and Reassociation
- * Response frames) to the FILS Session element (both inclusive).
- */
- aad[4] = (const u8 *) &mgmt->u.assoc_resp.capab_info;
- aad_len[4] = pos - aad[4];
-
- /* The following elements will be encrypted with AES-SIV */
-
- plain = wpabuf_alloc(1000);
- if (!plain)
- return -1;
-
- /* TODO: FILS Public Key */
-
- /* FILS Key Confirmation */
- wpabuf_put_u8(plain, WLAN_EID_EXTENSION); /* Element ID */
- wpabuf_put_u8(plain, 1 + sm->fils_key_auth_len); /* Length */
- /* Element ID Extension */
- wpabuf_put_u8(plain, WLAN_EID_EXT_FILS_KEY_CONFIRM);
- wpabuf_put_data(plain, sm->fils_key_auth_ap, sm->fils_key_auth_len);
-
- /* TODO: FILS HLP Container */
-
- /* TODO: FILS IP Address Assignment */
-
- /* Key Delivery */
- gsm = sm->group;
- wpabuf_put_u8(plain, WLAN_EID_EXTENSION); /* Element ID */
- len = wpabuf_put(plain, 1);
- wpabuf_put_u8(plain, WLAN_EID_EXT_KEY_DELIVERY);
- wpa_auth_get_seqnum(sm->wpa_auth, NULL, gsm->GN,
- wpabuf_put(plain, WPA_KEY_RSC_LEN));
- /* GTK KDE */
- gtk = gsm->GTK[gsm->GN - 1];
- gtk_len = gsm->GTK_len;
- if (sm->wpa_auth->conf.disable_gtk) {
- /*
- * Provide unique random GTK to each STA to prevent use
- * of GTK in the BSS.
- */
- if (random_get_bytes(dummy_gtk, gtk_len) < 0) {
- wpabuf_free(plain);
- return -1;
- }
- gtk = dummy_gtk;
- }
- hdr[0] = gsm->GN & 0x03;
- hdr[1] = 0;
- tmp = wpabuf_put(plain, 0);
- tmp2 = wpa_add_kde(tmp, RSN_KEY_DATA_GROUPKEY, hdr, 2,
- gtk, gtk_len);
- wpabuf_put(plain, tmp2 - tmp);
-
- /* IGTK KDE */
- tmp = wpabuf_put(plain, 0);
- tmp2 = ieee80211w_kde_add(sm, tmp);
- wpabuf_put(plain, tmp2 - tmp);
-
- *len = (u8 *) wpabuf_put(plain, 0) - len - 1;
-
- if (pos + wpabuf_len(plain) + AES_BLOCK_SIZE > end) {
- wpa_printf(MSG_DEBUG,
- "FILS: Not enough room for FILS elements");
- wpabuf_free(plain);
- return -1;
- }
-
- wpa_hexdump_buf_key(MSG_DEBUG, "FILS: Association Response plaintext",
- plain);
-
- if (aes_siv_encrypt(sm->PTK.kek, sm->PTK.kek_len,
- wpabuf_head(plain), wpabuf_len(plain),
- 5, aad, aad_len, pos) < 0) {
- wpabuf_free(plain);
- return -1;
- }
-
- wpa_hexdump(MSG_DEBUG,
- "FILS: Encrypted Association Response elements",
- pos, AES_BLOCK_SIZE + wpabuf_len(plain));
- current_len += wpabuf_len(plain) + AES_BLOCK_SIZE;
- wpabuf_free(plain);
-
- sm->fils_completed = 1;
-
- return current_len;
-}
-
-
-int fils_set_tk(struct wpa_state_machine *sm)
-{
- enum wpa_alg alg;
- int klen;
-
- if (!sm || !sm->PTK_valid)
- return -1;
-
- alg = wpa_cipher_to_alg(sm->pairwise);
- klen = wpa_cipher_key_len(sm->pairwise);
-
- wpa_printf(MSG_DEBUG, "FILS: Configure TK to the driver");
- if (wpa_auth_set_key(sm->wpa_auth, 0, alg, sm->addr, 0,
- sm->PTK.tk, klen)) {
- wpa_printf(MSG_DEBUG, "FILS: Failed to set TK to the driver");
- return -1;
- }
-
- return 0;
-}
-
-#endif /* CONFIG_FILS */
-
-
SM_STATE(WPA_PTK, PTKCALCNEGOTIATING)
{
- struct wpa_authenticator *wpa_auth = sm->wpa_auth;
struct wpa_ptk PTK;
int ok = 0, psk_found = 0;
const u8 *pmk = NULL;
unsigned int pmk_len;
- int ft;
- const u8 *eapol_key_ie, *key_data, *mic;
- u16 key_data_length;
- size_t mic_len, eapol_key_ie_len;
- struct ieee802_1x_hdr *hdr;
- struct wpa_eapol_key *key;
- struct wpa_eapol_ie_parse kde;
SM_ENTRY_MA(WPA_PTK, PTKCALCNEGOTIATING, wpa_ptk);
sm->EAPOLKeyReceived = FALSE;
sm->update_snonce = FALSE;
- os_memset(&PTK, 0, sizeof(PTK));
-
- mic_len = wpa_mic_len(sm->wpa_key_mgmt);
/* WPA with IEEE 802.1X: use the derived PMK from EAP
* WPA-PSK: iterate through possible PSKs and select the one matching
@@ -2464,23 +2071,13 @@
wpa_derive_ptk(sm, sm->SNonce, pmk, pmk_len, &PTK);
- if (mic_len &&
- wpa_verify_key_mic(sm->wpa_key_mgmt, &PTK,
+ if (wpa_verify_key_mic(sm->wpa_key_mgmt, &PTK,
sm->last_rx_eapol_key,
sm->last_rx_eapol_key_len) == 0) {
ok = 1;
break;
}
-#ifdef CONFIG_FILS
- if (!mic_len &&
- wpa_aead_decrypt(sm, &PTK, sm->last_rx_eapol_key,
- sm->last_rx_eapol_key_len, NULL) == 0) {
- ok = 1;
- break;
- }
-#endif /* CONFIG_FILS */
-
if (!wpa_key_mgmt_wpa_psk(sm->wpa_key_mgmt))
break;
}
@@ -2493,77 +2090,7 @@
return;
}
- /*
- * Note: last_rx_eapol_key length fields have already been validated in
- * wpa_receive().
- */
- hdr = (struct ieee802_1x_hdr *) sm->last_rx_eapol_key;
- key = (struct wpa_eapol_key *) (hdr + 1);
- mic = (u8 *) (key + 1);
- key_data = mic + mic_len + 2;
- key_data_length = WPA_GET_BE16(mic + mic_len);
- if (key_data_length > sm->last_rx_eapol_key_len - sizeof(*hdr) -
- sizeof(*key) - mic_len - 2)
- return;
-
- if (wpa_parse_kde_ies(key_data, key_data_length, &kde) < 0) {
- wpa_auth_vlogger(wpa_auth, sm->addr, LOGGER_INFO,
- "received EAPOL-Key msg 2/4 with invalid Key Data contents");
- return;
- }
- if (kde.rsn_ie) {
- eapol_key_ie = kde.rsn_ie;
- eapol_key_ie_len = kde.rsn_ie_len;
- } else if (kde.osen) {
- eapol_key_ie = kde.osen;
- eapol_key_ie_len = kde.osen_len;
- } else {
- eapol_key_ie = kde.wpa_ie;
- eapol_key_ie_len = kde.wpa_ie_len;
- }
- ft = sm->wpa == WPA_VERSION_WPA2 && wpa_key_mgmt_ft(sm->wpa_key_mgmt);
- if (sm->wpa_ie == NULL ||
- wpa_compare_rsn_ie(ft, sm->wpa_ie, sm->wpa_ie_len,
- eapol_key_ie, eapol_key_ie_len)) {
- wpa_auth_logger(wpa_auth, sm->addr, LOGGER_INFO,
- "WPA IE from (Re)AssocReq did not match with msg 2/4");
- if (sm->wpa_ie) {
- wpa_hexdump(MSG_DEBUG, "WPA IE in AssocReq",
- sm->wpa_ie, sm->wpa_ie_len);
- }
- wpa_hexdump(MSG_DEBUG, "WPA IE in msg 2/4",
- eapol_key_ie, eapol_key_ie_len);
- /* MLME-DEAUTHENTICATE.request */
- wpa_sta_disconnect(wpa_auth, sm->addr);
- return;
- }
-#ifdef CONFIG_IEEE80211R_AP
- if (ft && ft_check_msg_2_of_4(wpa_auth, sm, &kde) < 0) {
- wpa_sta_disconnect(wpa_auth, sm->addr);
- return;
- }
-#endif /* CONFIG_IEEE80211R_AP */
-#ifdef CONFIG_P2P
- if (kde.ip_addr_req && kde.ip_addr_req[0] &&
- wpa_auth->ip_pool && WPA_GET_BE32(sm->ip_addr) == 0) {
- int idx;
- wpa_printf(MSG_DEBUG,
- "P2P: IP address requested in EAPOL-Key exchange");
- idx = bitfield_get_first_zero(wpa_auth->ip_pool);
- if (idx >= 0) {
- u32 start = WPA_GET_BE32(wpa_auth->conf.ip_addr_start);
- bitfield_set(wpa_auth->ip_pool, idx);
- WPA_PUT_BE32(sm->ip_addr, start + idx);
- wpa_printf(MSG_DEBUG,
- "P2P: Assigned IP address %u.%u.%u.%u to "
- MACSTR, sm->ip_addr[0], sm->ip_addr[1],
- sm->ip_addr[2], sm->ip_addr[3],
- MAC2STR(sm->addr));
- }
- }
-#endif /* CONFIG_P2P */
-
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
if (sm->wpa == WPA_VERSION_WPA2 && wpa_key_mgmt_ft(sm->wpa_key_mgmt)) {
/*
* Verify that PMKR1Name from EAPOL-Key message 2/4 matches
@@ -2582,7 +2109,7 @@
return;
}
}
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
sm->pending_1_of_4_timeout = 0;
eloop_cancel_timeout(wpa_send_eapol_timeout, sm->wpa_auth, sm);
@@ -2752,12 +2279,12 @@
kde_len = wpa_ie_len + ieee80211w_kde_len(sm);
if (gtk)
kde_len += 2 + RSN_SELECTOR_LEN + 2 + gtk_len;
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
if (wpa_key_mgmt_ft(sm->wpa_key_mgmt)) {
kde_len += 2 + PMKID_LEN; /* PMKR1Name into RSN IE */
kde_len += 300; /* FTIE + 2 * TIE */
}
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
#ifdef CONFIG_P2P
if (WPA_GET_BE32(sm->ip_addr) > 0)
kde_len += 2 + RSN_SELECTOR_LEN + 3 * 4;
@@ -2769,7 +2296,7 @@
pos = kde;
os_memcpy(pos, wpa_ie, wpa_ie_len);
pos += wpa_ie_len;
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
if (wpa_key_mgmt_ft(sm->wpa_key_mgmt)) {
int res;
size_t elen;
@@ -2785,7 +2312,7 @@
pos -= wpa_ie_len;
pos += elen;
}
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
if (gtk) {
u8 hdr[2];
hdr[0] = keyidx & 0x03;
@@ -2795,7 +2322,7 @@
}
pos = ieee80211w_kde_add(sm, pos);
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
if (wpa_key_mgmt_ft(sm->wpa_key_mgmt)) {
int res;
struct wpa_auth_config *conf;
@@ -2835,7 +2362,7 @@
WPA_PUT_LE32(pos, conf->r0_key_lifetime * 60);
pos += 4;
}
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
#ifdef CONFIG_P2P
if (WPA_GET_BE32(sm->ip_addr) > 0) {
u8 addr[3 * 4];
@@ -2848,8 +2375,7 @@
#endif /* CONFIG_P2P */
wpa_send_eapol(sm->wpa_auth, sm,
- (secure ? WPA_KEY_INFO_SECURE : 0) |
- (wpa_mic_len(sm->wpa_key_mgmt) ? WPA_KEY_INFO_MIC : 0) |
+ (secure ? WPA_KEY_INFO_SECURE : 0) | WPA_KEY_INFO_MIC |
WPA_KEY_INFO_ACK | WPA_KEY_INFO_INSTALL |
WPA_KEY_INFO_KEY_TYPE,
_rsc, sm->ANonce, kde, pos - kde, keyidx, encr);
@@ -2905,9 +2431,9 @@
"pairwise key handshake completed (%s)",
sm->wpa == WPA_VERSION_WPA ? "WPA" : "RSN");
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
wpa_ft_push_pmk_r1(sm->wpa_auth, sm->addr);
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
}
@@ -3093,8 +2619,7 @@
}
wpa_send_eapol(sm->wpa_auth, sm,
- WPA_KEY_INFO_SECURE |
- (wpa_mic_len(sm->wpa_key_mgmt) ? WPA_KEY_INFO_MIC : 0) |
+ WPA_KEY_INFO_SECURE | WPA_KEY_INFO_MIC |
WPA_KEY_INFO_ACK |
(!sm->Pair ? WPA_KEY_INFO_INSTALL : 0),
rsc, gsm->GNonce, kde, kde_len, gsm->GN, 1);
@@ -3851,12 +3376,11 @@
struct rsn_pmksa_cache_entry *
-wpa_auth_pmksa_get(struct wpa_authenticator *wpa_auth, const u8 *sta_addr,
- const u8 *pmkid)
+wpa_auth_pmksa_get(struct wpa_authenticator *wpa_auth, const u8 *sta_addr)
{
if (!wpa_auth || !wpa_auth->pmksa)
return NULL;
- return pmksa_cache_auth_get(wpa_auth->pmksa, sta_addr, pmkid);
+ return pmksa_cache_auth_get(wpa_auth->pmksa, sta_addr, NULL);
}
diff --git a/src/ap/wpa_auth.h b/src/ap/wpa_auth.h
index 743f2e6..0de8d97 100644
--- a/src/ap/wpa_auth.h
+++ b/src/ap/wpa_auth.h
@@ -157,7 +157,7 @@
enum mfp_options ieee80211w;
int group_mgmt_cipher;
#endif /* CONFIG_IEEE80211W */
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
u8 ssid[SSID_MAX_LEN];
size_t ssid_len;
u8 mobility_domain[MOBILITY_DOMAIN_ID_LEN];
@@ -170,8 +170,7 @@
struct ft_remote_r1kh *r1kh_list;
int pmk_r1_push;
int ft_over_ds;
- int ft_psk_generate_local;
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
int disable_gtk;
int ap_mlme;
#ifdef CONFIG_TESTING_OPTIONS
@@ -221,13 +220,13 @@
void *ctx), void *cb_ctx);
int (*send_ether)(void *ctx, const u8 *dst, u16 proto, const u8 *data,
size_t data_len);
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
struct wpa_state_machine * (*add_sta)(void *ctx, const u8 *sta_addr);
int (*send_ft_action)(void *ctx, const u8 *dst,
const u8 *data, size_t data_len);
int (*add_tspec)(void *ctx, const u8 *sta_addr, u8 *tspec_ie,
size_t tspec_ielen);
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
#ifdef CONFIG_MESH
int (*start_ampe)(void *ctx, const u8 *sta_addr);
#endif /* CONFIG_MESH */
@@ -303,8 +302,7 @@
size_t len);
void wpa_auth_pmksa_flush(struct wpa_authenticator *wpa_auth);
struct rsn_pmksa_cache_entry *
-wpa_auth_pmksa_get(struct wpa_authenticator *wpa_auth, const u8 *sta_addr,
- const u8 *pmkid);
+wpa_auth_pmksa_get(struct wpa_authenticator *wpa_auth, const u8 *sta_addr);
void wpa_auth_pmksa_set_to_sm(struct rsn_pmksa_cache_entry *pmksa,
struct wpa_state_machine *sm,
struct wpa_authenticator *wpa_auth,
@@ -313,7 +311,7 @@
void wpa_auth_eapol_key_tx_status(struct wpa_authenticator *wpa_auth,
struct wpa_state_machine *sm, int ack);
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
u8 * wpa_sm_write_assoc_resp_ies(struct wpa_state_machine *sm, u8 *pos,
size_t max_len, int auth_alg,
const u8 *req_ies, size_t req_ies_len);
@@ -329,7 +327,7 @@
int wpa_ft_rrb_rx(struct wpa_authenticator *wpa_auth, const u8 *src_addr,
const u8 *data, size_t data_len);
void wpa_ft_push_pmk_r1(struct wpa_authenticator *wpa_auth, const u8 *addr);
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
void wpa_wnmsleep_rekey_gtk(struct wpa_state_machine *sm);
void wpa_set_wnmsleep(struct wpa_state_machine *sm, int flag);
@@ -348,13 +346,5 @@
int wpa_auth_ensure_group(struct wpa_authenticator *wpa_auth, int vlan_id);
int wpa_auth_release_group(struct wpa_authenticator *wpa_auth, int vlan_id);
-int fils_auth_pmk_to_ptk(struct wpa_state_machine *sm, const u8 *pmk,
- size_t pmk_len, const u8 *snonce, const u8 *anonce);
-int fils_decrypt_assoc(struct wpa_state_machine *sm, const u8 *fils_session,
- const struct ieee80211_mgmt *mgmt, size_t frame_len,
- u8 *pos, size_t left);
-int fils_encrypt_assoc(struct wpa_state_machine *sm, u8 *buf,
- size_t current_len, size_t max_len);
-int fils_set_tk(struct wpa_state_machine *sm);
#endif /* WPA_AUTH_H */
diff --git a/src/ap/wpa_auth_ft.c b/src/ap/wpa_auth_ft.c
index 637d6d6..42242a5 100644
--- a/src/ap/wpa_auth_ft.c
+++ b/src/ap/wpa_auth_ft.c
@@ -22,7 +22,7 @@
#include "wpa_auth_i.h"
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
static int wpa_ft_send_rrb_auth_resp(struct wpa_state_machine *sm,
const u8 *current_ap, const u8 *sta_addr,
@@ -51,17 +51,6 @@
}
-static const u8 * wpa_ft_get_psk(struct wpa_authenticator *wpa_auth,
- const u8 *addr, const u8 *p2p_dev_addr,
- const u8 *prev_psk)
-{
- if (wpa_auth->cb.get_psk == NULL)
- return NULL;
- return wpa_auth->cb.get_psk(wpa_auth->cb.ctx, addr, p2p_dev_addr,
- prev_psk);
-}
-
-
static struct wpa_state_machine *
wpa_ft_add_sta(struct wpa_authenticator *wpa_auth, const u8 *sta_addr)
{
@@ -384,7 +373,6 @@
const u8 *r1kh = sm->wpa_auth->conf.r1_key_holder;
const u8 *ssid = sm->wpa_auth->conf.ssid;
size_t ssid_len = sm->wpa_auth->conf.ssid_len;
- int psk_local = sm->wpa_auth->conf.ft_psk_generate_local;
if (sm->xxkey_len == 0) {
wpa_printf(MSG_DEBUG, "FT: XXKey not available for key "
@@ -396,18 +384,16 @@
r0kh, r0kh_len, sm->addr, pmk_r0, pmk_r0_name);
wpa_hexdump_key(MSG_DEBUG, "FT: PMK-R0", pmk_r0, PMK_LEN);
wpa_hexdump(MSG_DEBUG, "FT: PMKR0Name", pmk_r0_name, WPA_PMK_NAME_LEN);
- if (!psk_local || !wpa_key_mgmt_ft_psk(sm->wpa_key_mgmt))
- wpa_ft_store_pmk_r0(sm->wpa_auth, sm->addr, pmk_r0, pmk_r0_name,
- sm->pairwise);
+ wpa_ft_store_pmk_r0(sm->wpa_auth, sm->addr, pmk_r0, pmk_r0_name,
+ sm->pairwise);
wpa_derive_pmk_r1(pmk_r0, pmk_r0_name, r1kh, sm->addr,
pmk_r1, sm->pmk_r1_name);
wpa_hexdump_key(MSG_DEBUG, "FT: PMK-R1", pmk_r1, PMK_LEN);
wpa_hexdump(MSG_DEBUG, "FT: PMKR1Name", sm->pmk_r1_name,
WPA_PMK_NAME_LEN);
- if (!psk_local || !wpa_key_mgmt_ft_psk(sm->wpa_key_mgmt))
- wpa_ft_store_pmk_r1(sm->wpa_auth, sm->addr, pmk_r1,
- sm->pmk_r1_name, sm->pairwise);
+ wpa_ft_store_pmk_r1(sm->wpa_auth, sm->addr, pmk_r1, sm->pmk_r1_name,
+ sm->pairwise);
return wpa_pmk_r1_to_ptk(pmk_r1, sm->SNonce, sm->ANonce, sm->addr,
sm->wpa_auth->addr, sm->pmk_r1_name,
@@ -809,89 +795,6 @@
}
-/* Derive PMK-R1 from PSK, check all available PSK */
-static int wpa_ft_psk_pmk_r1(struct wpa_state_machine *sm,
- const u8 *req_pmk_r1_name,
- u8 *out_pmk_r1, int *out_pairwise)
-{
- const u8 *pmk = NULL;
- u8 pmk_r0[PMK_LEN], pmk_r0_name[WPA_PMK_NAME_LEN];
- u8 pmk_r1[PMK_LEN], pmk_r1_name[WPA_PMK_NAME_LEN];
- struct wpa_authenticator *wpa_auth = sm->wpa_auth;
- const u8 *mdid = wpa_auth->conf.mobility_domain;
- const u8 *r0kh = sm->r0kh_id;
- size_t r0kh_len = sm->r0kh_id_len;
- const u8 *r1kh = wpa_auth->conf.r1_key_holder;
- const u8 *ssid = wpa_auth->conf.ssid;
- size_t ssid_len = wpa_auth->conf.ssid_len;
- int pairwise;
-
- pairwise = sm->pairwise;
-
- for (;;) {
- pmk = wpa_ft_get_psk(wpa_auth, sm->addr, sm->p2p_dev_addr,
- pmk);
- if (pmk == NULL)
- break;
-
- wpa_derive_pmk_r0(pmk, PMK_LEN, ssid, ssid_len, mdid, r0kh,
- r0kh_len, sm->addr, pmk_r0, pmk_r0_name);
- wpa_derive_pmk_r1(pmk_r0, pmk_r0_name, r1kh, sm->addr,
- pmk_r1, pmk_r1_name);
-
- if (os_memcmp_const(pmk_r1_name, req_pmk_r1_name,
- WPA_PMK_NAME_LEN) != 0)
- continue;
-
- /* We found a PSK that matches the requested pmk_r1_name */
- wpa_printf(MSG_DEBUG,
- "FT: Found PSK to generate PMK-R1 locally");
- os_memcpy(out_pmk_r1, pmk_r1, PMK_LEN);
- if (out_pairwise)
- *out_pairwise = pairwise;
- return 0;
- }
-
- wpa_printf(MSG_DEBUG,
- "FT: Did not find PSK to generate PMK-R1 locally");
- return -1;
-}
-
-
-/* Detect the configuration the station asked for.
- * Required to detect FT-PSK and pairwise cipher.
- */
-static int wpa_ft_set_key_mgmt(struct wpa_state_machine *sm,
- struct wpa_ft_ies *parse)
-{
- int key_mgmt, ciphers;
-
- if (sm->wpa_key_mgmt)
- return 0;
-
- key_mgmt = parse->key_mgmt & sm->wpa_auth->conf.wpa_key_mgmt;
- if (!key_mgmt) {
- wpa_printf(MSG_DEBUG, "FT: Invalid key mgmt (0x%x) from "
- MACSTR, parse->key_mgmt, MAC2STR(sm->addr));
- return -1;
- }
- if (key_mgmt & WPA_KEY_MGMT_FT_IEEE8021X)
- sm->wpa_key_mgmt = WPA_KEY_MGMT_FT_IEEE8021X;
- else if (key_mgmt & WPA_KEY_MGMT_FT_PSK)
- sm->wpa_key_mgmt = WPA_KEY_MGMT_FT_PSK;
- ciphers = parse->pairwise_cipher & sm->wpa_auth->conf.rsn_pairwise;
- if (!ciphers) {
- wpa_printf(MSG_DEBUG, "FT: Invalid pairwise cipher (0x%x) from "
- MACSTR,
- parse->pairwise_cipher, MAC2STR(sm->addr));
- return -1;
- }
- sm->pairwise = wpa_pick_pairwise_cipher(ciphers, 0);
-
- return 0;
-}
-
-
static int wpa_ft_process_auth_req(struct wpa_state_machine *sm,
const u8 *ies, size_t ies_len,
u8 **resp_ies, size_t *resp_ies_len)
@@ -953,9 +856,6 @@
return WLAN_STATUS_INVALID_PMKID;
}
- if (wpa_ft_set_key_mgmt(sm, &parse) < 0)
- return WLAN_STATUS_UNSPECIFIED_FAILURE;
-
wpa_hexdump(MSG_DEBUG, "FT: Requested PMKR0Name",
parse.rsn_pmkid, WPA_PMK_NAME_LEN);
wpa_derive_pmk_r1_name(parse.rsn_pmkid,
@@ -964,12 +864,8 @@
wpa_hexdump(MSG_DEBUG, "FT: Derived requested PMKR1Name",
pmk_r1_name, WPA_PMK_NAME_LEN);
- if (conf->ft_psk_generate_local &&
- wpa_key_mgmt_ft_psk(sm->wpa_key_mgmt)) {
- if (wpa_ft_psk_pmk_r1(sm, pmk_r1_name, pmk_r1, &pairwise) < 0)
- return WLAN_STATUS_INVALID_PMKID;
- } else if (wpa_ft_fetch_pmk_r1(sm->wpa_auth, sm->addr, pmk_r1_name,
- pmk_r1, &pairwise) < 0) {
+ if (wpa_ft_fetch_pmk_r1(sm->wpa_auth, sm->addr, pmk_r1_name, pmk_r1,
+ &pairwise) < 0) {
if (wpa_ft_pull_pmk_r1(sm, ies, ies_len, parse.rsn_pmkid) < 0) {
wpa_printf(MSG_DEBUG, "FT: Did not have matching "
"PMK-R1 and unknown R0KH-ID");
@@ -1145,7 +1041,7 @@
ftie->snonce, WPA_NONCE_LEN);
wpa_hexdump(MSG_DEBUG, "FT: Expected SNonce",
sm->SNonce, WPA_NONCE_LEN);
- return WLAN_STATUS_INVALID_FTIE;
+ return -1;
}
if (os_memcmp(ftie->anonce, sm->ANonce, WPA_NONCE_LEN) != 0) {
@@ -1154,13 +1050,13 @@
ftie->anonce, WPA_NONCE_LEN);
wpa_hexdump(MSG_DEBUG, "FT: Expected ANonce",
sm->ANonce, WPA_NONCE_LEN);
- return WLAN_STATUS_INVALID_FTIE;
+ return -1;
}
if (parse.r0kh_id == NULL) {
wpa_printf(MSG_DEBUG, "FT: No R0KH-ID subelem in FTIE");
- return WLAN_STATUS_INVALID_FTIE;
+ return -1;
}
if (parse.r0kh_id_len != sm->r0kh_id_len ||
@@ -1172,12 +1068,12 @@
parse.r0kh_id, parse.r0kh_id_len);
wpa_hexdump(MSG_DEBUG, "FT: The current R0KH-ID",
sm->r0kh_id, sm->r0kh_id_len);
- return WLAN_STATUS_INVALID_FTIE;
+ return -1;
}
if (parse.r1kh_id == NULL) {
wpa_printf(MSG_DEBUG, "FT: No R1KH-ID subelem in FTIE");
- return WLAN_STATUS_INVALID_FTIE;
+ return -1;
}
if (os_memcmp_const(parse.r1kh_id, sm->wpa_auth->conf.r1_key_holder,
@@ -1188,7 +1084,7 @@
parse.r1kh_id, FT_R1KH_ID_LEN);
wpa_hexdump(MSG_DEBUG, "FT: Expected R1KH-ID",
sm->wpa_auth->conf.r1_key_holder, FT_R1KH_ID_LEN);
- return WLAN_STATUS_INVALID_FTIE;
+ return -1;
}
if (parse.rsn_pmkid == NULL ||
@@ -1196,7 +1092,7 @@
{
wpa_printf(MSG_DEBUG, "FT: No matching PMKR1Name (PMKID) in "
"RSNIE (pmkid=%d)", !!parse.rsn_pmkid);
- return WLAN_STATUS_INVALID_PMKID;
+ return -1;
}
count = 3;
@@ -1206,7 +1102,7 @@
wpa_printf(MSG_DEBUG, "FT: Unexpected IE count in MIC "
"Control: received %u expected %u",
ftie->mic_control[1], count);
- return WLAN_STATUS_UNSPECIFIED_FAILURE;
+ return -1;
}
if (wpa_ft_mic(sm->PTK.kck, sm->PTK.kck_len, sm->addr,
@@ -1893,4 +1789,4 @@
}
}
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
diff --git a/src/ap/wpa_auth_glue.c b/src/ap/wpa_auth_glue.c
index aabac36..2142414 100644
--- a/src/ap/wpa_auth_glue.c
+++ b/src/ap/wpa_auth_glue.c
@@ -53,7 +53,7 @@
wconf->ieee80211w = conf->ieee80211w;
wconf->group_mgmt_cipher = conf->group_mgmt_cipher;
#endif /* CONFIG_IEEE80211W */
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
wconf->ssid_len = conf->ssid.ssid_len;
if (wconf->ssid_len > SSID_MAX_LEN)
wconf->ssid_len = SSID_MAX_LEN;
@@ -73,8 +73,7 @@
wconf->r1kh_list = conf->r1kh_list;
wconf->pmk_r1_push = conf->pmk_r1_push;
wconf->ft_over_ds = conf->ft_over_ds;
- wconf->ft_psk_generate_local = conf->ft_psk_generate_local;
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
#ifdef CONFIG_HS20
wconf->disable_gtk = conf->disable_dgaf;
if (conf->osen) {
@@ -402,7 +401,7 @@
}
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
struct wpa_auth_ft_iface_iter_data {
struct hostapd_data *src_hapd;
@@ -441,7 +440,7 @@
return 0;
}
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
static int hostapd_wpa_auth_send_ether(void *ctx, const u8 *dst, u16 proto,
@@ -466,7 +465,7 @@
}
#endif /* CONFIG_TESTING_OPTIONS */
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
if (proto == ETH_P_RRB && hapd->iface->interfaces &&
hapd->iface->interfaces->for_each_interface) {
int res;
@@ -481,7 +480,7 @@
if (res == 1)
return data_len;
}
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
if (hapd->driver && hapd->driver->send_ether)
return hapd->driver->send_ether(hapd->drv_priv, dst,
@@ -504,7 +503,7 @@
}
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
static int hostapd_wpa_auth_send_ft_action(void *ctx, const u8 *dst,
const u8 *data, size_t data_len)
@@ -589,7 +588,7 @@
return hostapd_add_tspec(hapd, sta_addr, tspec_ie, tspec_ielen);
}
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
int hostapd_setup_wpa(struct hostapd_data *hapd)
@@ -620,11 +619,11 @@
cb.for_each_sta = hostapd_wpa_auth_for_each_sta;
cb.for_each_auth = hostapd_wpa_auth_for_each_auth;
cb.send_ether = hostapd_wpa_auth_send_ether;
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
cb.send_ft_action = hostapd_wpa_auth_send_ft_action;
cb.add_sta = hostapd_wpa_auth_add_sta;
cb.add_tspec = hostapd_wpa_auth_add_tspec;
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
hapd->wpa_auth = wpa_init(hapd->own_addr, &_conf, &cb);
if (hapd->wpa_auth == NULL) {
wpa_printf(MSG_ERROR, "WPA initialization failed.");
@@ -650,7 +649,7 @@
return -1;
}
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
if (!hostapd_drv_none(hapd) &&
wpa_key_mgmt_ft(hapd->conf->wpa_key_mgmt)) {
hapd->l2 = l2_packet_init(hapd->conf->bridge[0] ?
@@ -665,7 +664,7 @@
return -1;
}
}
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
return 0;
@@ -703,8 +702,8 @@
}
ieee802_1x_deinit(hapd);
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
l2_packet_deinit(hapd->l2);
hapd->l2 = NULL;
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
}
diff --git a/src/ap/wpa_auth_i.h b/src/ap/wpa_auth_i.h
index 0c5a457..72b7eb3 100644
--- a/src/ap/wpa_auth_i.h
+++ b/src/ap/wpa_auth_i.h
@@ -88,10 +88,10 @@
unsigned int rx_eapol_key_secure:1;
unsigned int update_snonce:1;
unsigned int alt_snonce_valid:1;
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
unsigned int ft_completed:1;
unsigned int pmk_r1_name_valid:1;
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
unsigned int is_wnmsleep:1;
u8 req_replay_counter[WPA_REPLAY_COUNTER_LEN];
@@ -112,7 +112,7 @@
u32 dot11RSNAStatsTKIPLocalMICFailures;
u32 dot11RSNAStatsTKIPRemoteMICFailures;
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
u8 xxkey[PMK_LEN]; /* PSK or the second 256 bits of MSK */
size_t xxkey_len;
u8 pmk_r1_name[WPA_PMK_NAME_LEN]; /* PMKR1Name derived from FT Auth
@@ -131,20 +131,13 @@
u8 ft_pending_pull_nonce[FT_R0KH_R1KH_PULL_NONCE_LEN];
u8 ft_pending_auth_transaction;
u8 ft_pending_current_ap[ETH_ALEN];
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
int pending_1_of_4_timeout;
#ifdef CONFIG_P2P
u8 ip_addr[4];
#endif /* CONFIG_P2P */
-
-#ifdef CONFIG_FILS
- u8 fils_key_auth_sta[FILS_MAX_KEY_AUTH_LEN];
- u8 fils_key_auth_ap[FILS_MAX_KEY_AUTH_LEN];
- size_t fils_key_auth_len;
- unsigned int fils_completed:1;
-#endif /* CONFIG_FILS */
};
@@ -251,7 +244,7 @@
const u8 *key_data, size_t key_data_len);
#endif /* CONFIG_PEERKEY */
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
int wpa_write_mdie(struct wpa_auth_config *conf, u8 *buf, size_t len);
int wpa_write_ftie(struct wpa_auth_config *conf, const u8 *r0kh_id,
size_t r0kh_id_len,
@@ -263,6 +256,6 @@
struct wpa_ft_pmk_cache * wpa_ft_pmk_cache_init(void);
void wpa_ft_pmk_cache_deinit(struct wpa_ft_pmk_cache *cache);
void wpa_ft_install_ptk(struct wpa_state_machine *sm);
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
#endif /* WPA_AUTH_I_H */
diff --git a/src/ap/wpa_auth_ie.c b/src/ap/wpa_auth_ie.c
index 1df3009..f79783b 100644
--- a/src/ap/wpa_auth_ie.c
+++ b/src/ap/wpa_auth_ie.c
@@ -164,7 +164,7 @@
pos += RSN_SELECTOR_LEN;
num_suites++;
}
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
if (conf->wpa_key_mgmt & WPA_KEY_MGMT_FT_IEEE8021X) {
RSN_SELECTOR_PUT(pos, RSN_AUTH_KEY_MGMT_FT_802_1X);
pos += RSN_SELECTOR_LEN;
@@ -175,7 +175,7 @@
pos += RSN_SELECTOR_LEN;
num_suites++;
}
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
#ifdef CONFIG_IEEE80211W
if (conf->wpa_key_mgmt & WPA_KEY_MGMT_IEEE8021X_SHA256) {
RSN_SELECTOR_PUT(pos, RSN_AUTH_KEY_MGMT_802_1X_SHA256);
@@ -210,30 +210,6 @@
pos += RSN_SELECTOR_LEN;
num_suites++;
}
-#ifdef CONFIG_FILS
- if (conf->wpa_key_mgmt & WPA_KEY_MGMT_FILS_SHA256) {
- RSN_SELECTOR_PUT(pos, RSN_AUTH_KEY_MGMT_FILS_SHA256);
- pos += RSN_SELECTOR_LEN;
- num_suites++;
- }
- if (conf->wpa_key_mgmt & WPA_KEY_MGMT_FILS_SHA384) {
- RSN_SELECTOR_PUT(pos, RSN_AUTH_KEY_MGMT_FILS_SHA384);
- pos += RSN_SELECTOR_LEN;
- num_suites++;
- }
-#ifdef CONFIG_IEEE80211R_AP
- if (conf->wpa_key_mgmt & WPA_KEY_MGMT_FT_FILS_SHA256) {
- RSN_SELECTOR_PUT(pos, RSN_AUTH_KEY_MGMT_FT_FILS_SHA256);
- pos += RSN_SELECTOR_LEN;
- num_suites++;
- }
- if (conf->wpa_key_mgmt & WPA_KEY_MGMT_FT_FILS_SHA384) {
- RSN_SELECTOR_PUT(pos, RSN_AUTH_KEY_MGMT_FT_FILS_SHA384);
- pos += RSN_SELECTOR_LEN;
- num_suites++;
- }
-#endif /* CONFIG_IEEE80211R_AP */
-#endif /* CONFIG_FILS */
#ifdef CONFIG_RSN_TESTING
if (rsn_testing) {
@@ -431,7 +407,7 @@
return res;
pos += res;
}
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
if (wpa_key_mgmt_ft(wpa_auth->conf.wpa_key_mgmt)) {
res = wpa_write_mdie(&wpa_auth->conf, pos,
buf + sizeof(buf) - pos);
@@ -439,7 +415,7 @@
return res;
pos += res;
}
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
if (wpa_auth->conf.wpa & WPA_PROTO_WPA) {
res = wpa_write_wpa_ie(&wpa_auth->conf,
pos, buf + sizeof(buf) - pos);
@@ -533,24 +509,12 @@
selector = RSN_AUTH_KEY_MGMT_802_1X_SUITE_B_192;
else if (data.key_mgmt & WPA_KEY_MGMT_IEEE8021X_SUITE_B)
selector = RSN_AUTH_KEY_MGMT_802_1X_SUITE_B;
-#ifdef CONFIG_FILS
-#ifdef CONFIG_IEEE80211R_AP
- else if (data.key_mgmt & WPA_KEY_MGMT_FT_FILS_SHA384)
- selector = RSN_AUTH_KEY_MGMT_FT_FILS_SHA384;
- else if (data.key_mgmt & WPA_KEY_MGMT_FT_FILS_SHA256)
- selector = RSN_AUTH_KEY_MGMT_FT_FILS_SHA256;
-#endif /* CONFIG_IEEE80211R_AP */
- else if (data.key_mgmt & WPA_KEY_MGMT_FILS_SHA384)
- selector = RSN_AUTH_KEY_MGMT_FILS_SHA384;
- else if (data.key_mgmt & WPA_KEY_MGMT_FILS_SHA256)
- selector = RSN_AUTH_KEY_MGMT_FILS_SHA256;
-#endif /* CONFIG_FILS */
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
else if (data.key_mgmt & WPA_KEY_MGMT_FT_IEEE8021X)
selector = RSN_AUTH_KEY_MGMT_FT_802_1X;
else if (data.key_mgmt & WPA_KEY_MGMT_FT_PSK)
selector = RSN_AUTH_KEY_MGMT_FT_PSK;
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
#ifdef CONFIG_IEEE80211W
else if (data.key_mgmt & WPA_KEY_MGMT_IEEE8021X_SHA256)
selector = RSN_AUTH_KEY_MGMT_802_1X_SHA256;
@@ -627,24 +591,12 @@
sm->wpa_key_mgmt = WPA_KEY_MGMT_IEEE8021X_SUITE_B_192;
else if (key_mgmt & WPA_KEY_MGMT_IEEE8021X_SUITE_B)
sm->wpa_key_mgmt = WPA_KEY_MGMT_IEEE8021X_SUITE_B;
-#ifdef CONFIG_FILS
-#ifdef CONFIG_IEEE80211R_AP
- else if (key_mgmt & WPA_KEY_MGMT_FT_FILS_SHA384)
- sm->wpa_key_mgmt = WPA_KEY_MGMT_FT_FILS_SHA384;
- else if (data.key_mgmt & WPA_KEY_MGMT_FT_FILS_SHA256)
- sm->wpa_key_mgmt = WPA_KEY_MGMT_FT_FILS_SHA256;
-#endif /* CONFIG_IEEE80211R_AP */
- else if (key_mgmt & WPA_KEY_MGMT_FILS_SHA384)
- sm->wpa_key_mgmt = WPA_KEY_MGMT_FILS_SHA384;
- else if (key_mgmt & WPA_KEY_MGMT_FILS_SHA256)
- sm->wpa_key_mgmt = WPA_KEY_MGMT_FILS_SHA256;
-#endif /* CONFIG_FILS */
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
else if (key_mgmt & WPA_KEY_MGMT_FT_IEEE8021X)
sm->wpa_key_mgmt = WPA_KEY_MGMT_FT_IEEE8021X;
else if (key_mgmt & WPA_KEY_MGMT_FT_PSK)
sm->wpa_key_mgmt = WPA_KEY_MGMT_FT_PSK;
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
#ifdef CONFIG_IEEE80211W
else if (key_mgmt & WPA_KEY_MGMT_IEEE8021X_SHA256)
sm->wpa_key_mgmt = WPA_KEY_MGMT_IEEE8021X_SHA256;
@@ -703,7 +655,7 @@
sm->mgmt_frame_prot = 1;
#endif /* CONFIG_IEEE80211W */
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
if (wpa_key_mgmt_ft(sm->wpa_key_mgmt)) {
if (mdie == NULL || mdie_len < MOBILITY_DOMAIN_ID_LEN + 1) {
wpa_printf(MSG_DEBUG, "RSN: Trying to use FT, but "
@@ -717,7 +669,7 @@
return WPA_INVALID_MDIE;
}
}
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
sm->pairwise = wpa_pick_pairwise_cipher(ciphers, 0);
if (sm->pairwise < 0)
@@ -956,14 +908,14 @@
if (*pos == WLAN_EID_RSN) {
ie->rsn_ie = pos;
ie->rsn_ie_len = pos[1] + 2;
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
} else if (*pos == WLAN_EID_MOBILITY_DOMAIN) {
ie->mdie = pos;
ie->mdie_len = pos[1] + 2;
} else if (*pos == WLAN_EID_FAST_BSS_TRANSITION) {
ie->ftie = pos;
ie->ftie_len = pos[1] + 2;
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
} else if (*pos == WLAN_EID_VENDOR_SPECIFIC) {
ret = wpa_parse_generic(pos, end, ie);
if (ret < 0)
diff --git a/src/ap/wpa_auth_ie.h b/src/ap/wpa_auth_ie.h
index 5c3bd18..d2067ba 100644
--- a/src/ap/wpa_auth_ie.h
+++ b/src/ap/wpa_auth_ie.h
@@ -33,12 +33,12 @@
const u8 *igtk;
size_t igtk_len;
#endif /* CONFIG_IEEE80211W */
-#ifdef CONFIG_IEEE80211R_AP
+#ifdef CONFIG_IEEE80211R
const u8 *mdie;
size_t mdie_len;
const u8 *ftie;
size_t ftie_len;
-#endif /* CONFIG_IEEE80211R_AP */
+#endif /* CONFIG_IEEE80211R */
#ifdef CONFIG_P2P
const u8 *ip_addr_req;
const u8 *ip_addr_alloc;
diff --git a/src/common/defs.h b/src/common/defs.h
index 4dd5690..4f56794 100644
--- a/src/common/defs.h
+++ b/src/common/defs.h
@@ -51,10 +51,6 @@
#define WPA_KEY_MGMT_OSEN BIT(15)
#define WPA_KEY_MGMT_IEEE8021X_SUITE_B BIT(16)
#define WPA_KEY_MGMT_IEEE8021X_SUITE_B_192 BIT(17)
-#define WPA_KEY_MGMT_FILS_SHA256 BIT(18)
-#define WPA_KEY_MGMT_FILS_SHA384 BIT(19)
-#define WPA_KEY_MGMT_FT_FILS_SHA256 BIT(20)
-#define WPA_KEY_MGMT_FT_FILS_SHA384 BIT(21)
static inline int wpa_key_mgmt_wpa_ieee8021x(int akm)
{
@@ -64,11 +60,7 @@
WPA_KEY_MGMT_OSEN |
WPA_KEY_MGMT_IEEE8021X_SHA256 |
WPA_KEY_MGMT_IEEE8021X_SUITE_B |
- WPA_KEY_MGMT_IEEE8021X_SUITE_B_192 |
- WPA_KEY_MGMT_FILS_SHA256 |
- WPA_KEY_MGMT_FILS_SHA384 |
- WPA_KEY_MGMT_FT_FILS_SHA256 |
- WPA_KEY_MGMT_FT_FILS_SHA384));
+ WPA_KEY_MGMT_IEEE8021X_SUITE_B_192));
}
static inline int wpa_key_mgmt_wpa_psk(int akm)
@@ -84,14 +76,7 @@
{
return !!(akm & (WPA_KEY_MGMT_FT_PSK |
WPA_KEY_MGMT_FT_IEEE8021X |
- WPA_KEY_MGMT_FT_SAE |
- WPA_KEY_MGMT_FT_FILS_SHA256 |
- WPA_KEY_MGMT_FT_FILS_SHA384));
-}
-
-static inline int wpa_key_mgmt_ft_psk(int akm)
-{
- return !!(akm & WPA_KEY_MGMT_FT_PSK);
+ WPA_KEY_MGMT_FT_SAE));
}
static inline int wpa_key_mgmt_sae(int akm)
@@ -100,29 +85,17 @@
WPA_KEY_MGMT_FT_SAE));
}
-static inline int wpa_key_mgmt_fils(int akm)
-{
- return !!(akm & (WPA_KEY_MGMT_FILS_SHA256 |
- WPA_KEY_MGMT_FILS_SHA384 |
- WPA_KEY_MGMT_FT_FILS_SHA256 |
- WPA_KEY_MGMT_FT_FILS_SHA384));
-}
-
static inline int wpa_key_mgmt_sha256(int akm)
{
return !!(akm & (WPA_KEY_MGMT_PSK_SHA256 |
WPA_KEY_MGMT_IEEE8021X_SHA256 |
WPA_KEY_MGMT_OSEN |
- WPA_KEY_MGMT_IEEE8021X_SUITE_B |
- WPA_KEY_MGMT_FILS_SHA256 |
- WPA_KEY_MGMT_FT_FILS_SHA256));
+ WPA_KEY_MGMT_IEEE8021X_SUITE_B));
}
static inline int wpa_key_mgmt_sha384(int akm)
{
- return !!(akm & (WPA_KEY_MGMT_IEEE8021X_SUITE_B_192 |
- WPA_KEY_MGMT_FILS_SHA384 |
- WPA_KEY_MGMT_FT_FILS_SHA384));
+ return !!(akm & WPA_KEY_MGMT_IEEE8021X_SUITE_B_192);
}
static inline int wpa_key_mgmt_suite_b(int akm)
@@ -135,7 +108,6 @@
{
return wpa_key_mgmt_wpa_ieee8021x(akm) ||
wpa_key_mgmt_wpa_psk(akm) ||
- wpa_key_mgmt_fils(akm) ||
wpa_key_mgmt_sae(akm);
}
@@ -160,7 +132,6 @@
#define WPA_AUTH_ALG_LEAP BIT(2)
#define WPA_AUTH_ALG_FT BIT(3)
#define WPA_AUTH_ALG_SAE BIT(4)
-#define WPA_AUTH_ALG_FILS BIT(5)
enum wpa_alg {
diff --git a/src/common/ieee802_11_common.c b/src/common/ieee802_11_common.c
index 26e08b7..b6bc449 100644
--- a/src/common/ieee802_11_common.c
+++ b/src/common/ieee802_11_common.c
@@ -179,90 +179,6 @@
}
-static int ieee802_11_parse_extension(const u8 *pos, size_t elen,
- struct ieee802_11_elems *elems,
- int show_errors)
-{
- u8 ext_id;
-
- if (elen < 1) {
- if (show_errors) {
- wpa_printf(MSG_MSGDUMP,
- "short information element (Ext)");
- }
- return -1;
- }
-
- ext_id = *pos++;
- elen--;
-
- switch (ext_id) {
- case WLAN_EID_EXT_ASSOC_DELAY_INFO:
- if (elen != 1)
- break;
- elems->assoc_delay_info = pos;
- break;
- case WLAN_EID_EXT_FILS_REQ_PARAMS:
- if (elen < 3)
- break;
- elems->fils_req_params = pos;
- elems->fils_req_params_len = elen;
- break;
- case WLAN_EID_EXT_FILS_KEY_CONFIRM:
- elems->fils_key_confirm = pos;
- elems->fils_key_confirm_len = elen;
- break;
- case WLAN_EID_EXT_FILS_SESSION:
- if (elen != FILS_SESSION_LEN)
- break;
- elems->fils_session = pos;
- break;
- case WLAN_EID_EXT_FILS_HLP_CONTAINER:
- if (elen < 2 * ETH_ALEN)
- break;
- elems->fils_hlp = pos;
- elems->fils_hlp_len = elen;
- break;
- case WLAN_EID_EXT_FILS_IP_ADDR_ASSIGN:
- if (elen < 1)
- break;
- elems->fils_ip_addr_assign = pos;
- elems->fils_ip_addr_assign_len = elen;
- break;
- case WLAN_EID_EXT_KEY_DELIVERY:
- if (elen < WPA_KEY_RSC_LEN)
- break;
- elems->key_delivery = pos;
- elems->key_delivery_len = elen;
- break;
- case WLAN_EID_EXT_FILS_WRAPPED_DATA:
- elems->fils_wrapped_data = pos;
- elems->fils_wrapped_data_len = elen;
- break;
- case WLAN_EID_EXT_FILS_PUBLIC_KEY:
- if (elen < 1)
- break;
- elems->fils_pk = pos;
- elems->fils_pk_len = elen;
- break;
- case WLAN_EID_EXT_FILS_NONCE:
- if (elen != FILS_NONCE_LEN)
- break;
- elems->fils_nonce = pos;
- break;
- default:
- if (show_errors) {
- wpa_printf(MSG_MSGDUMP,
- "IEEE 802.11 element parsing ignored unknown element extension (ext_id=%u elen=%u)",
- ext_id, (unsigned int) elen);
- }
- return -1;
- }
-
- return 0;
-}
-
-
/**
* ieee802_11_parse_elems - Parse information elements in management frames
* @start: Pointer to the start of IEs
@@ -463,35 +379,6 @@
elems->rrm_enabled = pos;
elems->rrm_enabled_len = elen;
break;
- case WLAN_EID_CAG_NUMBER:
- elems->cag_number = pos;
- elems->cag_number_len = elen;
- break;
- case WLAN_EID_AP_CSN:
- if (elen < 1)
- break;
- elems->ap_csn = pos;
- break;
- case WLAN_EID_FILS_INDICATION:
- if (elen < 2)
- break;
- elems->fils_indic = pos;
- elems->fils_indic_len = elen;
- break;
- case WLAN_EID_DILS:
- if (elen < 2)
- break;
- elems->dils = pos;
- elems->dils_len = elen;
- break;
- case WLAN_EID_FRAGMENT:
- /* TODO */
- break;
- case WLAN_EID_EXTENSION:
- if (ieee802_11_parse_extension(pos, elen, elems,
- show_errors))
- unknown++;
- break;
default:
unknown++;
if (!show_errors)
@@ -794,25 +681,6 @@
return HOSTAPD_MODE_IEEE80211A;
}
- /* 5 GHz, channels 52..64 */
- if (freq >= 5260 && freq <= 5320) {
- if ((freq - 5000) % 5)
- return NUM_HOSTAPD_MODES;
-
- if (vht_opclass)
- *op_class = vht_opclass;
- else if (sec_channel == 1)
- *op_class = 119;
- else if (sec_channel == -1)
- *op_class = 120;
- else
- *op_class = 118;
-
- *channel = (freq - 5000) / 5;
-
- return HOSTAPD_MODE_IEEE80211A;
- }
-
/* 5 GHz, channels 149..169 */
if (freq >= 5745 && freq <= 5845) {
if ((freq - 5000) % 5)
diff --git a/src/common/ieee802_11_common.h b/src/common/ieee802_11_common.h
index 2c20ba6..42f3909 100644
--- a/src/common/ieee802_11_common.h
+++ b/src/common/ieee802_11_common.h
@@ -64,20 +64,6 @@
const u8 *pref_freq_list;
const u8 *supp_op_classes;
const u8 *rrm_enabled;
- const u8 *cag_number;
- const u8 *ap_csn;
- const u8 *fils_indic;
- const u8 *dils;
- const u8 *assoc_delay_info;
- const u8 *fils_req_params;
- const u8 *fils_key_confirm;
- const u8 *fils_session;
- const u8 *fils_hlp;
- const u8 *fils_ip_addr_assign;
- const u8 *key_delivery;
- const u8 *fils_wrapped_data;
- const u8 *fils_pk;
- const u8 *fils_nonce;
u8 ssid_len;
u8 supp_rates_len;
@@ -110,16 +96,6 @@
u8 pref_freq_list_len;
u8 supp_op_classes_len;
u8 rrm_enabled_len;
- u8 cag_number_len;
- u8 fils_indic_len;
- u8 dils_len;
- u8 fils_req_params_len;
- u8 fils_key_confirm_len;
- u8 fils_hlp_len;
- u8 fils_ip_addr_assign_len;
- u8 key_delivery_len;
- u8 fils_wrapped_data_len;
- u8 fils_pk_len;
struct mb_ies_info mb_ies;
};
diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h
index ca808d7..02d2ad7 100644
--- a/src/common/ieee802_11_defs.h
+++ b/src/common/ieee802_11_defs.h
@@ -81,9 +81,6 @@
#define WLAN_AUTH_SHARED_KEY 1
#define WLAN_AUTH_FT 2
#define WLAN_AUTH_SAE 3
-#define WLAN_AUTH_FILS_SK 4
-#define WLAN_AUTH_FILS_SK_PFS 5
-#define WLAN_AUTH_FILS_PK 6
#define WLAN_AUTH_LEAP 128
#define WLAN_AUTH_CHALLENGE_LEN 128
@@ -178,8 +175,6 @@
#define WLAN_STATUS_QUERY_RESP_OUTSTANDING 95
#define WLAN_STATUS_DENIED_WITH_SUGGESTED_BAND_AND_CHANNEL 99
#define WLAN_STATUS_ASSOC_DENIED_NO_VHT 104
-#define WLAN_STATUS_FILS_AUTHENTICATION_FAILURE 112
-#define WLAN_STATUS_UNKNOWN_AUTHENTICATION_SERVER 113
/* Reason codes (IEEE 802.11-2007, 7.3.1.7, Table 7-22) */
#define WLAN_REASON_UNSPECIFIED 1
@@ -297,24 +292,6 @@
#define WLAN_EID_VHT_QUIET_CHANNEL 198
#define WLAN_EID_VHT_OPERATING_MODE_NOTIFICATION 199
#define WLAN_EID_VENDOR_SPECIFIC 221
-#define WLAN_EID_CAG_NUMBER 237
-#define WLAN_EID_AP_CSN 239
-#define WLAN_EID_FILS_INDICATION 240
-#define WLAN_EID_DILS 241
-#define WLAN_EID_FRAGMENT 242
-#define WLAN_EID_EXTENSION 255
-
-/* Element ID Extension (EID 255) values */
-#define WLAN_EID_EXT_ASSOC_DELAY_INFO 1
-#define WLAN_EID_EXT_FILS_REQ_PARAMS 2
-#define WLAN_EID_EXT_FILS_KEY_CONFIRM 3
-#define WLAN_EID_EXT_FILS_SESSION 4
-#define WLAN_EID_EXT_FILS_HLP_CONTAINER 5
-#define WLAN_EID_EXT_FILS_IP_ADDR_ASSIGN 6
-#define WLAN_EID_EXT_KEY_DELIVERY 7
-#define WLAN_EID_EXT_FILS_WRAPPED_DATA 8
-#define WLAN_EID_EXT_FILS_PUBLIC_KEY 12
-#define WLAN_EID_EXT_FILS_NONCE 13
/* Action frame categories (IEEE 802.11-2007, 7.3.1.11, Table 7-24) */
@@ -334,7 +311,6 @@
#define WLAN_ACTION_SELF_PROTECTED 15
#define WLAN_ACTION_WMM 17 /* WMM Specification 1.1 */
#define WLAN_ACTION_FST 18
-#define WLAN_ACTION_FILS 26
#define WLAN_ACTION_VENDOR_SPECIFIC 127
/* Public action codes */
@@ -345,7 +321,6 @@
#define WLAN_PA_GAS_COMEBACK_REQ 12
#define WLAN_PA_GAS_COMEBACK_RESP 13
#define WLAN_TDLS_DISCOVERY_RESPONSE 14
-#define WLAN_PA_FILS_DISCOVERY 34
/* Protected Dual of Public Action frames */
#define WLAN_PROT_DSE_ENABLEMENT 1
@@ -451,10 +426,6 @@
ANQP_TDLS_CAPABILITY = 270,
ANQP_EMERGENCY_NAI = 271,
ANQP_NEIGHBOR_REPORT = 272,
- ANQP_QUERY_AP_LIST = 273,
- ANQP_AP_LIST_RESPONSE = 274,
- AMQP_FILS_REALM_INFO = 275,
- ANQP_CAG = 276,
ANQP_VENUE_URL = 277,
ANQP_ADVICE_OF_CHARGE = 278,
ANQP_LOCAL_CONTENT = 279,
@@ -534,11 +505,6 @@
LCI_REQ_SUBELEM_MAX_AGE = 4,
};
-#define FILS_NONCE_LEN 16
-#define FILS_SESSION_LEN 8
-#define FILS_CACHE_ID_LEN 2
-#define FILS_MAX_KEY_AUTH_LEN 48
-
#ifdef _MSC_VER
#pragma pack(push, 1)
#endif /* _MSC_VER */
@@ -1214,10 +1180,6 @@
WFA_WNM_NOTIF_SUBELEM_CELL_DATA_CAPA = 3,
};
-/* MBO v0.0_r25, 4.3: MBO ANQP-elements */
-#define MBO_ANQP_OUI_TYPE 0x12
-#define MBO_ANQP_SUBTYPE_CELL_CONN_PREF 1
-
/* Wi-Fi Direct (P2P) */
#define P2P_OUI_TYPE 9
@@ -1429,10 +1391,6 @@
#define WLAN_AKM_SUITE_PSK_SHA256 0x000FAC06
#define WLAN_AKM_SUITE_8021X_SUITE_B 0x000FAC11
#define WLAN_AKM_SUITE_8021X_SUITE_B_192 0x000FAC12
-#define WLAN_AKM_SUITE_FILS_SHA256 0x000FAC14
-#define WLAN_AKM_SUITE_FILS_SHA384 0x000FAC15
-#define WLAN_AKM_SUITE_FT_FILS_SHA256 0x000FAC16
-#define WLAN_AKM_SUITE_FT_FILS_SHA384 0x000FAC17
#define WLAN_AKM_SUITE_CCKM 0x00409600
#define WLAN_AKM_SUITE_OSEN 0x506f9a01
diff --git a/src/common/privsep_commands.h b/src/common/privsep_commands.h
index f017f08..8dff303 100644
--- a/src/common/privsep_commands.h
+++ b/src/common/privsep_commands.h
@@ -42,9 +42,9 @@
int wep_tx_keyidx;
int local_state_change;
int p2p;
- size_t auth_data_len;
+ size_t sae_data_len;
/* followed by ie_len bytes of ie */
- /* followed by auth_data_len bytes of auth_data */
+ /* followed by sae_data_len bytes of sae_data */
};
struct privsep_cmd_associate
diff --git a/src/common/qca-vendor.h b/src/common/qca-vendor.h
index fc391e0..c458cb3 100644
--- a/src/common/qca-vendor.h
+++ b/src/common/qca-vendor.h
@@ -164,11 +164,8 @@
*
* @QCA_NL80211_VENDOR_SUBCMD_AOA_MEAS: Perform a standalone AOA (angle of
* arrival) measurement with a single peer. Specify peer MAC address in
- * QCA_WLAN_VENDOR_ATTR_MAC_ADDR and optionally frequency (MHz) in
- * QCA_WLAN_VENDOR_ATTR_FREQ (if not specified, locate peer in kernel
- * scan results cache and use the frequency from there).
- * Also specify measurement type in QCA_WLAN_VENDOR_ATTR_AOA_TYPE.
- * Measurement result is reported in
+ * QCA_WLAN_VENDOR_ATTR_MAC_ADDR and measurement type in
+ * QCA_WLAN_VENDOR_ATTR_AOA_TYPE. Measurement result is reported in
* QCA_NL80211_VENDOR_SUBCMD_AOA_MEAS_RESULT event.
*
* @QCA_NL80211_VENDOR_SUBCMD_AOA_ABORT_MEAS: Abort an AOA measurement. Specify
@@ -188,50 +185,6 @@
*
* @QCA_NL80211_VENDOR_SUBCMD_GET_CHAIN_RSSI: Get antenna RSSI value for a
* specific chain.
- *
- * @QCA_NL80211_VENDOR_SUBCMD_DMG_RF_GET_SECTOR_CFG: Get low level
- * configuration for a DMG RF sector. Specify sector index in
- * QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_INDEX, sector type in
- * QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_TYPE and RF modules
- * to return sector information for in
- * QCA_WLAN_VENDOR_ATTR_DMG_RF_MODULE_MASK. Returns sector configuration
- * in QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_CFG. Also return the
- * exact time where information was captured in
- * QCA_WLAN_VENDOR_ATTR_TSF.
- *
- * @QCA_NL80211_VENDOR_SUBCMD_DMG_RF_SET_SECTOR_CFG: Set low level
- * configuration for a DMG RF sector. Specify sector index in
- * QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_INDEX, sector type in
- * QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_TYPE and sector configuration
- * for one or more DMG RF modules in
- * QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_CFG.
- *
- * @QCA_NL80211_VENDOR_SUBCMD_DMG_RF_GET_SELECTED_SECTOR: Get selected
- * DMG RF sector for a station. This is the sector that the HW
- * will use to communicate with the station. Specify the MAC address
- * of associated station/AP/PCP in QCA_WLAN_VENDOR_ATTR_MAC_ADDR (not
- * needed for unassociated station). Specify sector type to return in
- * QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_TYPE. Returns the selected
- * sector index in QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_INDEX.
- * Also return the exact time where the information was captured
- * in QCA_WLAN_VENDOR_ATTR_TSF.
- *
- * @QCA_NL80211_VENDOR_SUBCMD_DMG_RF_SET_SELECTED_SECTOR: Set the
- * selected DMG RF sector for a station. This is the sector that
- * the HW will use to communicate with the station.
- * Specify the MAC address of associated station/AP/PCP in
- * QCA_WLAN_VENDOR_ATTR_MAC_ADDR, the sector type to select in
- * QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_TYPE and the sector index
- * in QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_INDEX.
- * The selected sector will be locked such that it will not be
- * modified like it normally does (for example when station
- * moves around). To unlock the selected sector for a station
- * pass the special value 0xFFFF in the sector index. To unlock
- * all connected stations also pass a broadcast MAC address.
- *
- * @QCA_NL80211_VENDOR_SUBCMD_CONFIGURE_TDLS: Configure the TDLS behavior
- * in the host driver. The different TDLS configurations are defined
- * by the attributes in enum qca_wlan_vendor_attr_tdls_configuration.
*/
enum qca_nl80211_vendor_subcmds {
QCA_NL80211_VENDOR_SUBCMD_UNSPEC = 0,
@@ -241,7 +194,7 @@
QCA_NL80211_VENDOR_SUBCMD_AVOID_FREQUENCY = 10,
QCA_NL80211_VENDOR_SUBCMD_DFS_CAPABILITY = 11,
QCA_NL80211_VENDOR_SUBCMD_NAN = 12,
- QCA_NL80211_VENDOR_SUBCMD_STATS_EXT = 13,
+ QCA_NL80211_VENDOR_SUBMCD_STATS_EXT = 13,
QCA_NL80211_VENDOR_SUBCMD_LL_STATS_SET = 14,
QCA_NL80211_VENDOR_SUBCMD_LL_STATS_GET = 15,
QCA_NL80211_VENDOR_SUBCMD_LL_STATS_CLR = 16,
@@ -332,12 +285,6 @@
QCA_NL80211_VENDOR_SUBCMD_AOA_MEAS_RESULT = 136,
QCA_NL80211_VENDOR_SUBCMD_ENCRYPTION_TEST = 137,
QCA_NL80211_VENDOR_SUBCMD_GET_CHAIN_RSSI = 138,
- /* DMG low level RF sector operations */
- QCA_NL80211_VENDOR_SUBCMD_DMG_RF_GET_SECTOR_CFG = 139,
- QCA_NL80211_VENDOR_SUBCMD_DMG_RF_SET_SECTOR_CFG = 140,
- QCA_NL80211_VENDOR_SUBCMD_DMG_RF_GET_SELECTED_SECTOR = 141,
- QCA_NL80211_VENDOR_SUBCMD_DMG_RF_SET_SELECTED_SECTOR = 142,
- QCA_NL80211_VENDOR_SUBCMD_CONFIGURE_TDLS = 143,
};
@@ -445,42 +392,6 @@
/* Used in QCA_NL80211_VENDOR_SUBCMD_GET_CHAIN_RSSI command
* to report the specific antenna RSSI value (unsigned 32 bit value) */
QCA_WLAN_VENDOR_ATTR_CHAIN_RSSI = 27,
- /* Frequency in MHz, various uses. Unsigned 32 bit value */
- QCA_WLAN_VENDOR_ATTR_FREQ = 28,
- /* TSF timer value, unsigned 64 bit value.
- * May be returned by various commands.
- */
- QCA_WLAN_VENDOR_ATTR_TSF = 29,
- /* DMG RF sector index, unsigned 16 bit number. Valid values are
- * 0..127 for sector indices or 65535 as special value used to
- * unlock sector selection in
- * QCA_NL80211_VENDOR_SUBCMD_DMG_RF_SET_SELECTED_SECTOR.
- */
- QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_INDEX = 30,
- /* DMG RF sector type, unsigned 8 bit value. One of the values
- * in enum qca_wlan_vendor_attr_dmg_rf_sector_type.
- */
- QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_TYPE = 31,
- /* Bitmask of DMG RF modules for which information is requested. Each
- * bit corresponds to an RF module with the same index as the bit
- * number. Unsigned 32 bit number but only low 8 bits can be set since
- * all DMG chips currently have up to 8 RF modules.
- */
- QCA_WLAN_VENDOR_ATTR_DMG_RF_MODULE_MASK = 32,
- /* Array of nested attributes where each entry is DMG RF sector
- * configuration for a single RF module.
- * Attributes for each entry are taken from enum
- * qca_wlan_vendor_attr_dmg_rf_sector_cfg.
- * Specified in QCA_NL80211_VENDOR_SUBCMD_DMG_RF_SET_SECTOR_CFG
- * and returned by QCA_NL80211_VENDOR_SUBCMD_DMG_RF_GET_SECTOR_CFG.
- */
- QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_CFG = 33,
- /* Used in QCA_NL80211_VENDOR_SUBCMD_STATS_EXT command
- * to report frame aggregation statistics to userspace.
- */
- QCA_WLAN_VENDOR_ATTR_RX_AGGREGATION_STATS_HOLES_NUM = 34,
- QCA_WLAN_VENDOR_ATTR_RX_AGGREGATION_STATS_HOLES_INFO = 35,
-
/* keep last */
QCA_WLAN_VENDOR_ATTR_AFTER_LAST,
QCA_WLAN_VENDOR_ATTR_MAX = QCA_WLAN_VENDOR_ATTR_AFTER_LAST - 1,
@@ -878,13 +789,13 @@
* QCA_NL80211_VENDOR_SUBCMD_GET_WIFI_CONFIGURATION subcommands.
*/
enum qca_wlan_vendor_attr_config {
- QCA_WLAN_VENDOR_ATTR_CONFIG_INVALID = 0,
+ QCA_WLAN_VENDOR_ATTR_CONFIG_INVALID,
/* Unsigned 32-bit value to set the DTIM period.
* Whether the wifi chipset wakes at every dtim beacon or a multiple of
* the DTIM period. If DTIM is set to 3, the STA shall wake up every 3
* DTIM beacons.
*/
- QCA_WLAN_VENDOR_ATTR_CONFIG_DYNAMIC_DTIM = 1,
+ QCA_WLAN_VENDOR_ATTR_CONFIG_DYNAMIC_DTIM,
/* Unsigned 32-bit value to set the wifi_iface stats averaging factor
* used to calculate statistics like average the TSF offset or average
* number of frame leaked.
@@ -893,52 +804,52 @@
* For instance, when evaluating leaky APs:
* current_avg = ((num frame received within guard time) * factor + previous_avg * (0x10000 - factor)) / 0x10000
*/
- QCA_WLAN_VENDOR_ATTR_CONFIG_STATS_AVG_FACTOR = 2,
+ QCA_WLAN_VENDOR_ATTR_CONFIG_STATS_AVG_FACTOR,
/* Unsigned 32-bit value to configure guard time, i.e., when
* implementing IEEE power management based on frame control PM bit, how
* long the driver waits before shutting down the radio and after
* receiving an ACK frame for a Data frame with PM bit set.
*/
- QCA_WLAN_VENDOR_ATTR_CONFIG_GUARD_TIME = 3,
+ QCA_WLAN_VENDOR_ATTR_CONFIG_GUARD_TIME,
/* Unsigned 32-bit value to change the FTM capability dynamically */
- QCA_WLAN_VENDOR_ATTR_CONFIG_FINE_TIME_MEASUREMENT = 4,
+ QCA_WLAN_VENDOR_ATTR_CONFIG_FINE_TIME_MEASUREMENT,
/* Unsigned 16-bit value to configure maximum TX rate dynamically */
- QCA_WLAN_VENDOR_ATTR_CONF_TX_RATE = 5,
+ QCA_WLAN_VENDOR_ATTR_CONF_TX_RATE,
/* Unsigned 32-bit value to configure the number of continuous
* Beacon Miss which shall be used by the firmware to penalize
* the RSSI.
*/
- QCA_WLAN_VENDOR_ATTR_CONFIG_PENALIZE_AFTER_NCONS_BEACON_MISS = 6,
+ QCA_WLAN_VENDOR_ATTR_CONFIG_PENALIZE_AFTER_NCONS_BEACON_MISS,
/* Unsigned 8-bit value to configure the channel avoidance indication
* behavior. Firmware to send only one indication and ignore duplicate
* indications when set to avoid multiple Apps wakeups.
*/
- QCA_WLAN_VENDOR_ATTR_CONFIG_CHANNEL_AVOIDANCE_IND = 7,
+ QCA_WLAN_VENDOR_ATTR_CONFIG_CHANNEL_AVOIDANCE_IND,
/* 8-bit unsigned value to configure the maximum TX MPDU for
* aggregation. */
- QCA_WLAN_VENDOR_ATTR_CONFIG_TX_MPDU_AGGREGATION = 8,
+ QCA_WLAN_VENDOR_ATTR_CONFIG_TX_MPDU_AGGREGATION,
/* 8-bit unsigned value to configure the maximum RX MPDU for
* aggregation. */
- QCA_WLAN_VENDOR_ATTR_CONFIG_RX_MPDU_AGGREGATION = 9,
+ QCA_WLAN_VENDOR_ATTR_CONFIG_RX_MPDU_AGGREGATION,
/* 8-bit unsigned value to configure the Non aggregrate/11g sw
* retry threshold (0 disable, 31 max). */
- QCA_WLAN_VENDOR_ATTR_CONFIG_NON_AGG_RETRY = 10,
+ QCA_WLAN_VENDOR_ATTR_CONFIG_NON_AGG_RETRY,
/* 8-bit unsigned value to configure the aggregrate sw
* retry threshold (0 disable, 31 max). */
- QCA_WLAN_VENDOR_ATTR_CONFIG_AGG_RETRY = 11,
+ QCA_WLAN_VENDOR_ATTR_CONFIG_AGG_RETRY,
/* 8-bit unsigned value to configure the MGMT frame
* retry threshold (0 disable, 31 max). */
- QCA_WLAN_VENDOR_ATTR_CONFIG_MGMT_RETRY = 12,
+ QCA_WLAN_VENDOR_ATTR_CONFIG_MGMT_RETRY,
/* 8-bit unsigned value to configure the CTRL frame
* retry threshold (0 disable, 31 max). */
- QCA_WLAN_VENDOR_ATTR_CONFIG_CTRL_RETRY = 13,
+ QCA_WLAN_VENDOR_ATTR_CONFIG_CTRL_RETRY,
/* 8-bit unsigned value to configure the propagation delay for
* 2G/5G band (0~63, units in us) */
- QCA_WLAN_VENDOR_ATTR_CONFIG_PROPAGATION_DELAY = 14,
+ QCA_WLAN_VENDOR_ATTR_CONFIG_PROPAGATION_DELAY,
/* Unsigned 32-bit value to configure the number of unicast TX fail
* packet count. The peer is disconnected once this threshold is
* reached. */
- QCA_WLAN_VENDOR_ATTR_CONFIG_TX_FAIL_COUNT = 15,
+ QCA_WLAN_VENDOR_ATTR_CONFIG_TX_FAIL_COUNT,
/* Attribute used to set scan default IEs to the driver.
*
* These IEs can be used by scan operations that will be initiated by
@@ -949,62 +860,50 @@
* driver. If a particular IE is present in the scan default IEs but not
* present in the scan request, then that IE should be added to the IEs
* sent in the Probe Request frames for that scan request. */
- QCA_WLAN_VENDOR_ATTR_CONFIG_SCAN_DEFAULT_IES = 16,
+ QCA_WLAN_VENDOR_ATTR_CONFIG_SCAN_DEFAULT_IES,
/* Unsigned 32-bit attribute for generic commands */
- QCA_WLAN_VENDOR_ATTR_CONFIG_GENERIC_COMMAND = 17,
+ QCA_WLAN_VENDOR_ATTR_CONFIG_GENERIC_COMMAND,
/* Unsigned 32-bit value attribute for generic commands */
- QCA_WLAN_VENDOR_ATTR_CONFIG_GENERIC_VALUE = 18,
+ QCA_WLAN_VENDOR_ATTR_CONFIG_GENERIC_VALUE,
/* Unsigned 32-bit data attribute for generic command response */
- QCA_WLAN_VENDOR_ATTR_CONFIG_GENERIC_DATA = 19,
+ QCA_WLAN_VENDOR_ATTR_CONFIG_GENERIC_DATA,
/* Unsigned 32-bit length attribute for
* QCA_WLAN_VENDOR_ATTR_CONFIG_GENERIC_DATA */
- QCA_WLAN_VENDOR_ATTR_CONFIG_GENERIC_LENGTH = 20,
+ QCA_WLAN_VENDOR_ATTR_CONFIG_GENERIC_LENGTH,
/* Unsigned 32-bit flags attribute for
* QCA_WLAN_VENDOR_ATTR_CONFIG_GENERIC_DATA */
- QCA_WLAN_VENDOR_ATTR_CONFIG_GENERIC_FLAGS = 21,
+ QCA_WLAN_VENDOR_ATTR_CONFIG_GENERIC_FLAGS,
/* Unsigned 32-bit, defining the access policy.
* See enum qca_access_policy. Used with
* QCA_WLAN_VENDOR_ATTR_CONFIG_ACCESS_POLICY_IE_LIST. */
- QCA_WLAN_VENDOR_ATTR_CONFIG_ACCESS_POLICY = 22,
+ QCA_WLAN_VENDOR_ATTR_CONFIG_ACCESS_POLICY,
/* Sets the list of full set of IEs for which a specific access policy
* has to be applied. Used along with
* QCA_WLAN_VENDOR_ATTR_CONFIG_ACCESS_POLICY to control the access.
* Zero length payload can be used to clear this access constraint. */
- QCA_WLAN_VENDOR_ATTR_CONFIG_ACCESS_POLICY_IE_LIST = 23,
+ QCA_WLAN_VENDOR_ATTR_CONFIG_ACCESS_POLICY_IE_LIST,
/* Unsigned 32-bit, specifies the interface index (netdev) for which the
* corresponding configurations are applied. If the interface index is
* not specified, the configurations are attributed to the respective
* wiphy. */
- QCA_WLAN_VENDOR_ATTR_CONFIG_IFINDEX = 24,
+ QCA_WLAN_VENDOR_ATTR_CONFIG_IFINDEX,
/* 8-bit unsigned value to trigger QPower: 1-Enable, 0-Disable */
- QCA_WLAN_VENDOR_ATTR_CONFIG_QPOWER = 25,
+ QCA_WLAN_VENDOR_ATTR_CONFIG_QPOWER,
/* 8-bit unsigned value to configure the driver and below layers to
* ignore the assoc disallowed set by APs while connecting
* 1-Ignore, 0-Don't ignore */
- QCA_WLAN_VENDOR_ATTR_CONFIG_IGNORE_ASSOC_DISALLOWED = 26,
+ QCA_WLAN_VENDOR_ATTR_CONFIG_IGNORE_ASSOC_DISALLOWED,
/* 32-bit unsigned value to trigger antenna diversity features:
* 1-Enable, 0-Disable */
- QCA_WLAN_VENDOR_ATTR_CONFIG_ANT_DIV_ENA = 27,
+ QCA_WLAN_VENDOR_ATTR_CONFIG_ANT_DIV_ENA,
/* 32-bit unsigned value to configure specific chain antenna */
- QCA_WLAN_VENDOR_ATTR_CONFIG_ANT_DIV_CHAIN = 28,
+ QCA_WLAN_VENDOR_ATTR_CONFIG_ANT_DIV_CHAIN,
/* 32-bit unsigned value to trigger cycle selftest
* 1-Enable, 0-Disable */
- QCA_WLAN_VENDOR_ATTR_CONFIG_ANT_DIV_SELFTEST = 29,
+ QCA_WLAN_VENDOR_ATTR_CONFIG_ANT_DIV_SELFTEST,
/* 32-bit unsigned to configure the cycle time of selftest
* the unit is micro-second */
- QCA_WLAN_VENDOR_ATTR_CONFIG_ANT_DIV_SELFTEST_INTVL = 30,
- /* 32-bit unsigned value to set reorder timeout for AC_VO */
- QCA_WLAN_VENDOR_ATTR_CONFIG_RX_REORDER_TIMEOUT_VOICE = 31,
- /* 32-bit unsigned value to set reorder timeout for AC_VI */
- QCA_WLAN_VENDOR_ATTR_CONFIG_RX_REORDER_TIMEOUT_VIDEO = 32,
- /* 32-bit unsigned value to set reorder timeout for AC_BE */
- QCA_WLAN_VENDOR_ATTR_CONFIG_RX_REORDER_TIMEOUT_BESTEFFORT = 33,
- /* 32-bit unsigned value to set reorder timeout for AC_BK */
- QCA_WLAN_VENDOR_ATTR_CONFIG_RX_REORDER_TIMEOUT_BACKGROUND = 34,
- /* 6-byte MAC address to point out the specific peer */
- QCA_WLAN_VENDOR_ATTR_CONFIG_RX_BLOCKSIZE_PEER_MAC = 35,
- /* 32-bit unsigned value to set window size for specific peer */
- QCA_WLAN_VENDOR_ATTR_CONFIG_RX_BLOCKSIZE_WINLIMIT = 36,
+ QCA_WLAN_VENDOR_ATTR_CONFIG_ANT_DIV_SELFTEST_INTVL,
/* keep last */
QCA_WLAN_VENDOR_ATTR_CONFIG_AFTER_LAST,
@@ -1421,10 +1320,6 @@
* @QCA_WLAN_VENDOR_ATTR_FTM_PEER_AOA_BURST_PERIOD: Request AOA
* measurement every <value> bursts. If 0 or not specified,
* AOA measurements will be disabled for this peer.
- * @QCA_WLAN_VENDOR_ATTR_FTM_PEER_FREQ: Frequency in MHz where
- * the measurement frames are exchanged. Optional; if not
- * specified, try to locate the peer in the kernel scan
- * results cache and use frequency from there.
*/
enum qca_wlan_vendor_attr_ftm_peer_info {
QCA_WLAN_VENDOR_ATTR_FTM_PEER_INVALID,
@@ -1433,7 +1328,6 @@
QCA_WLAN_VENDOR_ATTR_FTM_PEER_MEAS_PARAMS,
QCA_WLAN_VENDOR_ATTR_FTM_PEER_SECURE_TOKEN_ID,
QCA_WLAN_VENDOR_ATTR_FTM_PEER_AOA_BURST_PERIOD,
- QCA_WLAN_VENDOR_ATTR_FTM_PEER_FREQ,
/* keep last */
QCA_WLAN_VENDOR_ATTR_FTM_PEER_AFTER_LAST,
QCA_WLAN_VENDOR_ATTR_FTM_PEER_MAX =
@@ -1693,518 +1587,4 @@
QCA_WLAN_VENDOR_ATTR_ENCRYPTION_TEST_AFTER_LAST - 1
};
-/**
- * enum qca_wlan_vendor_attr_dmg_rf_sector_type - Type of
- * sector for DMG RF sector operations.
- *
- * @QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_TYPE_RX: RX sector
- * @QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_TYPE_TX: TX sector
- */
-enum qca_wlan_vendor_attr_dmg_rf_sector_type {
- QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_TYPE_RX,
- QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_TYPE_TX,
- QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_TYPE_MAX
-};
-
-/**
- * enum qca_wlan_vendor_attr_dmg_rf_sector_cfg - Attributes for
- * DMG RF sector configuration for a single RF module.
- * The values are defined in a compact way which closely matches
- * the way it is stored in HW registers.
- * The configuration provides values for 32 antennas and 8 distribution
- * amplifiers, and together describes the characteristics of the RF
- * sector - such as a beam in some direction with some gain.
- *
- * @QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_CFG_MODULE_INDEX: Index
- * of RF module for this configuration.
- * @QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_CFG_ETYPE0: Bit 0 of edge
- * amplifier gain index. Unsigned 32 bit number containing
- * bits for all 32 antennas.
- * @QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_CFG_ETYPE1: Bit 1 of edge
- * amplifier gain index. Unsigned 32 bit number containing
- * bits for all 32 antennas.
- * @QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_CFG_ETYPE2: Bit 2 of edge
- * amplifier gain index. Unsigned 32 bit number containing
- * bits for all 32 antennas.
- * @QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_CFG_PSH_HI: Phase values
- * for first 16 antennas, 2 bits per antenna.
- * @QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_CFG_PSH_LO: Phase values
- * for last 16 antennas, 2 bits per antenna.
- * @QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_CFG_DTYPE_X16: Contains
- * DTYPE values (3 bits) for each distribution amplifier, followed
- * by X16 switch bits for each distribution amplifier. There are
- * total of 8 distribution amplifiers.
- */
-enum qca_wlan_vendor_attr_dmg_rf_sector_cfg {
- QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_CFG_INVALID = 0,
- QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_CFG_MODULE_INDEX = 1,
- QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_CFG_ETYPE0 = 2,
- QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_CFG_ETYPE1 = 3,
- QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_CFG_ETYPE2 = 4,
- QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_CFG_PSH_HI = 5,
- QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_CFG_PSH_LO = 6,
- QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_CFG_DTYPE_X16 = 7,
-
- /* keep last */
- QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_CFG_AFTER_LAST,
- QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_CFG_MAX =
- QCA_WLAN_VENDOR_ATTR_DMG_RF_SECTOR_CFG_AFTER_LAST - 1
-};
-
-enum qca_wlan_vendor_attr_ll_stats_set {
- QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_INVALID = 0,
- /* Unsigned 32-bit value */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_CONFIG_MPDU_SIZE_THRESHOLD = 1,
- QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_CONFIG_AGGRESSIVE_STATS_GATHERING = 2,
- /* keep last */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_AFTER_LAST,
- QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_MAX =
- QCA_WLAN_VENDOR_ATTR_LL_STATS_SET_AFTER_LAST - 1,
-};
-
-enum qca_wlan_vendor_attr_ll_stats_clr {
- QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_INVALID = 0,
- /* Unsigned 32bit bitmap for clearing statistics
- * All radio statistics 0x00000001
- * cca_busy_time (within radio statistics) 0x00000002
- * All channel stats (within radio statistics) 0x00000004
- * All scan statistics (within radio statistics) 0x00000008
- * All interface statistics 0x00000010
- * All tx rate statistics (within interface statistics) 0x00000020
- * All ac statistics (with in interface statistics) 0x00000040
- * All contention (min, max, avg) statistics (within ac statisctics)
- * 0x00000080.
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_CONFIG_REQ_MASK = 1,
- /* Unsigned 8 bit value: Request to stop statistics collection */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_CONFIG_STOP_REQ = 2,
-
- /* Unsigned 32 bit bitmap: Response from the driver
- * for the cleared statistics
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_CONFIG_RSP_MASK = 3,
- /* Unsigned 8 bit value: Response from driver/firmware
- * for the stop request
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_CONFIG_STOP_RSP = 4,
- /* keep last */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_AFTER_LAST,
- QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_MAX =
- QCA_WLAN_VENDOR_ATTR_LL_STATS_CLR_AFTER_LAST - 1,
-};
-
-enum qca_wlan_vendor_attr_ll_stats_get {
- QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_INVALID = 0,
- /* Unsigned 32 bit value provided by the caller issuing the GET stats
- * command. When reporting the stats results, the driver uses the same
- * value to indicate which GET request the results correspond to.
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_CONFIG_REQ_ID = 1,
- /* Unsigned 32 bit value - bit mask to identify what statistics are
- * requested for retrieval.
- * Radio Statistics 0x00000001
- * Interface Statistics 0x00000020
- * All Peer Statistics 0x00000040
- * Peer Statistics 0x00000080
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_CONFIG_REQ_MASK = 2,
- /* keep last */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_AFTER_LAST,
- QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_MAX =
- QCA_WLAN_VENDOR_ATTR_LL_STATS_GET_AFTER_LAST - 1,
-};
-
-enum qca_wlan_vendor_attr_ll_stats_results {
- QCA_WLAN_VENDOR_ATTR_LL_STATS_INVALID = 0,
- /* Unsigned 32bit value. Used by the driver; must match the request id
- * provided with the QCA_NL80211_VENDOR_SUBCMD_LL_STATS_GET command.
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_RESULTS_REQ_ID = 1,
-
- /* Unsigned 32 bit value */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_BEACON_RX = 2,
- /* Unsigned 32 bit value */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_MGMT_RX = 3,
- /* Unsigned 32 bit value */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_MGMT_ACTION_RX = 4,
- /* Unsigned 32 bit value */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_MGMT_ACTION_TX = 5,
- /* Signed 32 bit value */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_RSSI_MGMT = 6,
- /* Signed 32 bit value */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_RSSI_DATA = 7,
- /* Signed 32 bit value */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_RSSI_ACK = 8,
-
- /* Attributes of type QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_* are
- * nested within the interface stats.
- */
-
- /* Interface mode, e.g., STA, SOFTAP, IBSS, etc.
- * Type = enum wifi_interface_mode.
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_MODE = 9,
- /* Interface MAC address. An array of 6 Unsigned int8 */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_MAC_ADDR = 10,
- /* Type = enum wifi_connection_state, e.g., DISCONNECTED,
- * AUTHENTICATING, etc. valid for STA, CLI only.
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_STATE = 11,
- /* Type = enum wifi_roam_state. Roaming state, e.g., IDLE or ACTIVE
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_ROAMING = 12,
- /* Unsigned 32 bit value. WIFI_CAPABILITY_XXX */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_CAPABILITIES = 13,
- /* NULL terminated SSID. An array of 33 Unsigned 8bit values */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_SSID = 14,
- /* BSSID. An array of 6 unsigned 8 bit values */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_BSSID = 15,
- /* Country string advertised by AP. An array of 3 unsigned 8 bit
- * values.
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_AP_COUNTRY_STR = 16,
- /* Country string for this association. An array of 3 unsigned 8 bit
- * values.
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_INFO_COUNTRY_STR = 17,
-
- /* Attributes of type QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_* could
- * be nested within the interface stats.
- */
-
- /* Type = enum wifi_traffic_ac, e.g., V0, VI, BE and BK */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_AC = 18,
- /* Unsigned int 32 value corresponding to respective AC */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_TX_MPDU = 19,
- /* Unsigned int 32 value corresponding to respective AC */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_RX_MPDU = 20,
- /* Unsigned int 32 value corresponding to respective AC */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_TX_MCAST = 21,
- /* Unsigned int 32 value corresponding to respective AC */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_RX_MCAST = 22,
- /* Unsigned int 32 value corresponding to respective AC */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_RX_AMPDU = 23,
- /* Unsigned int 32 value corresponding to respective AC */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_TX_AMPDU = 24,
- /* Unsigned int 32 value corresponding to respective AC */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_MPDU_LOST = 25,
- /* Unsigned int 32 value corresponding to respective AC */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_RETRIES = 26,
- /* Unsigned int 32 value corresponding to respective AC */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_RETRIES_SHORT = 27,
- /* Unsigned int 32 values corresponding to respective AC */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_RETRIES_LONG = 28,
- /* Unsigned int 32 values corresponding to respective AC */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_CONTENTION_TIME_MIN = 29,
- /* Unsigned int 32 values corresponding to respective AC */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_CONTENTION_TIME_MAX = 30,
- /* Unsigned int 32 values corresponding to respective AC */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_CONTENTION_TIME_AVG = 31,
- /* Unsigned int 32 values corresponding to respective AC */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_CONTENTION_NUM_SAMPLES = 32,
- /* Unsigned 32 bit value. Number of peers */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_NUM_PEERS = 33,
-
- /* Attributes of type QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO_* are
- * nested within the interface stats.
- */
-
- /* Type = enum wifi_peer_type. Peer type, e.g., STA, AP, P2P GO etc. */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO_TYPE = 34,
- /* MAC addr corresponding to respective peer. An array of 6 unsigned
- * 8 bit values.
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO_MAC_ADDRESS = 35,
- /* Unsigned int 32 bit value representing capabilities corresponding
- * to respective peer.
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO_CAPABILITIES = 36,
- /* Unsigned 32 bit value. Number of rates */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO_NUM_RATES = 37,
-
- /* Attributes of type QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_*
- * are nested within the rate stat.
- */
-
- /* Wi-Fi Rate - separate attributes defined for individual fields */
-
- /* Unsigned int 8 bit value; 0: OFDM, 1:CCK, 2:HT 3:VHT 4..7 reserved */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_PREAMBLE = 38,
- /* Unsigned int 8 bit value; 0:1x1, 1:2x2, 3:3x3, 4:4x4 */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_NSS = 39,
- /* Unsigned int 8 bit value; 0:20 MHz, 1:40 MHz, 2:80 MHz, 3:160 MHz */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_BW = 40,
- /* Unsigned int 8 bit value; OFDM/CCK rate code would be as per IEEE Std
- * in the units of 0.5 Mbps HT/VHT it would be MCS index */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_MCS_INDEX = 41,
-
- /* Unsigned 32 bit value. Bit rate in units of 100 kbps */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_BIT_RATE = 42,
-
-
- /* Attributes of type QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_STAT_* could be
- * nested within the peer info stats.
- */
-
- /* Unsigned int 32 bit value. Number of successfully transmitted data
- * packets, i.e., with ACK received corresponding to the respective
- * rate.
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_TX_MPDU = 43,
- /* Unsigned int 32 bit value. Number of received data packets
- * corresponding to the respective rate.
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_RX_MPDU = 44,
- /* Unsigned int 32 bit value. Number of data packet losses, i.e., no ACK
- * received corresponding to the respective rate.
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_MPDU_LOST = 45,
- /* Unsigned int 32 bit value. Total number of data packet retries for
- * the respective rate.
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_RETRIES = 46,
- /* Unsigned int 32 bit value. Total number of short data packet retries
- * for the respective rate.
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_RETRIES_SHORT = 47,
- /* Unsigned int 32 bit value. Total number of long data packet retries
- * for the respective rate.
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_RETRIES_LONG = 48,
-
- QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ID = 49,
- /* Unsigned 32 bit value. Total number of msecs the radio is awake
- * accruing over time.
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ON_TIME = 50,
- /* Unsigned 32 bit value. Total number of msecs the radio is
- * transmitting accruing over time.
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_TX_TIME = 51,
- /* Unsigned 32 bit value. Total number of msecs the radio is in active
- * receive accruing over time.
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_RX_TIME = 52,
- /* Unsigned 32 bit value. Total number of msecs the radio is awake due
- * to all scan accruing over time.
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ON_TIME_SCAN = 53,
- /* Unsigned 32 bit value. Total number of msecs the radio is awake due
- * to NAN accruing over time.
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ON_TIME_NBD = 54,
- /* Unsigned 32 bit value. Total number of msecs the radio is awake due
- * to GSCAN accruing over time.
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ON_TIME_GSCAN = 55,
- /* Unsigned 32 bit value. Total number of msecs the radio is awake due
- * to roam scan accruing over time.
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ON_TIME_ROAM_SCAN = 56,
- /* Unsigned 32 bit value. Total number of msecs the radio is awake due
- * to PNO scan accruing over time.
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ON_TIME_PNO_SCAN = 57,
- /* Unsigned 32 bit value. Total number of msecs the radio is awake due
- * to Hotspot 2.0 scans and GAS exchange accruing over time.
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_ON_TIME_HS20 = 58,
- /* Unsigned 32 bit value. Number of channels. */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_NUM_CHANNELS = 59,
-
- /* Attributes of type QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_INFO_* could
- * be nested within the channel stats.
- */
-
- /* Type = enum wifi_channel_width. Channel width, e.g., 20, 40, 80 */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_INFO_WIDTH = 60,
- /* Unsigned 32 bit value. Primary 20 MHz channel. */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_INFO_CENTER_FREQ = 61,
- /* Unsigned 32 bit value. Center frequency (MHz) first segment. */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_INFO_CENTER_FREQ0 = 62,
- /* Unsigned 32 bit value. Center frequency (MHz) second segment. */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_INFO_CENTER_FREQ1 = 63,
-
- /* Attributes of type QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_* could be
- * nested within the radio stats.
- */
-
- /* Unsigned int 32 bit value representing total number of msecs the
- * radio is awake on that channel accruing over time, corresponding to
- * the respective channel.
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_ON_TIME = 64,
- /* Unsigned int 32 bit value representing total number of msecs the CCA
- * register is busy accruing over time corresponding to the respective
- * channel.
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_CCA_BUSY_TIME = 65,
-
- QCA_WLAN_VENDOR_ATTR_LL_STATS_NUM_RADIOS = 66,
-
- /* Signifies the nested list of channel attributes
- * QCA_WLAN_VENDOR_ATTR_LL_STATS_CHANNEL_INFO_*
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_CH_INFO = 67,
-
- /* Signifies the nested list of peer info attributes
- * QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO_*
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO = 68,
-
- /* Signifies the nested list of rate info attributes
- * QCA_WLAN_VENDOR_ATTR_LL_STATS_RATE_*
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_PEER_INFO_RATE_INFO = 69,
-
- /* Signifies the nested list of wmm info attributes
- * QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_AC_*
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_WMM_INFO = 70,
-
- /* Unsigned 8 bit value. Used by the driver; if set to 1, it indicates
- * that more stats, e.g., peers or radio, are to follow in the next
- * QCA_NL80211_VENDOR_SUBCMD_LL_STATS_*_RESULTS event.
- * Otherwise, it is set to 0.
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_RESULTS_MORE_DATA = 71,
-
- /* Unsigned 64 bit value */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_AVERAGE_TSF_OFFSET = 72,
-
- /* Unsigned 32 bit value */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_LEAKY_AP_DETECTED = 73,
-
- /* Unsigned 32 bit value */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_LEAKY_AP_AVG_NUM_FRAMES_LEAKED = 74,
-
- /* Unsigned 32 bit value */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_LEAKY_AP_GUARD_TIME = 75,
-
- /* Unsigned 32 bit value */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_TYPE = 76,
-
- /* Unsigned 32 bit value */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_NUM_TX_LEVELS = 77,
-
- /* Number of msecs the radio spent in transmitting for each power level
- */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_RADIO_TX_TIME_PER_LEVEL = 78,
-
- /* Unsigned 32 bit value */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_RTS_SUCC_CNT = 79,
- /* Unsigned 32 bit value */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_RTS_FAIL_CNT = 80,
- /* Unsigned 32 bit value */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_PPDU_SUCC_CNT = 81,
- /* Unsigned 32 bit value */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_PPDU_FAIL_CNT = 82,
-
- /* keep last */
- QCA_WLAN_VENDOR_ATTR_LL_STATS_AFTER_LAST,
- QCA_WLAN_VENDOR_ATTR_LL_STATS_MAX =
- QCA_WLAN_VENDOR_ATTR_LL_STATS_AFTER_LAST - 1,
-};
-
-enum qca_wlan_vendor_attr_ll_stats_type
-{
- QCA_NL80211_VENDOR_SUBCMD_LL_STATS_TYPE_INVALID = 0,
- QCA_NL80211_VENDOR_SUBCMD_LL_STATS_TYPE_RADIO = 1,
- QCA_NL80211_VENDOR_SUBCMD_LL_STATS_TYPE_IFACE = 2,
- QCA_NL80211_VENDOR_SUBCMD_LL_STATS_TYPE_PEERS = 3,
-
- /* keep last */
- QCA_NL80211_VENDOR_SUBCMD_LL_STATS_TYPE_AFTER_LAST,
- QCA_NL80211_VENDOR_SUBCMD_LL_STATS_TYPE_MAX =
- QCA_NL80211_VENDOR_SUBCMD_LL_STATS_TYPE_AFTER_LAST - 1,
-};
-
-/**
- * enum qca_wlan_vendor_attr_tdls_configuration - Attributes for
- * TDLS configuration to the host driver.
- *
- * @QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_TRIGGER_MODE: Configure the TDLS trigger
- * mode in the host driver. enum qca_wlan_vendor_tdls_trigger_mode
- * represents the different TDLS trigger modes.
- * @QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_TX_STATS_PERIOD: Duration (u32) within
- * which QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_TX_THRESHOLD number
- * of packets shall meet the criteria for implicit TDLS setup.
- * @QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_TX_THRESHOLD: Number (u32) of Tx/Rx packets
- * within a duration QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_TX_STATS_PERIOD
- * to initiate a TDLS setup.
- * @QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_DISCOVERY_PERIOD: Time (u32) to initiate
- * a TDLS Discovery to the peer.
- * @QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_MAX_DISCOVERY_ATTEMPT: Max number (u32) of
- * discovery attempts to know the TDLS capability of the peer. A peer is
- * marked as TDLS not capable if there is no response for all the attempts.
- * @QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_IDLE_TIMEOUT: Represents a duration (u32)
- * within which QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_IDLE_PACKET_THRESHOLD
- * number of TX / RX frames meet the criteria for TDLS teardown.
- * @QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_IDLE_PACKET_THRESHOLD: Minimum number (u32)
- * of Tx/Rx packets within a duration
- * QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_IDLE_TIMEOUT to tear down a TDLS link.
- * @QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_SETUP_RSSI_THRESHOLD: Threshold
- * corresponding to the RSSI of the peer below which a TDLS setup is
- * triggered.
- * @QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_TEARDOWN_RSSI_THRESHOLD: Threshold
- * corresponding to the RSSI of the peer above which a TDLS teardown is
- * triggered.
- */
-enum qca_wlan_vendor_attr_tdls_configuration {
- QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_INVALID = 0,
- QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_TRIGGER_MODE = 1,
-
- /* Attributes configuring the TDLS Implicit Trigger */
- QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_TX_STATS_PERIOD = 2,
- QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_TX_THRESHOLD = 3,
- QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_DISCOVERY_PERIOD = 4,
- QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_MAX_DISCOVERY_ATTEMPT = 5,
- QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_IDLE_TIMEOUT = 6,
- QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_IDLE_PACKET_THRESHOLD = 7,
- QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_SETUP_RSSI_THRESHOLD = 8,
- QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_TEARDOWN_RSSI_THRESHOLD = 9,
-
- /* keep last */
- QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_AFTER_LAST,
- QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_MAX =
- QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_AFTER_LAST - 1
-};
-
-/**
- * enum qca_wlan_vendor_tdls_trigger_mode: Represents the TDLS trigger mode in
- * the driver
- *
- * The following are the different values for
- * QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_TRIGGER_MODE.
- *
- * @QCA_WLAN_VENDOR_TDLS_TRIGGER_MODE_EXPLICIT: The trigger to initiate/teardown
- * the TDLS connection to a respective peer comes from the user space.
- * wpa_supplicant provides the commands TDLS_SETUP, TDLS_TEARDOWN,
- * TDLS_DISCOVER to do this.
- * @QCA_WLAN_VENDOR_TDLS_TRIGGER_MODE_IMPLICIT: Host driver triggers this TDLS
- * setup/teardown to the eligible peer once the configured criteria
- * (such as TX/RX threshold, RSSI) is met. The attributes
- * in QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_IMPLICIT_PARAMS correspond to
- * the different configuration criteria for the TDLS trigger from the
- * host driver.
- * @QCA_WLAN_VENDOR_TDLS_TRIGGER_MODE_EXTERNAL: Enables the driver to trigger
- * the TDLS setup / teardown through the implicit mode only to the
- * configured MAC addresses (wpa_supplicant, with tdls_external_control=1,
- * configures the MAC address through TDLS_SETUP / TDLS_TEARDOWN commands).
- * External mode works on top of the implicit mode. Thus the host driver
- * is expected to configure in TDLS Implicit mode too to operate in
- * External mode.
- * Configuring External mode alone without Implicit mode is invalid.
- *
- * All the above implementations work as expected only when the host driver
- * advertises the capability WPA_DRIVER_FLAGS_TDLS_EXTERNAL_SETUP - representing
- * that the TDLS message exchange is not internal to the host driver, but
- * depends on wpa_supplicant to do the message exchange.
- */
-enum qca_wlan_vendor_tdls_trigger_mode {
- QCA_WLAN_VENDOR_TDLS_TRIGGER_MODE_EXPLICIT = 1 << 0,
- QCA_WLAN_VENDOR_TDLS_TRIGGER_MODE_IMPLICIT = 1 << 1,
- QCA_WLAN_VENDOR_TDLS_TRIGGER_MODE_EXTERNAL = 1 << 2,
-};
-
#endif /* QCA_VENDOR_H */
diff --git a/src/common/version.h b/src/common/version.h
index 16c1004..ae5c9d4 100644
--- a/src/common/version.h
+++ b/src/common/version.h
@@ -9,6 +9,6 @@
#define GIT_VERSION_STR_POSTFIX ""
#endif /* GIT_VERSION_STR_POSTFIX */
-#define VERSION_STR "2.7-devel" VERSION_STR_POSTFIX GIT_VERSION_STR_POSTFIX
+#define VERSION_STR "2.6-devel" VERSION_STR_POSTFIX GIT_VERSION_STR_POSTFIX
#endif /* VERSION_H */
diff --git a/src/common/wpa_common.c b/src/common/wpa_common.c
index a87210e..299b8bb 100644
--- a/src/common/wpa_common.c
+++ b/src/common/wpa_common.c
@@ -9,7 +9,6 @@
#include "includes.h"
#include "common.h"
-#include "utils/crc32.h"
#include "crypto/md5.h"
#include "crypto/sha1.h"
#include "crypto/sha256.h"
@@ -23,49 +22,25 @@
static unsigned int wpa_kck_len(int akmp)
{
- switch (akmp) {
- case WPA_KEY_MGMT_IEEE8021X_SUITE_B_192:
+ if (akmp == WPA_KEY_MGMT_IEEE8021X_SUITE_B_192)
return 24;
- case WPA_KEY_MGMT_FILS_SHA256:
- case WPA_KEY_MGMT_FT_FILS_SHA256:
- case WPA_KEY_MGMT_FILS_SHA384:
- case WPA_KEY_MGMT_FT_FILS_SHA384:
- return 0;
- default:
- return 16;
- }
+ return 16;
}
static unsigned int wpa_kek_len(int akmp)
{
- switch (akmp) {
- case WPA_KEY_MGMT_FILS_SHA384:
- case WPA_KEY_MGMT_FT_FILS_SHA384:
- return 64;
- case WPA_KEY_MGMT_IEEE8021X_SUITE_B_192:
- case WPA_KEY_MGMT_FILS_SHA256:
- case WPA_KEY_MGMT_FT_FILS_SHA256:
+ if (akmp == WPA_KEY_MGMT_IEEE8021X_SUITE_B_192)
return 32;
- default:
- return 16;
- }
+ return 16;
}
unsigned int wpa_mic_len(int akmp)
{
- switch (akmp) {
- case WPA_KEY_MGMT_IEEE8021X_SUITE_B_192:
+ if (akmp == WPA_KEY_MGMT_IEEE8021X_SUITE_B_192)
return 24;
- case WPA_KEY_MGMT_FILS_SHA256:
- case WPA_KEY_MGMT_FILS_SHA384:
- case WPA_KEY_MGMT_FT_FILS_SHA256:
- case WPA_KEY_MGMT_FT_FILS_SHA384:
- return 0;
- default:
- return 16;
- }
+ return 16;
}
@@ -229,155 +204,6 @@
return 0;
}
-#ifdef CONFIG_FILS
-
-int fils_pmk_to_ptk(const u8 *pmk, size_t pmk_len, const u8 *spa, const u8 *aa,
- const u8 *snonce, const u8 *anonce, struct wpa_ptk *ptk,
- u8 *ick, size_t *ick_len, int akmp, int cipher)
-{
- u8 data[2 * ETH_ALEN + 2 * FILS_NONCE_LEN];
- u8 tmp[FILS_ICK_MAX_LEN + WPA_KEK_MAX_LEN + WPA_TK_MAX_LEN];
- size_t key_data_len;
- const char *label = "FILS PTK Derivation";
-
- /*
- * FILS-Key-Data = PRF-X(PMK, "FILS PTK Derivation",
- * SPA || AA || SNonce || ANonce)
- * ICK = L(FILS-Key-Data, 0, ICK_bits)
- * KEK = L(FILS-Key-Data, ICK_bits, KEK_bits)
- * TK = L(FILS-Key-Data, ICK_bits + KEK_bits, TK_bits)
- * If doing FT initial mobility domain association:
- * FILS-FT = L(FILS-Key-Data, ICK_bits + KEK_bits + TK_bits,
- * FILS-FT_bits)
- */
- os_memcpy(data, spa, ETH_ALEN);
- os_memcpy(data + ETH_ALEN, aa, ETH_ALEN);
- os_memcpy(data + 2 * ETH_ALEN, snonce, FILS_NONCE_LEN);
- os_memcpy(data + 2 * ETH_ALEN + FILS_NONCE_LEN, anonce, FILS_NONCE_LEN);
-
- ptk->kck_len = 0;
- ptk->kek_len = wpa_kek_len(akmp);
- ptk->tk_len = wpa_cipher_key_len(cipher);
- if (wpa_key_mgmt_sha384(akmp))
- *ick_len = 48;
- else if (wpa_key_mgmt_sha256(akmp))
- *ick_len = 32;
- else
- return -1;
- key_data_len = *ick_len + ptk->kek_len + ptk->tk_len;
-
- if (wpa_key_mgmt_sha384(akmp))
- sha384_prf(pmk, pmk_len, label, data, sizeof(data),
- tmp, key_data_len);
- else if (sha256_prf(pmk, pmk_len, label, data, sizeof(data),
- tmp, key_data_len) < 0)
- return -1;
-
- wpa_printf(MSG_DEBUG, "FILS: PTK derivation - SPA=" MACSTR
- " AA=" MACSTR, MAC2STR(spa), MAC2STR(aa));
- wpa_hexdump(MSG_DEBUG, "FILS: SNonce", snonce, FILS_NONCE_LEN);
- wpa_hexdump(MSG_DEBUG, "FILS: ANonce", anonce, FILS_NONCE_LEN);
- wpa_hexdump_key(MSG_DEBUG, "FILS: PMK", pmk, pmk_len);
- wpa_hexdump_key(MSG_DEBUG, "FILS: FILS-Key-Data", tmp, key_data_len);
-
- os_memcpy(ick, tmp, *ick_len);
- wpa_hexdump_key(MSG_DEBUG, "FILS: ICK", ick, *ick_len);
-
- os_memcpy(ptk->kek, tmp + *ick_len, ptk->kek_len);
- wpa_hexdump_key(MSG_DEBUG, "FILS: KEK", ptk->kek, ptk->kek_len);
-
- os_memcpy(ptk->tk, tmp + *ick_len + ptk->kek_len, ptk->tk_len);
- wpa_hexdump_key(MSG_DEBUG, "FILS: TK", ptk->tk, ptk->tk_len);
-
- /* TODO: FILS-FT */
-
- os_memset(tmp, 0, sizeof(tmp));
- return 0;
-}
-
-
-int fils_key_auth_sk(const u8 *ick, size_t ick_len, const u8 *snonce,
- const u8 *anonce, const u8 *sta_addr, const u8 *bssid,
- const u8 *g_sta, size_t g_sta_len,
- const u8 *g_ap, size_t g_ap_len,
- int akmp, u8 *key_auth_sta, u8 *key_auth_ap,
- size_t *key_auth_len)
-{
- const u8 *addr[6];
- size_t len[6];
- size_t num_elem = 4;
- int res;
-
- /*
- * For (Re)Association Request frame (STA->AP):
- * Key-Auth = HMAC-Hash(ICK, SNonce || ANonce || STA-MAC || AP-BSSID
- * [ || gSTA || gAP ])
- */
- addr[0] = snonce;
- len[0] = FILS_NONCE_LEN;
- addr[1] = anonce;
- len[1] = FILS_NONCE_LEN;
- addr[2] = sta_addr;
- len[2] = ETH_ALEN;
- addr[3] = bssid;
- len[3] = ETH_ALEN;
- if (g_sta && g_ap_len && g_ap && g_ap_len) {
- addr[4] = g_sta;
- len[4] = g_sta_len;
- addr[5] = g_ap;
- len[5] = g_ap_len;
- num_elem = 6;
- }
-
- if (wpa_key_mgmt_sha384(akmp)) {
- *key_auth_len = 48;
- res = hmac_sha384_vector(ick, ick_len, num_elem, addr, len,
- key_auth_sta);
- } else if (wpa_key_mgmt_sha256(akmp)) {
- *key_auth_len = 32;
- res = hmac_sha256_vector(ick, ick_len, num_elem, addr, len,
- key_auth_sta);
- } else {
- return -1;
- }
- if (res < 0)
- return res;
-
- /*
- * For (Re)Association Response frame (AP->STA):
- * Key-Auth = HMAC-Hash(ICK, ANonce || SNonce || AP-BSSID || STA-MAC
- * [ || gAP || gSTA ])
- */
- addr[0] = anonce;
- addr[1] = snonce;
- addr[2] = bssid;
- addr[3] = sta_addr;
- if (g_sta && g_ap_len && g_ap && g_ap_len) {
- addr[4] = g_ap;
- len[4] = g_ap_len;
- addr[5] = g_sta;
- len[5] = g_sta_len;
- }
-
- if (wpa_key_mgmt_sha384(akmp))
- res = hmac_sha384_vector(ick, ick_len, num_elem, addr, len,
- key_auth_ap);
- else if (wpa_key_mgmt_sha256(akmp))
- res = hmac_sha256_vector(ick, ick_len, num_elem, addr, len,
- key_auth_ap);
- if (res < 0)
- return res;
-
- wpa_hexdump(MSG_DEBUG, "FILS: Key-Auth (STA)",
- key_auth_sta, *key_auth_len);
- wpa_hexdump(MSG_DEBUG, "FILS: Key-Auth (AP)",
- key_auth_ap, *key_auth_len);
-
- return 0;
-}
-
-#endif /* CONFIG_FILS */
-
#ifdef CONFIG_IEEE80211R
int wpa_ft_mic(const u8 *kck, size_t kck_len, const u8 *sta_addr,
@@ -550,8 +376,6 @@
}
if (data.num_pmkid == 1 && data.pmkid)
parse->rsn_pmkid = data.pmkid;
- parse->key_mgmt = data.key_mgmt;
- parse->pairwise_cipher = data.pairwise_cipher;
break;
case WLAN_EID_MOBILITY_DOMAIN:
if (len < sizeof(struct rsn_mdie))
@@ -686,14 +510,6 @@
return WPA_KEY_MGMT_IEEE8021X_SUITE_B;
if (RSN_SELECTOR_GET(s) == RSN_AUTH_KEY_MGMT_802_1X_SUITE_B_192)
return WPA_KEY_MGMT_IEEE8021X_SUITE_B_192;
- if (RSN_SELECTOR_GET(s) == RSN_AUTH_KEY_MGMT_FILS_SHA256)
- return WPA_KEY_MGMT_FILS_SHA256;
- if (RSN_SELECTOR_GET(s) == RSN_AUTH_KEY_MGMT_FILS_SHA384)
- return WPA_KEY_MGMT_FILS_SHA384;
- if (RSN_SELECTOR_GET(s) == RSN_AUTH_KEY_MGMT_FT_FILS_SHA256)
- return WPA_KEY_MGMT_FT_FILS_SHA256;
- if (RSN_SELECTOR_GET(s) == RSN_AUTH_KEY_MGMT_FT_FILS_SHA384)
- return WPA_KEY_MGMT_FT_FILS_SHA384;
if (RSN_SELECTOR_GET(s) == RSN_AUTH_KEY_MGMT_OSEN)
return WPA_KEY_MGMT_OSEN;
return 0;
@@ -1396,14 +1212,6 @@
return "WPA2-EAP-SUITE-B";
case WPA_KEY_MGMT_IEEE8021X_SUITE_B_192:
return "WPA2-EAP-SUITE-B-192";
- case WPA_KEY_MGMT_FILS_SHA256:
- return "FILS-SHA256";
- case WPA_KEY_MGMT_FILS_SHA384:
- return "FILS-SHA384";
- case WPA_KEY_MGMT_FT_FILS_SHA256:
- return "FT-FILS-SHA256";
- case WPA_KEY_MGMT_FT_FILS_SHA384:
- return "FT-FILS-SHA384";
default:
return "UNKNOWN";
}
@@ -1434,14 +1242,6 @@
return WLAN_AKM_SUITE_8021X_SUITE_B;
if (akm & WPA_KEY_MGMT_IEEE8021X_SUITE_B_192)
return WLAN_AKM_SUITE_8021X_SUITE_B_192;
- if (akm & WPA_KEY_MGMT_FILS_SHA256)
- return WLAN_AKM_SUITE_FILS_SHA256;
- if (akm & WPA_KEY_MGMT_FILS_SHA384)
- return WLAN_AKM_SUITE_FILS_SHA384;
- if (akm & WPA_KEY_MGMT_FT_FILS_SHA256)
- return WLAN_AKM_SUITE_FT_FILS_SHA256;
- if (akm & WPA_KEY_MGMT_FT_FILS_SHA384)
- return WLAN_AKM_SUITE_FT_FILS_SHA384;
return 0;
}
@@ -1483,7 +1283,7 @@
}
-#if defined(CONFIG_IEEE80211R) || defined(CONFIG_FILS)
+#ifdef CONFIG_IEEE80211R
int wpa_insert_pmkid(u8 *ies, size_t *ies_len, const u8 *pmkid)
{
u8 *start, *end, *rpos, *rend;
@@ -1582,7 +1382,7 @@
return 0;
}
-#endif /* CONFIG_IEEE80211R || CONFIG_FILS */
+#endif /* CONFIG_IEEE80211R */
int wpa_cipher_key_len(int cipher)
@@ -1905,25 +1705,3 @@
return WPA_CIPHER_CCMP_256;
return WPA_CIPHER_CCMP;
}
-
-
-#ifdef CONFIG_FILS
-u16 fils_domain_name_hash(const char *domain)
-{
- char buf[255], *wpos = buf;
- const char *pos = domain;
- size_t len;
- u32 crc;
-
- for (len = 0; len < sizeof(buf) && *pos; len++) {
- if (isalpha(*pos) && isupper(*pos))
- *wpos++ = tolower(*pos);
- else
- *wpos++ = *pos;
- pos++;
- }
-
- crc = crc32((const u8 *) buf, len);
- return crc & 0xffff;
-}
-#endif /* CONFIG_FILS */
diff --git a/src/common/wpa_common.h b/src/common/wpa_common.h
index 6d28417..af1d0f0 100644
--- a/src/common/wpa_common.h
+++ b/src/common/wpa_common.h
@@ -61,10 +61,6 @@
#define RSN_AUTH_KEY_MGMT_802_1X_SUITE_B_192 RSN_SELECTOR(0x00, 0x0f, 0xac, 12)
#define RSN_AUTH_KEY_MGMT_FT_802_1X_SUITE_B_192 \
RSN_SELECTOR(0x00, 0x0f, 0xac, 13)
-#define RSN_AUTH_KEY_MGMT_FILS_SHA256 RSN_SELECTOR(0x00, 0x0f, 0xac, 14)
-#define RSN_AUTH_KEY_MGMT_FILS_SHA384 RSN_SELECTOR(0x00, 0x0f, 0xac, 15)
-#define RSN_AUTH_KEY_MGMT_FT_FILS_SHA256 RSN_SELECTOR(0x00, 0x0f, 0xac, 16)
-#define RSN_AUTH_KEY_MGMT_FT_FILS_SHA384 RSN_SELECTOR(0x00, 0x0f, 0xac, 17)
#define RSN_AUTH_KEY_MGMT_CCKM RSN_SELECTOR(0x00, 0x40, 0x96, 0x00)
#define RSN_AUTH_KEY_MGMT_OSEN RSN_SELECTOR(0x50, 0x6f, 0x9a, 0x01)
@@ -183,16 +179,30 @@
u8 key_iv[16];
u8 key_rsc[WPA_KEY_RSC_LEN];
u8 key_id[8]; /* Reserved in IEEE 802.11i/RSN */
- /* variable length Key MIC field */
- /* big endian 2-octet Key Data Length field */
- /* followed by Key Data Length bytes of Key Data */
+ u8 key_mic[16];
+ u8 key_data_length[2]; /* big endian */
+ /* followed by key_data_length bytes of key_data */
+} STRUCT_PACKED;
+
+struct wpa_eapol_key_192 {
+ u8 type;
+ /* Note: key_info, key_length, and key_data_length are unaligned */
+ u8 key_info[2]; /* big endian */
+ u8 key_length[2]; /* big endian */
+ u8 replay_counter[WPA_REPLAY_COUNTER_LEN];
+ u8 key_nonce[WPA_NONCE_LEN];
+ u8 key_iv[16];
+ u8 key_rsc[WPA_KEY_RSC_LEN];
+ u8 key_id[8]; /* Reserved in IEEE 802.11i/RSN */
+ u8 key_mic[24];
+ u8 key_data_length[2]; /* big endian */
+ /* followed by key_data_length bytes of key_data */
} STRUCT_PACKED;
#define WPA_EAPOL_KEY_MIC_MAX_LEN 24
#define WPA_KCK_MAX_LEN 24
-#define WPA_KEK_MAX_LEN 64
+#define WPA_KEK_MAX_LEN 32
#define WPA_TK_MAX_LEN 32
-#define FILS_ICK_MAX_LEN 48
/**
* struct wpa_ptk - WPA Pairwise Transient Key
@@ -330,15 +340,6 @@
const u8 *addr1, const u8 *addr2,
const u8 *nonce1, const u8 *nonce2,
struct wpa_ptk *ptk, int akmp, int cipher);
-int fils_pmk_to_ptk(const u8 *pmk, size_t pmk_len, const u8 *spa, const u8 *aa,
- const u8 *snonce, const u8 *anonce, struct wpa_ptk *ptk,
- u8 *ick, size_t *ick_len, int akmp, int cipher);
-int fils_key_auth_sk(const u8 *ick, size_t ick_len, const u8 *snonce,
- const u8 *anonce, const u8 *sta_addr, const u8 *bssid,
- const u8 *g_sta, size_t g_sta_len,
- const u8 *g_ap, size_t g_ap_len,
- int akmp, u8 *key_auth_sta, u8 *key_auth_ap,
- size_t *key_auth_len);
#ifdef CONFIG_IEEE80211R
int wpa_ft_mic(const u8 *kck, size_t kck_len, const u8 *sta_addr,
@@ -429,8 +430,6 @@
size_t igtk_len;
const u8 *ric;
size_t ric_len;
- int key_mgmt;
- int pairwise_cipher;
};
int wpa_ft_parse_ies(const u8 *ies, size_t ies_len, struct wpa_ft_ies *parse);
@@ -450,6 +449,5 @@
int wpa_write_ciphers(char *start, char *end, int ciphers, const char *delim);
int wpa_select_ap_group_cipher(int wpa, int wpa_pairwise, int rsn_pairwise);
unsigned int wpa_mic_len(int akmp);
-u16 fils_domain_name_hash(const char *domain);
#endif /* WPA_COMMON_H */
diff --git a/src/crypto/aes-ctr.c b/src/crypto/aes-ctr.c
index e27f3bb..d4d874d 100644
--- a/src/crypto/aes-ctr.c
+++ b/src/crypto/aes-ctr.c
@@ -1,5 +1,5 @@
/*
- * AES-128/192/256 CTR
+ * AES-128 CTR
*
* Copyright (c) 2003-2007, Jouni Malinen <j@w1.fi>
*
@@ -14,16 +14,15 @@
#include "aes_wrap.h"
/**
- * aes_ctr_encrypt - AES-128/192/256 CTR mode encryption
- * @key: Key for encryption (key_len bytes)
- * @key_len: Length of the key (16, 24, or 32 bytes)
+ * aes_128_ctr_encrypt - AES-128 CTR mode encryption
+ * @key: Key for encryption (16 bytes)
* @nonce: Nonce for counter mode (16 bytes)
* @data: Data to encrypt in-place
* @data_len: Length of data in bytes
* Returns: 0 on success, -1 on failure
*/
-int aes_ctr_encrypt(const u8 *key, size_t key_len, const u8 *nonce,
- u8 *data, size_t data_len)
+int aes_128_ctr_encrypt(const u8 *key, const u8 *nonce,
+ u8 *data, size_t data_len)
{
void *ctx;
size_t j, len, left = data_len;
@@ -31,7 +30,7 @@
u8 *pos = data;
u8 counter[AES_BLOCK_SIZE], buf[AES_BLOCK_SIZE];
- ctx = aes_encrypt_init(key, key_len);
+ ctx = aes_encrypt_init(key, 16);
if (ctx == NULL)
return -1;
os_memcpy(counter, nonce, AES_BLOCK_SIZE);
@@ -54,18 +53,3 @@
aes_encrypt_deinit(ctx);
return 0;
}
-
-
-/**
- * aes_128_ctr_encrypt - AES-128 CTR mode encryption
- * @key: Key for encryption (key_len bytes)
- * @nonce: Nonce for counter mode (16 bytes)
- * @data: Data to encrypt in-place
- * @data_len: Length of data in bytes
- * Returns: 0 on success, -1 on failure
- */
-int aes_128_ctr_encrypt(const u8 *key, const u8 *nonce,
- u8 *data, size_t data_len)
-{
- return aes_ctr_encrypt(key, 16, nonce, data, data_len);
-}
diff --git a/src/crypto/aes-siv.c b/src/crypto/aes-siv.c
index 2bb79b5..5ac82c2 100644
--- a/src/crypto/aes-siv.c
+++ b/src/crypto/aes-siv.c
@@ -61,33 +61,26 @@
}
-static int aes_s2v(const u8 *key, size_t key_len,
- size_t num_elem, const u8 *addr[], size_t *len, u8 *mac)
+static int aes_s2v(const u8 *key, size_t num_elem, const u8 *addr[],
+ size_t *len, u8 *mac)
{
u8 tmp[AES_BLOCK_SIZE], tmp2[AES_BLOCK_SIZE];
u8 *buf = NULL;
int ret;
size_t i;
- const u8 *data[1];
- size_t data_len[1];
if (!num_elem) {
os_memcpy(tmp, zero, sizeof(zero));
tmp[AES_BLOCK_SIZE - 1] = 1;
- data[0] = tmp;
- data_len[0] = sizeof(tmp);
- return omac1_aes_vector(key, key_len, 1, data, data_len, mac);
+ return omac1_aes_128(key, tmp, sizeof(tmp), mac);
}
- data[0] = zero;
- data_len[0] = sizeof(zero);
- ret = omac1_aes_vector(key, key_len, 1, data, data_len, tmp);
+ ret = omac1_aes_128(key, zero, sizeof(zero), tmp);
if (ret)
return ret;
for (i = 0; i < num_elem - 1; i++) {
- ret = omac1_aes_vector(key, key_len, 1, &addr[i], &len[i],
- tmp2);
+ ret = omac1_aes_128(key, addr[i], len[i], tmp2);
if (ret)
return ret;
@@ -101,8 +94,7 @@
os_memcpy(buf, addr[i], len[i]);
xorend(buf, len[i], tmp, AES_BLOCK_SIZE);
- data[0] = buf;
- ret = omac1_aes_vector(key, key_len, 1, data, &len[i], mac);
+ ret = omac1_aes_128(key, buf, len[i], mac);
bin_clear_free(buf, len[i]);
return ret;
}
@@ -111,32 +103,24 @@
pad_block(tmp2, addr[i], len[i]);
xor(tmp, tmp2);
- data[0] = tmp;
- data_len[0] = sizeof(tmp);
- return omac1_aes_vector(key, key_len, 1, data, data_len, mac);
+ return omac1_aes_128(key, tmp, sizeof(tmp), mac);
}
-int aes_siv_encrypt(const u8 *key, size_t key_len,
- const u8 *pw, size_t pwlen,
- size_t num_elem, const u8 *addr[], const size_t *len,
- u8 *out)
+int aes_siv_encrypt(const u8 *key, const u8 *pw,
+ size_t pwlen, size_t num_elem,
+ const u8 *addr[], const size_t *len, u8 *out)
{
const u8 *_addr[6];
size_t _len[6];
- const u8 *k1, *k2;
+ const u8 *k1 = key, *k2 = key + 16;
u8 v[AES_BLOCK_SIZE];
size_t i;
u8 *iv, *crypt_pw;
- if (num_elem > ARRAY_SIZE(_addr) - 1 ||
- (key_len != 32 && key_len != 48 && key_len != 64))
+ if (num_elem > ARRAY_SIZE(_addr) - 1)
return -1;
- key_len /= 2;
- k1 = key;
- k2 = key + key_len;
-
for (i = 0; i < num_elem; i++) {
_addr[i] = addr[i];
_len[i] = len[i];
@@ -144,7 +128,7 @@
_addr[num_elem] = pw;
_len[num_elem] = pwlen;
- if (aes_s2v(k1, key_len, num_elem + 1, _addr, _len, v))
+ if (aes_s2v(k1, num_elem + 1, _addr, _len, v))
return -1;
iv = out;
@@ -156,31 +140,26 @@
/* zero out 63rd and 31st bits of ctr (from right) */
v[8] &= 0x7f;
v[12] &= 0x7f;
- return aes_ctr_encrypt(k2, key_len, v, crypt_pw, pwlen);
+ return aes_128_ctr_encrypt(k2, v, crypt_pw, pwlen);
}
-int aes_siv_decrypt(const u8 *key, size_t key_len,
- const u8 *iv_crypt, size_t iv_c_len,
+int aes_siv_decrypt(const u8 *key, const u8 *iv_crypt, size_t iv_c_len,
size_t num_elem, const u8 *addr[], const size_t *len,
u8 *out)
{
const u8 *_addr[6];
size_t _len[6];
- const u8 *k1, *k2;
+ const u8 *k1 = key, *k2 = key + 16;
size_t crypt_len;
size_t i;
int ret;
u8 iv[AES_BLOCK_SIZE];
u8 check[AES_BLOCK_SIZE];
- if (iv_c_len < AES_BLOCK_SIZE || num_elem > ARRAY_SIZE(_addr) - 1 ||
- (key_len != 32 && key_len != 48 && key_len != 64))
+ if (iv_c_len < AES_BLOCK_SIZE || num_elem > ARRAY_SIZE(_addr) - 1)
return -1;
crypt_len = iv_c_len - AES_BLOCK_SIZE;
- key_len /= 2;
- k1 = key;
- k2 = key + key_len;
for (i = 0; i < num_elem; i++) {
_addr[i] = addr[i];
@@ -195,11 +174,11 @@
iv[8] &= 0x7f;
iv[12] &= 0x7f;
- ret = aes_ctr_encrypt(k2, key_len, iv, out, crypt_len);
+ ret = aes_128_ctr_encrypt(k2, iv, out, crypt_len);
if (ret)
return ret;
- ret = aes_s2v(k1, key_len, num_elem + 1, _addr, _len, check);
+ ret = aes_s2v(k1, num_elem + 1, _addr, _len, check);
if (ret)
return ret;
if (os_memcmp(check, iv_crypt, AES_BLOCK_SIZE) == 0)
diff --git a/src/crypto/aes_siv.h b/src/crypto/aes_siv.h
index fb05d80..463cf65 100644
--- a/src/crypto/aes_siv.h
+++ b/src/crypto/aes_siv.h
@@ -9,12 +9,10 @@
#ifndef AES_SIV_H
#define AES_SIV_H
-int aes_siv_encrypt(const u8 *key, size_t key_len,
- const u8 *pw, size_t pwlen,
- size_t num_elem, const u8 *addr[], const size_t *len,
- u8 *out);
-int aes_siv_decrypt(const u8 *key, size_t key_len,
- const u8 *iv_crypt, size_t iv_c_len,
+int aes_siv_encrypt(const u8 *key, const u8 *pw,
+ size_t pwlen, size_t num_elem,
+ const u8 *addr[], const size_t *len, u8 *out);
+int aes_siv_decrypt(const u8 *key, const u8 *iv_crypt, size_t iv_c_len,
size_t num_elem, const u8 *addr[], const size_t *len,
u8 *out);
diff --git a/src/crypto/aes_wrap.h b/src/crypto/aes_wrap.h
index b70b1d2..4a14209 100644
--- a/src/crypto/aes_wrap.h
+++ b/src/crypto/aes_wrap.h
@@ -3,7 +3,7 @@
*
* - AES Key Wrap Algorithm (RFC3394)
* - One-Key CBC MAC (OMAC1) hash with AES-128 and AES-256
- * - AES-128/192/256 CTR mode encryption
+ * - AES-128 CTR mode encryption
* - AES-128 EAX mode encryption/decryption
* - AES-128 CBC
* - AES-GCM
@@ -33,8 +33,6 @@
int __must_check omac1_aes_256(const u8 *key, const u8 *data, size_t data_len,
u8 *mac);
int __must_check aes_128_encrypt_block(const u8 *key, const u8 *in, u8 *out);
-int __must_check aes_ctr_encrypt(const u8 *key, size_t key_len, const u8 *nonce,
- u8 *data, size_t data_len);
int __must_check aes_128_ctr_encrypt(const u8 *key, const u8 *nonce,
u8 *data, size_t data_len);
int __must_check aes_128_eax_encrypt(const u8 *key,
diff --git a/src/crypto/crypto_module_tests.c b/src/crypto/crypto_module_tests.c
index fb91ab4..ffd2394 100644
--- a/src/crypto/crypto_module_tests.c
+++ b/src/crypto/crypto_module_tests.c
@@ -92,7 +92,7 @@
addr[0] = ad;
len[0] = sizeof(ad);
- if (aes_siv_encrypt(key, sizeof(key), plaintext, sizeof(plaintext),
+ if (aes_siv_encrypt(key, plaintext, sizeof(plaintext),
1, addr, len, out)) {
wpa_printf(MSG_ERROR, "AES-SIV mode encryption failed");
return 1;
@@ -103,8 +103,7 @@
return 1;
}
- if (aes_siv_decrypt(key, sizeof(key), iv_c, sizeof(iv_c),
- 1, addr, len, out)) {
+ if (aes_siv_decrypt(key, iv_c, sizeof(iv_c), 1, addr, len, out)) {
wpa_printf(MSG_ERROR, "AES-SIV mode decryption failed");
return 1;
}
@@ -122,8 +121,7 @@
addr[2] = nonce_2;
len[2] = sizeof(nonce_2);
- if (aes_siv_encrypt(key_2, sizeof(key_2),
- plaintext_2, sizeof(plaintext_2),
+ if (aes_siv_encrypt(key_2, plaintext_2, sizeof(plaintext_2),
3, addr, len, out)) {
wpa_printf(MSG_ERROR, "AES-SIV mode encryption failed");
return 1;
@@ -134,8 +132,7 @@
return 1;
}
- if (aes_siv_decrypt(key_2, sizeof(key_2), iv_c_2, sizeof(iv_c_2),
- 3, addr, len, out)) {
+ if (aes_siv_decrypt(key_2, iv_c_2, sizeof(iv_c_2), 3, addr, len, out)) {
wpa_printf(MSG_ERROR, "AES-SIV mode decryption failed");
return 1;
}
diff --git a/src/crypto/crypto_openssl.c b/src/crypto/crypto_openssl.c
index b3d1b07..19e0e2b 100644
--- a/src/crypto/crypto_openssl.c
+++ b/src/crypto/crypto_openssl.c
@@ -611,7 +611,7 @@
void * dh5_init(struct wpabuf **priv, struct wpabuf **publ)
{
-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
DH *dh;
struct wpabuf *pubkey = NULL, *privkey = NULL;
size_t publen, privlen;
@@ -712,7 +712,7 @@
void * dh5_init_fixed(const struct wpabuf *priv, const struct wpabuf *publ)
{
-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
DH *dh;
dh = DH_new();
diff --git a/src/crypto/sha512-internal.c b/src/crypto/sha512-internal.c
index 76c4fe7..66ef331 100644
--- a/src/crypto/sha512-internal.c
+++ b/src/crypto/sha512-internal.c
@@ -242,7 +242,7 @@
md->curlen = 0;
}
- /* pad up to 120 bytes of zeroes
+ /* pad upto 120 bytes of zeroes
* note: that from 112 to 120 is the 64 MSB of the length. We assume
* that you won't hash > 2^64 bits of data... :-)
*/
diff --git a/src/crypto/tls_openssl.c b/src/crypto/tls_openssl.c
index a7d4880..23ac64b 100644
--- a/src/crypto/tls_openssl.c
+++ b/src/crypto/tls_openssl.c
@@ -919,7 +919,7 @@
}
#endif /* OPENSSL_FIPS */
#endif /* CONFIG_FIPS */
-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
SSL_load_error_strings();
SSL_library_init();
#ifndef OPENSSL_NO_SHA256
@@ -1043,7 +1043,7 @@
tls_openssl_ref_count--;
if (tls_openssl_ref_count == 0) {
-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
#ifndef OPENSSL_NO_ENGINE
ENGINE_cleanup();
#endif /* OPENSSL_NO_ENGINE */
@@ -2334,7 +2334,7 @@
return 0;
#ifdef PKCS12_FUNCS
-#if OPENSSL_VERSION_NUMBER < 0x10002000L || defined(LIBRESSL_VERSION_NUMBER)
+#if OPENSSL_VERSION_NUMBER < 0x10002000L
/*
* Clear previously set extra chain certificates, if any, from PKCS#12
* processing in tls_parse_pkcs12() to allow OpenSSL to build a new
@@ -3976,7 +3976,7 @@
engine_id = "pkcs11";
#if defined(EAP_FAST) || defined(EAP_FAST_DYNAMIC) || defined(EAP_SERVER_FAST)
-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
if (params->flags & TLS_CONN_EAP_FAST) {
wpa_printf(MSG_DEBUG,
"OpenSSL: Use TLSv1_method() for EAP-FAST");
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 9a6db90..a449cc9 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -21,9 +21,6 @@
#include "common/defs.h"
#include "common/ieee802_11_defs.h"
-#ifdef CONFIG_MACSEC
-#include "pae/ieee802_1x_kay.h"
-#endif /* CONFIG_MACSEC */
#include "utils/list.h"
#define HOSTAPD_CHAN_DISABLED 0x00000001
@@ -488,18 +485,17 @@
int p2p;
/**
- * auth_data - Additional elements for Authentication frame
+ * sae_data - SAE elements for Authentication frame
*
* This buffer starts with the Authentication transaction sequence
- * number field. If no special handling of such elements is needed, this
- * pointer is %NULL. This is used with SAE and FILS.
+ * number field. If SAE is not used, this pointer is %NULL.
*/
- const u8 *auth_data;
+ const u8 *sae_data;
/**
- * auth_data_len - Length of auth_data buffer in octets
+ * sae_data_len - Length of sae_data buffer in octets
*/
- size_t auth_data_len;
+ size_t sae_data_len;
};
/**
@@ -886,27 +882,6 @@
* AP as usual. Valid for DMG network only.
*/
int pbss;
-
- /**
- * fils_kek - KEK for FILS association frame protection (AES-SIV)
- */
- const u8 *fils_kek;
-
- /**
- * fils_kek_len: Length of fils_kek in bytes
- */
- size_t fils_kek_len;
-
- /**
- * fils_nonces - Nonces for FILS association frame protection
- * (AES-SIV AAD)
- */
- const u8 *fils_nonces;
-
- /**
- * fils_nonces_len: Length of fils_nonce in bytes
- */
- size_t fils_nonces_len;
};
enum hide_ssid {
@@ -1311,8 +1286,6 @@
#define WPA_DRIVER_FLAGS_FULL_AP_CLIENT_STATE 0x0000010000000000ULL
/** Driver supports P2P Listen offload */
#define WPA_DRIVER_FLAGS_P2P_LISTEN_OFFLOAD 0x0000020000000000ULL
-/** Driver supports FILS */
-#define WPA_DRIVER_FLAGS_SUPPORT_FILS 0x0000040000000000ULL
u64 flags;
#define FULL_AP_CLIENT_STATE_SUPP(drv_flags) \
@@ -3322,14 +3295,6 @@
int (*macsec_deinit)(void *priv);
/**
- * macsec_get_capability - Inform MKA of this driver's capability
- * @priv: Private driver interface data
- * @cap: Driver's capability
- * Returns: 0 on success, -1 on failure
- */
- int (*macsec_get_capability)(void *priv, enum macsec_cap *cap);
-
- /**
* enable_protect_frames - Set protect frames status
* @priv: Private driver interface data
* @enabled: TRUE = protect frames enabled
@@ -3368,129 +3333,155 @@
/**
* get_receive_lowest_pn - Get receive lowest pn
* @priv: Private driver interface data
- * @sa: secure association
+ * @channel: secure channel
+ * @an: association number
+ * @lowest_pn: lowest accept pn
* Returns: 0 on success, -1 on failure (or if not supported)
*/
- int (*get_receive_lowest_pn)(void *priv, struct receive_sa *sa);
+ int (*get_receive_lowest_pn)(void *priv, u32 channel, u8 an,
+ u32 *lowest_pn);
/**
* get_transmit_next_pn - Get transmit next pn
* @priv: Private driver interface data
- * @sa: secure association
+ * @channel: secure channel
+ * @an: association number
+ * @next_pn: next pn
* Returns: 0 on success, -1 on failure (or if not supported)
*/
- int (*get_transmit_next_pn)(void *priv, struct transmit_sa *sa);
+ int (*get_transmit_next_pn)(void *priv, u32 channel, u8 an,
+ u32 *next_pn);
/**
* set_transmit_next_pn - Set transmit next pn
* @priv: Private driver interface data
- * @sa: secure association
+ * @channel: secure channel
+ * @an: association number
+ * @next_pn: next pn
* Returns: 0 on success, -1 on failure (or if not supported)
*/
- int (*set_transmit_next_pn)(void *priv, struct transmit_sa *sa);
+ int (*set_transmit_next_pn)(void *priv, u32 channel, u8 an,
+ u32 next_pn);
+
+ /**
+ * get_available_receive_sc - get available receive channel
+ * @priv: Private driver interface data
+ * @channel: secure channel
+ * Returns: 0 on success, -1 on failure (or if not supported)
+ */
+ int (*get_available_receive_sc)(void *priv, u32 *channel);
/**
* create_receive_sc - create secure channel for receiving
* @priv: Private driver interface data
- * @sc: secure channel
+ * @channel: secure channel
+ * @sci_addr: secure channel identifier - address
+ * @sci_port: secure channel identifier - port
* @conf_offset: confidentiality offset (0, 30, or 50)
* @validation: frame validation policy (0 = Disabled, 1 = Checked,
* 2 = Strict)
* Returns: 0 on success, -1 on failure (or if not supported)
*/
- int (*create_receive_sc)(void *priv, struct receive_sc *sc,
- unsigned int conf_offset,
+ int (*create_receive_sc)(void *priv, u32 channel, const u8 *sci_addr,
+ u16 sci_port, unsigned int conf_offset,
int validation);
/**
* delete_receive_sc - delete secure connection for receiving
* @priv: private driver interface data from init()
- * @sc: secure channel
+ * @channel: secure channel
* Returns: 0 on success, -1 on failure
*/
- int (*delete_receive_sc)(void *priv, struct receive_sc *sc);
+ int (*delete_receive_sc)(void *priv, u32 channel);
/**
* create_receive_sa - create secure association for receive
* @priv: private driver interface data from init()
- * @sa: secure association
+ * @channel: secure channel
+ * @an: association number
+ * @lowest_pn: the lowest packet number can be received
+ * @sak: the secure association key
* Returns: 0 on success, -1 on failure
*/
- int (*create_receive_sa)(void *priv, struct receive_sa *sa);
-
- /**
- * delete_receive_sa - Delete secure association for receive
- * @priv: Private driver interface data from init()
- * @sa: Secure association
- * Returns: 0 on success, -1 on failure
- */
- int (*delete_receive_sa)(void *priv, struct receive_sa *sa);
+ int (*create_receive_sa)(void *priv, u32 channel, u8 an,
+ u32 lowest_pn, const u8 *sak);
/**
* enable_receive_sa - enable the SA for receive
* @priv: private driver interface data from init()
- * @sa: secure association
+ * @channel: secure channel
+ * @an: association number
* Returns: 0 on success, -1 on failure
*/
- int (*enable_receive_sa)(void *priv, struct receive_sa *sa);
+ int (*enable_receive_sa)(void *priv, u32 channel, u8 an);
/**
* disable_receive_sa - disable SA for receive
* @priv: private driver interface data from init()
- * @sa: secure association
+ * @channel: secure channel index
+ * @an: association number
* Returns: 0 on success, -1 on failure
*/
- int (*disable_receive_sa)(void *priv, struct receive_sa *sa);
+ int (*disable_receive_sa)(void *priv, u32 channel, u8 an);
+
+ /**
+ * get_available_transmit_sc - get available transmit channel
+ * @priv: Private driver interface data
+ * @channel: secure channel
+ * Returns: 0 on success, -1 on failure (or if not supported)
+ */
+ int (*get_available_transmit_sc)(void *priv, u32 *channel);
/**
* create_transmit_sc - create secure connection for transmit
* @priv: private driver interface data from init()
- * @sc: secure channel
- * @conf_offset: confidentiality offset (0, 30, or 50)
+ * @channel: secure channel
+ * @sci_addr: secure channel identifier - address
+ * @sci_port: secure channel identifier - port
* Returns: 0 on success, -1 on failure
*/
- int (*create_transmit_sc)(void *priv, struct transmit_sc *sc,
- unsigned int conf_offset);
+ int (*create_transmit_sc)(void *priv, u32 channel, const u8 *sci_addr,
+ u16 sci_port, unsigned int conf_offset);
/**
* delete_transmit_sc - delete secure connection for transmit
* @priv: private driver interface data from init()
- * @sc: secure channel
+ * @channel: secure channel
* Returns: 0 on success, -1 on failure
*/
- int (*delete_transmit_sc)(void *priv, struct transmit_sc *sc);
+ int (*delete_transmit_sc)(void *priv, u32 channel);
/**
* create_transmit_sa - create secure association for transmit
* @priv: private driver interface data from init()
- * @sa: secure association
+ * @channel: secure channel index
+ * @an: association number
+ * @next_pn: the packet number used as next transmit packet
+ * @confidentiality: True if the SA is to provide confidentiality
+ * as well as integrity
+ * @sak: the secure association key
* Returns: 0 on success, -1 on failure
*/
- int (*create_transmit_sa)(void *priv, struct transmit_sa *sa);
-
- /**
- * delete_transmit_sa - Delete secure association for transmit
- * @priv: Private driver interface data from init()
- * @sa: Secure association
- * Returns: 0 on success, -1 on failure
- */
- int (*delete_transmit_sa)(void *priv, struct transmit_sa *sa);
+ int (*create_transmit_sa)(void *priv, u32 channel, u8 an, u32 next_pn,
+ Boolean confidentiality, const u8 *sak);
/**
* enable_transmit_sa - enable SA for transmit
* @priv: private driver interface data from init()
- * @sa: secure association
+ * @channel: secure channel
+ * @an: association number
* Returns: 0 on success, -1 on failure
*/
- int (*enable_transmit_sa)(void *priv, struct transmit_sa *sa);
+ int (*enable_transmit_sa)(void *priv, u32 channel, u8 an);
/**
* disable_transmit_sa - disable SA for transmit
* @priv: private driver interface data from init()
- * @sa: secure association
+ * @channel: secure channel
+ * @an: association number
* Returns: 0 on success, -1 on failure
*/
- int (*disable_transmit_sa)(void *priv, struct transmit_sa *sa);
+ int (*disable_transmit_sa)(void *priv, u32 channel, u8 an);
#endif /* CONFIG_MACSEC */
/**
@@ -3632,16 +3623,6 @@
*/
int (*set_default_scan_ies)(void *priv, const u8 *ies, size_t ies_len);
- /**
- * set_tdls_mode - Set TDLS trigger mode to the host driver
- * @priv: Private driver interface data
- * @tdls_external_control: Represents if TDLS external trigger control
- * mode is enabled/disabled.
- *
- * This optional callback can be used to configure the TDLS external
- * trigger control mode to the host driver.
- */
- int (*set_tdls_mode)(void *priv, int tdls_external_control);
};
@@ -4062,7 +4043,7 @@
* EVENT_DFS_CAC_ABORTED - Notify that channel availability check has been aborted
*
* The CAC was not successful, and the channel remains in the previous
- * state. This may happen due to a radar being detected or other
+ * state. This may happen due to a radar beeing detected or other
* external influences.
*/
EVENT_DFS_CAC_ABORTED,
@@ -4223,16 +4204,6 @@
size_t resp_ies_len;
/**
- * resp_frame - (Re)Association Response frame
- */
- const u8 *resp_frame;
-
- /**
- * resp_frame_len - (Re)Association Response frame length
- */
- size_t resp_frame_len;
-
- /**
* beacon_ies - Beacon or Probe Response IEs
*
* Optional Beacon/ProbeResp data: IEs included in Beacon or
diff --git a/src/drivers/driver_macsec_qca.c b/src/drivers/driver_macsec_qca.c
index 22d414c..826d3cc 100644
--- a/src/drivers/driver_macsec_qca.c
+++ b/src/drivers/driver_macsec_qca.c
@@ -29,7 +29,6 @@
#include "utils/eloop.h"
#include "common/defs.h"
#include "common/ieee802_1x_defs.h"
-#include "pae/ieee802_1x_kay.h"
#include "driver.h"
#include "nss_macsec_secy.h"
@@ -56,10 +55,6 @@
static const u8 pae_group_addr[ETH_ALEN] =
{ 0x01, 0x80, 0xc2, 0x00, 0x00, 0x03 };
-struct channel_map {
- struct ieee802_1x_mka_sci sci;
-};
-
struct macsec_qca_data {
char ifname[IFNAMSIZ + 1];
u32 secy_id;
@@ -76,9 +71,6 @@
Boolean protect_frames;
Boolean replay_protect;
u32 replay_window;
-
- struct channel_map receive_channel_map[MAXSC];
- struct channel_map transmit_channel_map[MAXSC];
};
@@ -465,16 +457,6 @@
}
-static int macsec_qca_get_capability(void *priv, enum macsec_cap *cap)
-{
- wpa_printf(MSG_DEBUG, "%s", __func__);
-
- *cap = MACSEC_CAP_INTEG_AND_CONF_0_30_50;
-
- return 0;
-}
-
-
static int macsec_qca_enable_protect_frames(void *priv, Boolean enabled)
{
struct macsec_qca_data *drv = priv;
@@ -533,82 +515,16 @@
}
-static int macsec_qca_lookup_channel(struct channel_map *map,
- struct ieee802_1x_mka_sci *sci,
- u32 *channel)
-{
- u32 i;
-
- for (i = 0; i < MAXSC; i++) {
- if (os_memcmp(&map[i].sci, sci,
- sizeof(struct ieee802_1x_mka_sci)) == 0) {
- *channel = i;
- return 0;
- }
- }
-
- return -1;
-}
-
-
-static void macsec_qca_register_channel(struct channel_map *map,
- struct ieee802_1x_mka_sci *sci,
- u32 channel)
-{
- os_memcpy(&map[channel].sci, sci, sizeof(struct ieee802_1x_mka_sci));
-}
-
-
-static int macsec_qca_lookup_receive_channel(struct macsec_qca_data *drv,
- struct receive_sc *sc,
- u32 *channel)
-{
- return macsec_qca_lookup_channel(drv->receive_channel_map, &sc->sci,
- channel);
-}
-
-
-static void macsec_qca_register_receive_channel(struct macsec_qca_data *drv,
- struct receive_sc *sc,
- u32 channel)
-{
- macsec_qca_register_channel(drv->receive_channel_map, &sc->sci,
- channel);
-}
-
-
-static int macsec_qca_lookup_transmit_channel(struct macsec_qca_data *drv,
- struct transmit_sc *sc,
- u32 *channel)
-{
- return macsec_qca_lookup_channel(drv->transmit_channel_map, &sc->sci,
- channel);
-}
-
-
-static void macsec_qca_register_transmit_channel(struct macsec_qca_data *drv,
- struct transmit_sc *sc,
- u32 channel)
-{
- macsec_qca_register_channel(drv->transmit_channel_map, &sc->sci,
- channel);
-}
-
-
-static int macsec_qca_get_receive_lowest_pn(void *priv, struct receive_sa *sa)
+static int macsec_qca_get_receive_lowest_pn(void *priv, u32 channel, u8 an,
+ u32 *lowest_pn)
{
struct macsec_qca_data *drv = priv;
int ret = 0;
u32 next_pn = 0;
bool enabled = FALSE;
u32 win;
- u32 channel;
- ret = macsec_qca_lookup_receive_channel(priv, sa->sc, &channel);
- if (ret != 0)
- return ret;
-
- ret += nss_macsec_secy_rx_sa_next_pn_get(drv->secy_id, channel, sa->an,
+ ret += nss_macsec_secy_rx_sa_next_pn_get(drv->secy_id, channel, an,
&next_pn);
ret += nss_macsec_secy_rx_sc_replay_protect_get(drv->secy_id, channel,
&enabled);
@@ -616,49 +532,40 @@
channel, &win);
if (enabled)
- sa->lowest_pn = (next_pn > win) ? (next_pn - win) : 1;
+ *lowest_pn = (next_pn > win) ? (next_pn - win) : 1;
else
- sa->lowest_pn = next_pn;
+ *lowest_pn = next_pn;
- wpa_printf(MSG_DEBUG, "%s: lpn=0x%x", __func__, sa->lowest_pn);
+ wpa_printf(MSG_DEBUG, "%s: lpn=0x%x", __func__, *lowest_pn);
return ret;
}
-static int macsec_qca_get_transmit_next_pn(void *priv, struct transmit_sa *sa)
+static int macsec_qca_get_transmit_next_pn(void *priv, u32 channel, u8 an,
+ u32 *next_pn)
{
struct macsec_qca_data *drv = priv;
int ret = 0;
- u32 channel;
- ret = macsec_qca_lookup_transmit_channel(priv, sa->sc, &channel);
- if (ret != 0)
- return ret;
+ ret += nss_macsec_secy_tx_sa_next_pn_get(drv->secy_id, channel, an,
+ next_pn);
- ret += nss_macsec_secy_tx_sa_next_pn_get(drv->secy_id, channel, sa->an,
- &sa->next_pn);
-
- wpa_printf(MSG_DEBUG, "%s: npn=0x%x", __func__, sa->next_pn);
+ wpa_printf(MSG_DEBUG, "%s: npn=0x%x", __func__, *next_pn);
return ret;
}
-int macsec_qca_set_transmit_next_pn(void *priv, struct transmit_sa *sa)
+int macsec_qca_set_transmit_next_pn(void *priv, u32 channel, u8 an, u32 next_pn)
{
struct macsec_qca_data *drv = priv;
int ret = 0;
- u32 channel;
- ret = macsec_qca_lookup_transmit_channel(priv, sa->sc, &channel);
- if (ret != 0)
- return ret;
+ ret += nss_macsec_secy_tx_sa_next_pn_set(drv->secy_id, channel, an,
+ next_pn);
- ret += nss_macsec_secy_tx_sa_next_pn_set(drv->secy_id, channel, sa->an,
- sa->next_pn);
-
- wpa_printf(MSG_INFO, "%s: npn=0x%x", __func__, sa->next_pn);
+ wpa_printf(MSG_INFO, "%s: npn=0x%x", __func__, next_pn);
return ret;
}
@@ -691,7 +598,8 @@
}
-static int macsec_qca_create_receive_sc(void *priv, struct receive_sc *sc,
+static int macsec_qca_create_receive_sc(void *priv, u32 channel,
+ const u8 *sci_addr, u16 sci_port,
unsigned int conf_offset,
int validation)
{
@@ -700,13 +608,6 @@
fal_rx_prc_lut_t entry;
fal_rx_sc_validate_frame_e vf;
enum validate_frames validate_frames = validation;
- u32 channel;
- const u8 *sci_addr = sc->sci.addr;
- u16 sci_port = be_to_host16(sc->sci.port);
-
- ret = macsec_qca_get_available_receive_sc(priv, &channel);
- if (ret != 0)
- return ret;
wpa_printf(MSG_DEBUG, "%s: channel=%d", __func__, channel);
@@ -741,22 +642,15 @@
channel,
drv->replay_window);
- macsec_qca_register_receive_channel(drv, sc, channel);
-
return ret;
}
-static int macsec_qca_delete_receive_sc(void *priv, struct receive_sc *sc)
+static int macsec_qca_delete_receive_sc(void *priv, u32 channel)
{
struct macsec_qca_data *drv = priv;
- int ret;
+ int ret = 0;
fal_rx_prc_lut_t entry;
- u32 channel;
-
- ret = macsec_qca_lookup_receive_channel(priv, sc, &channel);
- if (ret != 0)
- return ret;
wpa_printf(MSG_DEBUG, "%s: channel=%d", __func__, channel);
@@ -770,68 +664,49 @@
}
-static int macsec_qca_create_receive_sa(void *priv, struct receive_sa *sa)
+static int macsec_qca_create_receive_sa(void *priv, u32 channel, u8 an,
+ u32 lowest_pn, const u8 *sak)
{
struct macsec_qca_data *drv = priv;
- int ret;
+ int ret = 0;
fal_rx_sak_t rx_sak;
int i = 0;
- u32 channel;
-
- ret = macsec_qca_lookup_receive_channel(priv, sa->sc, &channel);
- if (ret != 0)
- return ret;
wpa_printf(MSG_DEBUG, "%s, channel=%d, an=%d, lpn=0x%x",
- __func__, channel, sa->an, sa->lowest_pn);
+ __func__, channel, an, lowest_pn);
os_memset(&rx_sak, 0, sizeof(rx_sak));
for (i = 0; i < 16; i++)
- rx_sak.sak[i] = sa->pkey->key[15 - i];
+ rx_sak.sak[i] = sak[15 - i];
- ret += nss_macsec_secy_rx_sa_create(drv->secy_id, channel, sa->an);
- ret += nss_macsec_secy_rx_sak_set(drv->secy_id, channel, sa->an,
- &rx_sak);
+ ret += nss_macsec_secy_rx_sa_create(drv->secy_id, channel, an);
+ ret += nss_macsec_secy_rx_sak_set(drv->secy_id, channel, an, &rx_sak);
return ret;
}
-static int macsec_qca_enable_receive_sa(void *priv, struct receive_sa *sa)
+static int macsec_qca_enable_receive_sa(void *priv, u32 channel, u8 an)
{
struct macsec_qca_data *drv = priv;
- int ret;
- u32 channel;
+ int ret = 0;
- ret = macsec_qca_lookup_receive_channel(priv, sa->sc, &channel);
- if (ret != 0)
- return ret;
+ wpa_printf(MSG_DEBUG, "%s: channel=%d, an=%d", __func__, channel, an);
- wpa_printf(MSG_DEBUG, "%s: channel=%d, an=%d", __func__, channel,
- sa->an);
-
- ret += nss_macsec_secy_rx_sa_en_set(drv->secy_id, channel, sa->an,
- TRUE);
+ ret += nss_macsec_secy_rx_sa_en_set(drv->secy_id, channel, an, TRUE);
return ret;
}
-static int macsec_qca_disable_receive_sa(void *priv, struct receive_sa *sa)
+static int macsec_qca_disable_receive_sa(void *priv, u32 channel, u8 an)
{
struct macsec_qca_data *drv = priv;
- int ret;
- u32 channel;
+ int ret = 0;
- ret = macsec_qca_lookup_receive_channel(priv, sa->sc, &channel);
- if (ret != 0)
- return ret;
+ wpa_printf(MSG_DEBUG, "%s: channel=%d, an=%d", __func__, channel, an);
- wpa_printf(MSG_DEBUG, "%s: channel=%d, an=%d", __func__, channel,
- sa->an);
-
- ret += nss_macsec_secy_rx_sa_en_set(drv->secy_id, channel, sa->an,
- FALSE);
+ ret += nss_macsec_secy_rx_sa_en_set(drv->secy_id, channel, an, FALSE);
return ret;
}
@@ -840,12 +715,14 @@
static int macsec_qca_get_available_transmit_sc(void *priv, u32 *channel)
{
struct macsec_qca_data *drv = priv;
+ int ret = 0;
u32 sc_ch = 0;
bool in_use = FALSE;
for (sc_ch = 0; sc_ch < MAXSC; sc_ch++) {
- if (nss_macsec_secy_tx_sc_in_used_get(drv->secy_id, sc_ch,
- &in_use))
+ ret = nss_macsec_secy_tx_sc_in_used_get(drv->secy_id, sc_ch,
+ &in_use);
+ if (ret)
continue;
if (!in_use) {
@@ -862,18 +739,14 @@
}
-static int macsec_qca_create_transmit_sc(void *priv, struct transmit_sc *sc,
+static int macsec_qca_create_transmit_sc(void *priv, u32 channel,
+ const u8 *sci_addr, u16 sci_port,
unsigned int conf_offset)
{
struct macsec_qca_data *drv = priv;
- int ret;
+ int ret = 0;
fal_tx_class_lut_t entry;
u8 psci[ETH_ALEN + 2];
- u32 channel;
-
- ret = macsec_qca_get_available_transmit_sc(priv, &channel);
- if (ret != 0)
- return ret;
wpa_printf(MSG_DEBUG, "%s: channel=%d", __func__, channel);
@@ -884,9 +757,9 @@
entry.action = FAL_TX_CLASS_ACTION_FORWARD;
entry.channel = channel;
- os_memcpy(psci, sc->sci.addr, ETH_ALEN);
- psci[6] = (sc->sci.port >> 8) & 0xf;
- psci[7] = sc->sci.port & 0xf;
+ os_memcpy(psci, sci_addr, ETH_ALEN);
+ psci[6] = (sci_port >> 8) & 0xf;
+ psci[7] = sci_port & 0xf;
ret += nss_macsec_secy_tx_class_lut_set(drv->secy_id, channel, &entry);
ret += nss_macsec_secy_tx_sc_create(drv->secy_id, channel, psci, 8);
@@ -896,22 +769,15 @@
channel,
conf_offset);
- macsec_qca_register_transmit_channel(drv, sc, channel);
-
return ret;
}
-static int macsec_qca_delete_transmit_sc(void *priv, struct transmit_sc *sc)
+static int macsec_qca_delete_transmit_sc(void *priv, u32 channel)
{
struct macsec_qca_data *drv = priv;
- int ret;
+ int ret = 0;
fal_tx_class_lut_t entry;
- u32 channel;
-
- ret = macsec_qca_lookup_transmit_channel(priv, sc, &channel);
- if (ret != 0)
- return ret;
wpa_printf(MSG_DEBUG, "%s: channel=%d", __func__, channel);
@@ -925,22 +791,19 @@
}
-static int macsec_qca_create_transmit_sa(void *priv, struct transmit_sa *sa)
+static int macsec_qca_create_transmit_sa(void *priv, u32 channel, u8 an,
+ u32 next_pn, Boolean confidentiality,
+ const u8 *sak)
{
struct macsec_qca_data *drv = priv;
- int ret;
+ int ret = 0;
u8 tci = 0;
fal_tx_sak_t tx_sak;
int i;
- u32 channel;
-
- ret = macsec_qca_lookup_transmit_channel(priv, sa->sc, &channel);
- if (ret != 0)
- return ret;
wpa_printf(MSG_DEBUG,
"%s: channel=%d, an=%d, next_pn=0x%x, confidentiality=%d",
- __func__, channel, sa->an, sa->next_pn, sa->confidentiality);
+ __func__, channel, an, next_pn, confidentiality);
if (drv->always_include_sci)
tci |= TCI_SC;
@@ -949,60 +812,45 @@
else if (drv->use_scb)
tci |= TCI_SCB;
- if (sa->confidentiality)
+ if (confidentiality)
tci |= TCI_E | TCI_C;
os_memset(&tx_sak, 0, sizeof(tx_sak));
for (i = 0; i < 16; i++)
- tx_sak.sak[i] = sa->pkey->key[15 - i];
+ tx_sak.sak[i] = sak[15 - i];
- ret += nss_macsec_secy_tx_sa_next_pn_set(drv->secy_id, channel, sa->an,
- sa->next_pn);
- ret += nss_macsec_secy_tx_sak_set(drv->secy_id, channel, sa->an,
- &tx_sak);
+ ret += nss_macsec_secy_tx_sa_next_pn_set(drv->secy_id, channel, an,
+ next_pn);
+ ret += nss_macsec_secy_tx_sak_set(drv->secy_id, channel, an, &tx_sak);
ret += nss_macsec_secy_tx_sc_tci_7_2_set(drv->secy_id, channel,
(tci >> 2));
- ret += nss_macsec_secy_tx_sc_an_set(drv->secy_id, channel, sa->an);
+ ret += nss_macsec_secy_tx_sc_an_set(drv->secy_id, channel, an);
return ret;
}
-static int macsec_qca_enable_transmit_sa(void *priv, struct transmit_sa *sa)
+static int macsec_qca_enable_transmit_sa(void *priv, u32 channel, u8 an)
{
struct macsec_qca_data *drv = priv;
- int ret;
- u32 channel;
+ int ret = 0;
- ret = macsec_qca_lookup_transmit_channel(priv, sa->sc, &channel);
- if (ret != 0)
- return ret;
+ wpa_printf(MSG_DEBUG, "%s: channel=%d, an=%d", __func__, channel, an);
- wpa_printf(MSG_DEBUG, "%s: channel=%d, an=%d", __func__, channel,
- sa->an);
-
- ret += nss_macsec_secy_tx_sa_en_set(drv->secy_id, channel, sa->an,
- TRUE);
+ ret += nss_macsec_secy_tx_sa_en_set(drv->secy_id, channel, an, TRUE);
return ret;
}
-static int macsec_qca_disable_transmit_sa(void *priv, struct transmit_sa *sa)
+static int macsec_qca_disable_transmit_sa(void *priv, u32 channel, u8 an)
{
struct macsec_qca_data *drv = priv;
- int ret;
- u32 channel;
+ int ret = 0;
- ret = macsec_qca_lookup_transmit_channel(priv, sa->sc, &channel);
- if (ret != 0)
- return ret;
+ wpa_printf(MSG_DEBUG, "%s: channel=%d, an=%d", __func__, channel, an);
- wpa_printf(MSG_DEBUG, "%s: channel=%d, an=%d", __func__, channel,
- sa->an);
-
- ret += nss_macsec_secy_tx_sa_en_set(drv->secy_id, channel, sa->an,
- FALSE);
+ ret += nss_macsec_secy_tx_sa_en_set(drv->secy_id, channel, an, FALSE);
return ret;
}
@@ -1019,7 +867,6 @@
.macsec_init = macsec_qca_macsec_init,
.macsec_deinit = macsec_qca_macsec_deinit,
- .macsec_get_capability = macsec_qca_get_capability,
.enable_protect_frames = macsec_qca_enable_protect_frames,
.set_replay_protect = macsec_qca_set_replay_protect,
.set_current_cipher_suite = macsec_qca_set_current_cipher_suite,
@@ -1027,11 +874,13 @@
.get_receive_lowest_pn = macsec_qca_get_receive_lowest_pn,
.get_transmit_next_pn = macsec_qca_get_transmit_next_pn,
.set_transmit_next_pn = macsec_qca_set_transmit_next_pn,
+ .get_available_receive_sc = macsec_qca_get_available_receive_sc,
.create_receive_sc = macsec_qca_create_receive_sc,
.delete_receive_sc = macsec_qca_delete_receive_sc,
.create_receive_sa = macsec_qca_create_receive_sa,
.enable_receive_sa = macsec_qca_enable_receive_sa,
.disable_receive_sa = macsec_qca_disable_receive_sa,
+ .get_available_transmit_sc = macsec_qca_get_available_transmit_sc,
.create_transmit_sc = macsec_qca_create_transmit_sc,
.delete_transmit_sc = macsec_qca_delete_transmit_sc,
.create_transmit_sa = macsec_qca_create_transmit_sa,
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 75c4271..1210d43 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -3095,11 +3095,11 @@
if (params->ie &&
nla_put(msg, NL80211_ATTR_IE, params->ie_len, params->ie))
goto fail;
- 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))
+ 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))
goto fail;
}
if (params->auth_alg & WPA_AUTH_ALG_OPEN)
@@ -3112,8 +3112,6 @@
type = NL80211_AUTHTYPE_FT;
else if (params->auth_alg & WPA_AUTH_ALG_SAE)
type = NL80211_AUTHTYPE_SAE;
- else if (params->auth_alg & WPA_AUTH_ALG_FILS)
- type = NL80211_AUTHTYPE_FILS_SK;
else
goto fail;
wpa_printf(MSG_DEBUG, " * Auth Type %d", type);
@@ -5154,22 +5152,6 @@
if (ret)
goto fail;
- if (params->fils_kek) {
- wpa_printf(MSG_DEBUG, " * FILS KEK (len=%u)",
- (unsigned int) params->fils_kek_len);
- if (nla_put(msg, NL80211_ATTR_FILS_KEK, params->fils_kek_len,
- params->fils_kek))
- goto fail;
- }
- if (params->fils_nonces) {
- wpa_hexdump(MSG_DEBUG, " * FILS nonces (for AAD)",
- params->fils_nonces,
- params->fils_nonces_len);
- if (nla_put(msg, NL80211_ATTR_FILS_NONCES,
- params->fils_nonces_len, params->fils_nonces))
- goto fail;
- }
-
ret = send_and_recv_msgs(drv, msg, NULL, NULL);
msg = NULL;
if (ret) {
@@ -9325,56 +9307,6 @@
return send_and_recv_msgs(drv, msg, NULL, NULL);
}
-
-static int nl80211_set_tdls_mode(void *priv, int tdls_external_control)
-{
- struct i802_bss *bss = priv;
- struct wpa_driver_nl80211_data *drv = bss->drv;
- struct nl_msg *msg;
- struct nlattr *params;
- int ret;
- u32 tdls_mode;
-
- wpa_printf(MSG_DEBUG,
- "nl80211: Set TDKS mode: tdls_external_control=%d",
- tdls_external_control);
-
- if (tdls_external_control == 1)
- tdls_mode = QCA_WLAN_VENDOR_TDLS_TRIGGER_MODE_IMPLICIT |
- QCA_WLAN_VENDOR_TDLS_TRIGGER_MODE_EXTERNAL;
- else
- tdls_mode = QCA_WLAN_VENDOR_TDLS_TRIGGER_MODE_EXPLICIT;
-
- if (!(msg = nl80211_drv_msg(drv, 0, NL80211_CMD_VENDOR)) ||
- nla_put_u32(msg, NL80211_ATTR_VENDOR_ID, OUI_QCA) ||
- nla_put_u32(msg, NL80211_ATTR_VENDOR_SUBCMD,
- QCA_NL80211_VENDOR_SUBCMD_CONFIGURE_TDLS))
- goto fail;
-
- params = nla_nest_start(msg, NL80211_ATTR_VENDOR_DATA);
- if (!params)
- goto fail;
-
- if (nla_put_u32(msg, QCA_WLAN_VENDOR_ATTR_TDLS_CONFIG_TRIGGER_MODE,
- tdls_mode))
- goto fail;
-
- nla_nest_end(msg, params);
-
- ret = send_and_recv_msgs(drv, msg, NULL, NULL);
- msg = NULL;
- if (ret) {
- wpa_printf(MSG_ERROR,
- "nl80211: Set TDLS mode failed: ret=%d (%s)",
- ret, strerror(-ret));
- goto fail;
- }
- return 0;
-fail:
- nlmsg_free(msg);
- return -1;
-}
-
#endif /* CONFIG_DRIVER_NL80211_QCA */
@@ -9618,7 +9550,6 @@
.p2p_lo_start = nl80211_p2p_lo_start,
.p2p_lo_stop = nl80211_p2p_lo_stop,
.set_default_scan_ies = nl80211_set_default_scan_ies,
- .set_tdls_mode = nl80211_set_tdls_mode,
#endif /* CONFIG_DRIVER_NL80211_QCA */
.configure_data_frame_filters = nl80211_configure_data_frame_filters,
.get_ext_capab = nl80211_get_ext_capab,
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
index 2507a43..6adc3f6 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -362,9 +362,6 @@
if (ext_feature_isset(ext_features, len, NL80211_EXT_FEATURE_RRM))
capa->rrm_flags |= WPA_DRIVER_FLAGS_SUPPORT_RRM;
-
- if (ext_feature_isset(ext_features, len, NL80211_EXT_FEATURE_FILS_STA))
- capa->flags |= WPA_DRIVER_FLAGS_SUPPORT_FILS;
}
diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
index c77e21e..762e3ac 100644
--- a/src/drivers/driver_nl80211_event.c
+++ b/src/drivers/driver_nl80211_event.c
@@ -247,8 +247,6 @@
os_memcpy(drv->prev_bssid, mgmt->sa, ETH_ALEN);
os_memset(&event, 0, sizeof(event));
- event.assoc_info.resp_frame = frame;
- event.assoc_info.resp_frame_len = len;
if (len > 24 + sizeof(mgmt->u.assoc_resp)) {
event.assoc_info.resp_ies = (u8 *) mgmt->u.assoc_resp.variable;
event.assoc_info.resp_ies_len =
@@ -518,7 +516,6 @@
data.ch_switch.cf2 = nla_get_u32(cf2);
bss->freq = data.ch_switch.freq;
- drv->assoc_freq = data.ch_switch.freq;
wpa_supplicant_event(bss->ctx, EVENT_CH_SWITCH, &data);
}
diff --git a/src/drivers/driver_privsep.c b/src/drivers/driver_privsep.c
index 5d85033..43d4193 100644
--- a/src/drivers/driver_privsep.c
+++ b/src/drivers/driver_privsep.c
@@ -234,7 +234,7 @@
__func__, priv, params->freq, MAC2STR(params->bssid),
params->auth_alg, params->local_state_change, params->p2p);
- buflen = sizeof(*data) + params->ie_len + params->auth_data_len;
+ buflen = sizeof(*data) + params->ie_len + params->sae_data_len;
data = os_zalloc(buflen);
if (data == NULL)
return -1;
@@ -259,8 +259,8 @@
os_memcpy(pos, params->ie, params->ie_len);
pos += params->ie_len;
}
- if (params->auth_data_len)
- os_memcpy(pos, params->auth_data, params->auth_data_len);
+ if (params->sae_data_len)
+ os_memcpy(pos, params->sae_data, params->sae_data_len);
res = wpa_priv_cmd(drv, PRIVSEP_CMD_AUTHENTICATE, data, buflen,
NULL, NULL);
diff --git a/src/drivers/nl80211_copy.h b/src/drivers/nl80211_copy.h
index a268a00..2206941 100644
--- a/src/drivers/nl80211_copy.h
+++ b/src/drivers/nl80211_copy.h
@@ -48,7 +48,6 @@
#define NL80211_MULTICAST_GROUP_REG "regulatory"
#define NL80211_MULTICAST_GROUP_MLME "mlme"
#define NL80211_MULTICAST_GROUP_VENDOR "vendor"
-#define NL80211_MULTICAST_GROUP_NAN "nan"
#define NL80211_MULTICAST_GROUP_TESTMODE "testmode"
/**
@@ -839,41 +838,6 @@
* not running. The driver indicates the status of the scan through
* cfg80211_scan_done().
*
- * @NL80211_CMD_START_NAN: Start NAN operation, identified by its
- * %NL80211_ATTR_WDEV interface. This interface must have been previously
- * created with %NL80211_CMD_NEW_INTERFACE. After it has been started, the
- * NAN interface will create or join a cluster. This command must have a
- * valid %NL80211_ATTR_NAN_MASTER_PREF attribute and optional
- * %NL80211_ATTR_NAN_DUAL attributes.
- * After this command NAN functions can be added.
- * @NL80211_CMD_STOP_NAN: Stop the NAN operation, identified by
- * its %NL80211_ATTR_WDEV interface.
- * @NL80211_CMD_ADD_NAN_FUNCTION: Add a NAN function. The function is defined
- * with %NL80211_ATTR_NAN_FUNC nested attribute. When called, this
- * operation returns the strictly positive and unique instance id
- * (%NL80211_ATTR_NAN_FUNC_INST_ID) and a cookie (%NL80211_ATTR_COOKIE)
- * of the function upon success.
- * Since instance ID's can be re-used, this cookie is the right
- * way to identify the function. This will avoid races when a termination
- * event is handled by the user space after it has already added a new
- * function that got the same instance id from the kernel as the one
- * which just terminated.
- * This cookie may be used in NAN events even before the command
- * returns, so userspace shouldn't process NAN events until it processes
- * the response to this command.
- * Look at %NL80211_ATTR_SOCKET_OWNER as well.
- * @NL80211_CMD_DEL_NAN_FUNCTION: Delete a NAN function by cookie.
- * This command is also used as a notification sent when a NAN function is
- * terminated. This will contain a %NL80211_ATTR_NAN_FUNC_INST_ID
- * and %NL80211_ATTR_COOKIE attributes.
- * @NL80211_CMD_CHANGE_NAN_CONFIG: Change current NAN configuration. NAN
- * must be operational (%NL80211_CMD_START_NAN was executed).
- * It must contain at least one of the following attributes:
- * %NL80211_ATTR_NAN_MASTER_PREF, %NL80211_ATTR_NAN_DUAL.
- * @NL80211_CMD_NAN_FUNC_MATCH: Notification sent when a match is reported.
- * This will contain a %NL80211_ATTR_NAN_MATCH nested attribute and
- * %NL80211_ATTR_COOKIE.
- *
* @NL80211_CMD_MAX: highest used command number
* @__NL80211_CMD_AFTER_LAST: internal use
*/
@@ -1062,13 +1026,6 @@
NL80211_CMD_ABORT_SCAN,
- NL80211_CMD_START_NAN,
- NL80211_CMD_STOP_NAN,
- NL80211_CMD_ADD_NAN_FUNCTION,
- NL80211_CMD_DEL_NAN_FUNCTION,
- NL80211_CMD_CHANGE_NAN_CONFIG,
- NL80211_CMD_NAN_MATCH,
-
/* add new commands above here */
/* used to define NL80211_CMD_MAX below */
@@ -1386,13 +1343,7 @@
* enum nl80211_band value is used as the index (nla_type() of the nested
* data. If a band is not included, it will be configured to allow all
* rates based on negotiated supported rates information. This attribute
- * is used with %NL80211_CMD_SET_TX_BITRATE_MASK and with starting AP,
- * and joining mesh networks (not IBSS yet). In the later case, it must
- * specify just a single bitrate, which is to be used for the beacon.
- * The driver must also specify support for this with the extended
- * features NL80211_EXT_FEATURE_BEACON_RATE_LEGACY,
- * NL80211_EXT_FEATURE_BEACON_RATE_HT and
- * NL80211_EXT_FEATURE_BEACON_RATE_VHT.
+ * is used with %NL80211_CMD_SET_TX_BITRATE_MASK.
*
* @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain
* at least one byte, currently used with @NL80211_CMD_REGISTER_FRAME.
@@ -1638,16 +1589,8 @@
* the connection request from a station. nl80211_connect_failed_reason
* enum has different reasons of connection failure.
*
- * @NL80211_ATTR_AUTH_DATA: Fields and elements in Authentication frames.
- * This contains the authentication frame body (non-IE and IE data),
- * excluding the Authentication algorithm number, i.e., starting at the
- * Authentication transaction sequence number field. It is used with
- * authentication algorithms that need special fields to be added into
- * the frames (SAE and FILS). Currently, only the SAE cases use the
- * initial two fields (Authentication transaction sequence number and
- * Status code). However, those fields are included in the attribute data
- * for all authentication algorithms to keep the attribute definition
- * consistent.
+ * @NL80211_ATTR_SAE_DATA: SAE elements in Authentication frames. This starts
+ * with the Authentication transaction sequence number field.
*
* @NL80211_ATTR_VHT_CAPABILITY: VHT Capability information element (from
* association request when used with NL80211_CMD_NEW_STATION)
@@ -1790,12 +1733,6 @@
* regulatory indoor configuration would be owned by the netlink socket
* that configured the indoor setting, and the indoor operation would be
* cleared when the socket is closed.
- * If set during NAN interface creation, the interface will be destroyed
- * if the socket is closed just like any other interface. Moreover, only
- * the netlink socket that created the interface will be allowed to add
- * and remove functions. NAN notifications will be sent in unicast to that
- * socket. Without this attribute, any socket can add functions and the
- * notifications will be sent to the %NL80211_MCGRP_NAN multicast group.
*
* @NL80211_ATTR_TDLS_INITIATOR: flag attribute indicating the current end is
* the TDLS link initiator.
@@ -1930,26 +1867,6 @@
* @NL80211_ATTR_MESH_PEER_AID: Association ID for the mesh peer (u16). This is
* used to pull the stored data for mesh peer in power save state.
*
- * @NL80211_ATTR_NAN_MASTER_PREF: the master preference to be used by
- * %NL80211_CMD_START_NAN and optionally with
- * %NL80211_CMD_CHANGE_NAN_CONFIG. Its type is u8 and it can't be 0.
- * Also, values 1 and 255 are reserved for certification purposes and
- * should not be used during a normal device operation.
- * @NL80211_ATTR_NAN_DUAL: NAN dual band operation config (see
- * &enum nl80211_nan_dual_band_conf). This attribute is used with
- * %NL80211_CMD_START_NAN and optionally with
- * %NL80211_CMD_CHANGE_NAN_CONFIG.
- * @NL80211_ATTR_NAN_FUNC: a function that can be added to NAN. See
- * &enum nl80211_nan_func_attributes for description of this nested
- * attribute.
- * @NL80211_ATTR_NAN_MATCH: used to report a match. This is a nested attribute.
- * See &enum nl80211_nan_match_attributes.
- * @NL80211_ATTR_FILS_KEK: KEK for FILS (Re)Association Request/Response frame
- * protection.
- * @NL80211_ATTR_FILS_NONCES: Nonces (part of AAD) for FILS (Re)Association
- * Request/Response frame protection. This attribute contains the 16 octet
- * STA Nonce followed by 16 octets of AP Nonce.
- *
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
@@ -2208,7 +2125,7 @@
NL80211_ATTR_CONN_FAILED_REASON,
- NL80211_ATTR_AUTH_DATA,
+ NL80211_ATTR_SAE_DATA,
NL80211_ATTR_VHT_CAPABILITY,
@@ -2344,14 +2261,6 @@
NL80211_ATTR_MESH_PEER_AID,
- NL80211_ATTR_NAN_MASTER_PREF,
- NL80211_ATTR_NAN_DUAL,
- NL80211_ATTR_NAN_FUNC,
- NL80211_ATTR_NAN_MATCH,
-
- NL80211_ATTR_FILS_KEK,
- NL80211_ATTR_FILS_NONCES,
-
/* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST,
@@ -2363,7 +2272,6 @@
#define NL80211_ATTR_SCAN_GENERATION NL80211_ATTR_GENERATION
#define NL80211_ATTR_MESH_PARAMS NL80211_ATTR_MESH_CONFIG
#define NL80211_ATTR_IFACE_SOCKET_OWNER NL80211_ATTR_SOCKET_OWNER
-#define NL80211_ATTR_SAE_DATA NL80211_ATTR_AUTH_DATA
/*
* Allow user space programs to use #ifdef on new attributes by defining them
@@ -2431,7 +2339,6 @@
* commands to create and destroy one
* @NL80211_IF_TYPE_OCB: Outside Context of a BSS
* This mode corresponds to the MIB variable dot11OCBActivated=true
- * @NL80211_IFTYPE_NAN: NAN device interface type (not a netdev)
* @NL80211_IFTYPE_MAX: highest interface type number currently defined
* @NUM_NL80211_IFTYPES: number of defined interface types
*
@@ -2452,7 +2359,6 @@
NL80211_IFTYPE_P2P_GO,
NL80211_IFTYPE_P2P_DEVICE,
NL80211_IFTYPE_OCB,
- NL80211_IFTYPE_NAN,
/* keep last */
NUM_NL80211_IFTYPES,
@@ -3677,9 +3583,6 @@
* @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r)
* @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP)
* @NL80211_AUTHTYPE_SAE: Simultaneous authentication of equals
- * @NL80211_AUTHTYPE_FILS_SK: Fast Initial Link Setup shared key
- * @NL80211_AUTHTYPE_FILS_SK_PFS: Fast Initial Link Setup shared key with PFS
- * @NL80211_AUTHTYPE_FILS_PK: Fast Initial Link Setup public key
* @__NL80211_AUTHTYPE_NUM: internal
* @NL80211_AUTHTYPE_MAX: maximum valid auth algorithm
* @NL80211_AUTHTYPE_AUTOMATIC: determine automatically (if necessary by
@@ -3692,9 +3595,6 @@
NL80211_AUTHTYPE_FT,
NL80211_AUTHTYPE_NETWORK_EAP,
NL80211_AUTHTYPE_SAE,
- NL80211_AUTHTYPE_FILS_SK,
- NL80211_AUTHTYPE_FILS_SK_PFS,
- NL80211_AUTHTYPE_FILS_PK,
/* keep last */
__NL80211_AUTHTYPE_NUM,
@@ -4303,9 +4203,6 @@
* of supported channel widths for radar detection.
* @NL80211_IFACE_COMB_RADAR_DETECT_REGIONS: u32 attribute containing the bitmap
* of supported regulatory regions for radar detection.
- * @NL80211_IFACE_COMB_BI_MIN_GCD: u32 attribute specifying the minimum GCD of
- * different beacon intervals supported by all the interface combinations
- * in this group (if not present, all beacon intervals be identical).
* @NUM_NL80211_IFACE_COMB: number of attributes
* @MAX_NL80211_IFACE_COMB: highest attribute number
*
@@ -4313,8 +4210,8 @@
* limits = [ #{STA} <= 1, #{AP} <= 1 ], matching BI, channels = 1, max = 2
* => allows an AP and a STA that must match BIs
*
- * numbers = [ #{AP, P2P-GO} <= 8 ], BI min gcd, channels = 1, max = 8,
- * => allows 8 of AP/GO that can have BI gcd >= min gcd
+ * numbers = [ #{AP, P2P-GO} <= 8 ], channels = 1, max = 8
+ * => allows 8 of AP/GO
*
* numbers = [ #{STA} <= 2 ], channels = 2, max = 2
* => allows two STAs on different channels
@@ -4340,7 +4237,6 @@
NL80211_IFACE_COMB_NUM_CHANNELS,
NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS,
NL80211_IFACE_COMB_RADAR_DETECT_REGIONS,
- NL80211_IFACE_COMB_BI_MIN_GCD,
/* keep last */
NUM_NL80211_IFACE_COMB,
@@ -4655,14 +4551,6 @@
* (if available).
* @NL80211_EXT_FEATURE_SET_SCAN_DWELL: This driver supports configuration of
* channel dwell time.
- * @NL80211_EXT_FEATURE_BEACON_RATE_LEGACY: Driver supports beacon rate
- * configuration (AP/mesh), supporting a legacy (non HT/VHT) rate.
- * @NL80211_EXT_FEATURE_BEACON_RATE_HT: Driver supports beacon rate
- * configuration (AP/mesh) with HT rates.
- * @NL80211_EXT_FEATURE_BEACON_RATE_VHT: Driver supports beacon rate
- * configuration (AP/mesh) with VHT rates.
- * @NL80211_EXT_FEATURE_FILS_STA: This driver supports Fast Initial Link Setup
- * with user space SME (NL80211_CMD_AUTHENTICATE) in station mode.
*
* @NUM_NL80211_EXT_FEATURES: number of extended features.
* @MAX_NL80211_EXT_FEATURES: highest extended feature index.
@@ -4674,10 +4562,6 @@
NL80211_EXT_FEATURE_SCAN_START_TIME,
NL80211_EXT_FEATURE_BSS_PARENT_TSF,
NL80211_EXT_FEATURE_SET_SCAN_DWELL,
- NL80211_EXT_FEATURE_BEACON_RATE_LEGACY,
- NL80211_EXT_FEATURE_BEACON_RATE_HT,
- NL80211_EXT_FEATURE_BEACON_RATE_VHT,
- NL80211_EXT_FEATURE_FILS_STA,
/* add new features before the definition below */
NUM_NL80211_EXT_FEATURES,
@@ -4971,186 +4855,4 @@
NL80211_BSS_SELECT_ATTR_MAX = __NL80211_BSS_SELECT_ATTR_AFTER_LAST - 1
};
-/**
- * enum nl80211_nan_dual_band_conf - NAN dual band configuration
- *
- * Defines the NAN dual band mode of operation
- *
- * @NL80211_NAN_BAND_DEFAULT: device default mode
- * @NL80211_NAN_BAND_2GHZ: 2.4GHz mode
- * @NL80211_NAN_BAND_5GHZ: 5GHz mode
- */
-enum nl80211_nan_dual_band_conf {
- NL80211_NAN_BAND_DEFAULT = 1 << 0,
- NL80211_NAN_BAND_2GHZ = 1 << 1,
- NL80211_NAN_BAND_5GHZ = 1 << 2,
-};
-
-/**
- * enum nl80211_nan_function_type - NAN function type
- *
- * Defines the function type of a NAN function
- *
- * @NL80211_NAN_FUNC_PUBLISH: function is publish
- * @NL80211_NAN_FUNC_SUBSCRIBE: function is subscribe
- * @NL80211_NAN_FUNC_FOLLOW_UP: function is follow-up
- */
-enum nl80211_nan_function_type {
- NL80211_NAN_FUNC_PUBLISH,
- NL80211_NAN_FUNC_SUBSCRIBE,
- NL80211_NAN_FUNC_FOLLOW_UP,
-
- /* keep last */
- __NL80211_NAN_FUNC_TYPE_AFTER_LAST,
- NL80211_NAN_FUNC_MAX_TYPE = __NL80211_NAN_FUNC_TYPE_AFTER_LAST - 1,
-};
-
-/**
- * enum nl80211_nan_publish_type - NAN publish tx type
- *
- * Defines how to send publish Service Discovery Frames
- *
- * @NL80211_NAN_SOLICITED_PUBLISH: publish function is solicited
- * @NL80211_NAN_UNSOLICITED_PUBLISH: publish function is unsolicited
- */
-enum nl80211_nan_publish_type {
- NL80211_NAN_SOLICITED_PUBLISH = 1 << 0,
- NL80211_NAN_UNSOLICITED_PUBLISH = 1 << 1,
-};
-
-/**
- * enum nl80211_nan_func_term_reason - NAN functions termination reason
- *
- * Defines termination reasons of a NAN function
- *
- * @NL80211_NAN_FUNC_TERM_REASON_USER_REQUEST: requested by user
- * @NL80211_NAN_FUNC_TERM_REASON_TTL_EXPIRED: timeout
- * @NL80211_NAN_FUNC_TERM_REASON_ERROR: errored
- */
-enum nl80211_nan_func_term_reason {
- NL80211_NAN_FUNC_TERM_REASON_USER_REQUEST,
- NL80211_NAN_FUNC_TERM_REASON_TTL_EXPIRED,
- NL80211_NAN_FUNC_TERM_REASON_ERROR,
-};
-
-#define NL80211_NAN_FUNC_SERVICE_ID_LEN 6
-#define NL80211_NAN_FUNC_SERVICE_SPEC_INFO_MAX_LEN 0xff
-#define NL80211_NAN_FUNC_SRF_MAX_LEN 0xff
-
-/**
- * enum nl80211_nan_func_attributes - NAN function attributes
- * @__NL80211_NAN_FUNC_INVALID: invalid
- * @NL80211_NAN_FUNC_TYPE: &enum nl80211_nan_function_type (u8).
- * @NL80211_NAN_FUNC_SERVICE_ID: 6 bytes of the service ID hash as
- * specified in NAN spec. This is a binary attribute.
- * @NL80211_NAN_FUNC_PUBLISH_TYPE: relevant if the function's type is
- * publish. Defines the transmission type for the publish Service Discovery
- * Frame, see &enum nl80211_nan_publish_type. Its type is u8.
- * @NL80211_NAN_FUNC_PUBLISH_BCAST: relevant if the function is a solicited
- * publish. Should the solicited publish Service Discovery Frame be sent to
- * the NAN Broadcast address. This is a flag.
- * @NL80211_NAN_FUNC_SUBSCRIBE_ACTIVE: relevant if the function's type is
- * subscribe. Is the subscribe active. This is a flag.
- * @NL80211_NAN_FUNC_FOLLOW_UP_ID: relevant if the function's type is follow up.
- * The instance ID for the follow up Service Discovery Frame. This is u8.
- * @NL80211_NAN_FUNC_FOLLOW_UP_REQ_ID: relevant if the function's type
- * is follow up. This is a u8.
- * The requestor instance ID for the follow up Service Discovery Frame.
- * @NL80211_NAN_FUNC_FOLLOW_UP_DEST: the MAC address of the recipient of the
- * follow up Service Discovery Frame. This is a binary attribute.
- * @NL80211_NAN_FUNC_CLOSE_RANGE: is this function limited for devices in a
- * close range. The range itself (RSSI) is defined by the device.
- * This is a flag.
- * @NL80211_NAN_FUNC_TTL: strictly positive number of DWs this function should
- * stay active. If not present infinite TTL is assumed. This is a u32.
- * @NL80211_NAN_FUNC_SERVICE_INFO: array of bytes describing the service
- * specific info. This is a binary attribute.
- * @NL80211_NAN_FUNC_SRF: Service Receive Filter. This is a nested attribute.
- * See &enum nl80211_nan_srf_attributes.
- * @NL80211_NAN_FUNC_RX_MATCH_FILTER: Receive Matching filter. This is a nested
- * attribute. It is a list of binary values.
- * @NL80211_NAN_FUNC_TX_MATCH_FILTER: Transmit Matching filter. This is a
- * nested attribute. It is a list of binary values.
- * @NL80211_NAN_FUNC_INSTANCE_ID: The instance ID of the function.
- * Its type is u8 and it cannot be 0.
- * @NL80211_NAN_FUNC_TERM_REASON: NAN function termination reason.
- * See &enum nl80211_nan_func_term_reason.
- *
- * @NUM_NL80211_NAN_FUNC_ATTR: internal
- * @NL80211_NAN_FUNC_ATTR_MAX: highest NAN function attribute
- */
-enum nl80211_nan_func_attributes {
- __NL80211_NAN_FUNC_INVALID,
- NL80211_NAN_FUNC_TYPE,
- NL80211_NAN_FUNC_SERVICE_ID,
- NL80211_NAN_FUNC_PUBLISH_TYPE,
- NL80211_NAN_FUNC_PUBLISH_BCAST,
- NL80211_NAN_FUNC_SUBSCRIBE_ACTIVE,
- NL80211_NAN_FUNC_FOLLOW_UP_ID,
- NL80211_NAN_FUNC_FOLLOW_UP_REQ_ID,
- NL80211_NAN_FUNC_FOLLOW_UP_DEST,
- NL80211_NAN_FUNC_CLOSE_RANGE,
- NL80211_NAN_FUNC_TTL,
- NL80211_NAN_FUNC_SERVICE_INFO,
- NL80211_NAN_FUNC_SRF,
- NL80211_NAN_FUNC_RX_MATCH_FILTER,
- NL80211_NAN_FUNC_TX_MATCH_FILTER,
- NL80211_NAN_FUNC_INSTANCE_ID,
- NL80211_NAN_FUNC_TERM_REASON,
-
- /* keep last */
- NUM_NL80211_NAN_FUNC_ATTR,
- NL80211_NAN_FUNC_ATTR_MAX = NUM_NL80211_NAN_FUNC_ATTR - 1
-};
-
-/**
- * enum nl80211_nan_srf_attributes - NAN Service Response filter attributes
- * @__NL80211_NAN_SRF_INVALID: invalid
- * @NL80211_NAN_SRF_INCLUDE: present if the include bit of the SRF set.
- * This is a flag.
- * @NL80211_NAN_SRF_BF: Bloom Filter. Present if and only if
- * &NL80211_NAN_SRF_MAC_ADDRS isn't present. This attribute is binary.
- * @NL80211_NAN_SRF_BF_IDX: index of the Bloom Filter. Mandatory if
- * &NL80211_NAN_SRF_BF is present. This is a u8.
- * @NL80211_NAN_SRF_MAC_ADDRS: list of MAC addresses for the SRF. Present if
- * and only if &NL80211_NAN_SRF_BF isn't present. This is a nested
- * attribute. Each nested attribute is a MAC address.
- * @NUM_NL80211_NAN_SRF_ATTR: internal
- * @NL80211_NAN_SRF_ATTR_MAX: highest NAN SRF attribute
- */
-enum nl80211_nan_srf_attributes {
- __NL80211_NAN_SRF_INVALID,
- NL80211_NAN_SRF_INCLUDE,
- NL80211_NAN_SRF_BF,
- NL80211_NAN_SRF_BF_IDX,
- NL80211_NAN_SRF_MAC_ADDRS,
-
- /* keep last */
- NUM_NL80211_NAN_SRF_ATTR,
- NL80211_NAN_SRF_ATTR_MAX = NUM_NL80211_NAN_SRF_ATTR - 1,
-};
-
-/**
- * enum nl80211_nan_match_attributes - NAN match attributes
- * @__NL80211_NAN_MATCH_INVALID: invalid
- * @NL80211_NAN_MATCH_FUNC_LOCAL: the local function that had the
- * match. This is a nested attribute.
- * See &enum nl80211_nan_func_attributes.
- * @NL80211_NAN_MATCH_FUNC_PEER: the peer function
- * that caused the match. This is a nested attribute.
- * See &enum nl80211_nan_func_attributes.
- *
- * @NUM_NL80211_NAN_MATCH_ATTR: internal
- * @NL80211_NAN_MATCH_ATTR_MAX: highest NAN match attribute
- */
-enum nl80211_nan_match_attributes {
- __NL80211_NAN_MATCH_INVALID,
- NL80211_NAN_MATCH_FUNC_LOCAL,
- NL80211_NAN_MATCH_FUNC_PEER,
-
- /* keep last */
- NUM_NL80211_NAN_MATCH_ATTR,
- NL80211_NAN_MATCH_ATTR_MAX = NUM_NL80211_NAN_MATCH_ATTR - 1
-};
-
#endif /* __LINUX_NL80211_H */
diff --git a/src/eap_peer/eap.c b/src/eap_peer/eap.c
index 1c6116a..9110ca5 100644
--- a/src/eap_peer/eap.c
+++ b/src/eap_peer/eap.c
@@ -571,7 +571,8 @@
#ifdef CONFIG_ERP
-struct wpabuf * eap_peer_build_erp_reauth_start(struct eap_sm *sm, u8 eap_id)
+static int eap_peer_erp_reauth_start(struct eap_sm *sm,
+ const struct eap_hdr *hdr, size_t len)
{
char *realm;
struct eap_erp_key *erp;
@@ -580,16 +581,16 @@
realm = eap_home_realm(sm);
if (!realm)
- return NULL;
+ return -1;
erp = eap_erp_get_key(sm, realm);
os_free(realm);
realm = NULL;
if (!erp)
- return NULL;
+ return -1;
if (erp->next_seq >= 65536)
- return NULL; /* SEQ has range of 0..65535 */
+ return -1; /* SEQ has range of 0..65535 */
/* TODO: check rRK lifetime expiration */
@@ -598,9 +599,9 @@
msg = eap_msg_alloc(EAP_VENDOR_IETF, (EapType) EAP_ERP_TYPE_REAUTH,
1 + 2 + 2 + os_strlen(erp->keyname_nai) + 1 + 16,
- EAP_CODE_INITIATE, eap_id);
+ EAP_CODE_INITIATE, hdr->identifier);
if (msg == NULL)
- return NULL;
+ return -1;
wpabuf_put_u8(msg, 0x20); /* Flags: R=0 B=0 L=1 */
wpabuf_put_be16(msg, erp->next_seq);
@@ -614,28 +615,13 @@
if (hmac_sha256(erp->rIK, erp->rIK_len,
wpabuf_head(msg), wpabuf_len(msg), hash) < 0) {
wpabuf_free(msg);
- return NULL;
+ return -1;
}
wpabuf_put_data(msg, hash, 16);
+ wpa_printf(MSG_DEBUG, "EAP: Sending EAP-Initiate/Re-auth");
sm->erp_seq = erp->next_seq;
erp->next_seq++;
-
- wpa_hexdump_buf(MSG_DEBUG, "ERP: EAP-Initiate/Re-auth", msg);
-
- return msg;
-}
-
-
-static int eap_peer_erp_reauth_start(struct eap_sm *sm, u8 eap_id)
-{
- struct wpabuf *msg;
-
- msg = eap_peer_build_erp_reauth_start(sm, eap_id);
- if (!msg)
- return -1;
-
- wpa_printf(MSG_DEBUG, "EAP: Sending EAP-Initiate/Re-auth");
wpabuf_free(sm->eapRespData);
sm->eapRespData = msg;
sm->reauthInit = TRUE;
@@ -1580,7 +1566,7 @@
/* TODO: Derivation of domain specific keys for local ER */
}
- if (eap_peer_erp_reauth_start(sm, hdr->identifier) == 0)
+ if (eap_peer_erp_reauth_start(sm, hdr, len) == 0)
return;
invalid:
@@ -1591,7 +1577,8 @@
}
-void eap_peer_finish(struct eap_sm *sm, const struct eap_hdr *hdr, size_t len)
+static void eap_peer_finish(struct eap_sm *sm, const struct eap_hdr *hdr,
+ size_t len)
{
#ifdef CONFIG_ERP
const u8 *pos = (const u8 *) (hdr + 1);
diff --git a/src/eap_peer/eap.h b/src/eap_peer/eap.h
index 7b013ee..1a645af 100644
--- a/src/eap_peer/eap.h
+++ b/src/eap_peer/eap.h
@@ -348,8 +348,6 @@
void eap_set_anon_id(struct eap_sm *sm, const u8 *id, size_t len);
int eap_peer_was_failure_expected(struct eap_sm *sm);
void eap_peer_erp_free_keys(struct eap_sm *sm);
-struct wpabuf * eap_peer_build_erp_reauth_start(struct eap_sm *sm, u8 eap_id);
-void eap_peer_finish(struct eap_sm *sm, const struct eap_hdr *hdr, size_t len);
#endif /* IEEE8021X_EAPOL */
diff --git a/src/eap_peer/eap_pwd.c b/src/eap_peer/eap_pwd.c
index 662347b..d2bc981 100644
--- a/src/eap_peer/eap_pwd.c
+++ b/src/eap_peer/eap_pwd.c
@@ -345,7 +345,7 @@
wpabuf_put_u8(data->outbuf, EAP_PWD_DEFAULT_RAND_FUNC);
wpabuf_put_u8(data->outbuf, EAP_PWD_DEFAULT_PRF);
wpabuf_put_data(data->outbuf, id->token, sizeof(id->token));
- wpabuf_put_u8(data->outbuf, id->prep);
+ wpabuf_put_u8(data->outbuf, EAP_PWD_PREP_NONE);
wpabuf_put_data(data->outbuf, data->id_peer, data->id_peer_len);
eap_pwd_state(data, PWD_Commit_Req);
diff --git a/src/eap_server/eap.h b/src/eap_server/eap.h
index 93eab62..69eaab8 100644
--- a/src/eap_server/eap.h
+++ b/src/eap_server/eap.h
@@ -153,6 +153,5 @@
void eap_server_mschap_rx_callback(struct eap_sm *sm, const char *source,
const u8 *username, size_t username_len,
const u8 *challenge, const u8 *response);
-void eap_erp_update_identity(struct eap_sm *sm, const u8 *eap, size_t len);
#endif /* EAP_H */
diff --git a/src/eap_server/eap_server.c b/src/eap_server/eap_server.c
index 08cc171..84ecafc 100644
--- a/src/eap_server/eap_server.c
+++ b/src/eap_server/eap_server.c
@@ -1968,44 +1968,6 @@
}
-void eap_erp_update_identity(struct eap_sm *sm, const u8 *eap, size_t len)
-{
-#ifdef CONFIG_ERP
- const struct eap_hdr *hdr;
- const u8 *pos, *end;
- struct erp_tlvs parse;
-
- if (len < sizeof(*hdr) + 1)
- return;
- hdr = (const struct eap_hdr *) eap;
- end = eap + len;
- pos = (const u8 *) (hdr + 1);
- if (hdr->code != EAP_CODE_INITIATE || *pos != EAP_ERP_TYPE_REAUTH)
- return;
- pos++;
- if (pos + 3 > end)
- return;
-
- /* Skip Flags and SEQ */
- pos += 3;
-
- if (erp_parse_tlvs(pos, end, &parse, 1) < 0 || !parse.keyname)
- return;
- wpa_hexdump_ascii(MSG_DEBUG,
- "EAP: Update identity based on EAP-Initiate/Re-auth keyName-NAI",
- parse.keyname, parse.keyname_len);
- os_free(sm->identity);
- sm->identity = os_malloc(parse.keyname_len);
- if (sm->identity) {
- os_memcpy(sm->identity, parse.keyname, parse.keyname_len);
- sm->identity_len = parse.keyname_len;
- } else {
- sm->identity_len = 0;
- }
-#endif /* CONFIG_ERP */
-}
-
-
/**
* eap_get_interface - Get pointer to EAP-EAPOL interface data
* @sm: Pointer to EAP state machine allocated with eap_server_sm_init()
diff --git a/src/eap_server/eap_server_pwd.c b/src/eap_server/eap_server_pwd.c
index c60539f..64bf708 100644
--- a/src/eap_server/eap_server_pwd.c
+++ b/src/eap_server/eap_server_pwd.c
@@ -602,9 +602,7 @@
if ((data->group_num != be_to_host16(id->group_num)) ||
(id->random_function != EAP_PWD_DEFAULT_RAND_FUNC) ||
(os_memcmp(id->token, (u8 *)&data->token, sizeof(data->token))) ||
- (id->prf != EAP_PWD_DEFAULT_PRF) ||
- id->prep !=
- data->password_hash ? EAP_PWD_PREP_MS : EAP_PWD_PREP_NONE) {
+ (id->prf != EAP_PWD_DEFAULT_PRF)) {
wpa_printf(MSG_INFO, "EAP-pwd: peer changed parameters");
eap_pwd_state(data, FAILURE);
return;
diff --git a/src/eapol_supp/eapol_supp_sm.c b/src/eapol_supp/eapol_supp_sm.c
index 7fdb277..65460fc 100644
--- a/src/eapol_supp/eapol_supp_sm.c
+++ b/src/eapol_supp/eapol_supp_sm.c
@@ -2158,26 +2158,3 @@
if (sm)
eap_peer_erp_free_keys(sm->eap);
}
-
-
-struct wpabuf * eapol_sm_build_erp_reauth_start(struct eapol_sm *sm)
-{
-#ifdef CONFIG_ERP
- if (!sm)
- return NULL;
- return eap_peer_build_erp_reauth_start(sm->eap, 0);
-#else /* CONFIG_ERP */
- return NULL;
-#endif /* CONFIG_ERP */
-}
-
-
-void eapol_sm_process_erp_finish(struct eapol_sm *sm, const u8 *buf,
- size_t len)
-{
-#ifdef CONFIG_ERP
- if (!sm)
- return;
- eap_peer_finish(sm->eap, (const struct eap_hdr *) buf, len);
-#endif /* CONFIG_ERP */
-}
diff --git a/src/eapol_supp/eapol_supp_sm.h b/src/eapol_supp/eapol_supp_sm.h
index b48cab2..1309ff7 100644
--- a/src/eapol_supp/eapol_supp_sm.h
+++ b/src/eapol_supp/eapol_supp_sm.h
@@ -328,9 +328,6 @@
struct ext_password_data *ext);
int eapol_sm_failed(struct eapol_sm *sm);
void eapol_sm_erp_flush(struct eapol_sm *sm);
-struct wpabuf * eapol_sm_build_erp_reauth_start(struct eapol_sm *sm);
-void eapol_sm_process_erp_finish(struct eapol_sm *sm, const u8 *buf,
- size_t len);
int eapol_sm_get_eap_proxy_imsi(struct eapol_sm *sm, char *imsi, size_t *len);
#else /* IEEE8021X_EAPOL */
static inline struct eapol_sm *eapol_sm_init(struct eapol_ctx *ctx)
@@ -441,15 +438,6 @@
static inline void eapol_sm_erp_flush(struct eapol_sm *sm)
{
}
-static inline struct wpabuf *
-eapol_sm_build_erp_reauth_start(struct eapol_sm *sm)
-{
- return NULL;
-}
-static inline void eapol_sm_process_erp_finish(struct eapol_sm *sm,
- const u8 *buf, size_t len)
-{
-}
#endif /* IEEE8021X_EAPOL */
#endif /* EAPOL_SUPP_SM_H */
diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
index cd2fba3..996b4e8 100644
--- a/src/p2p/p2p.c
+++ b/src/p2p/p2p.c
@@ -2822,7 +2822,6 @@
}
p2p->p2ps_adv_list = NULL;
- p2ps_prov_free(p2p);
p2p_dbg(p2p, "All ASP advertisements flushed");
}
@@ -3023,8 +3022,6 @@
os_free(p2p->after_scan_tx);
p2p->after_scan_tx = NULL;
p2p->ssid_set = 0;
- p2ps_prov_free(p2p);
- p2p_reset_pending_pd(p2p);
}
diff --git a/src/p2p/p2p.h b/src/p2p/p2p.h
index 7b18dcf..5b5a0bf 100644
--- a/src/p2p/p2p.h
+++ b/src/p2p/p2p.h
@@ -2285,7 +2285,7 @@
* discovery (p2p_find). A random number of 100 TU units is picked for each
* Listen state iteration from [min_disc_int,max_disc_int] range.
*
- * max_disc_tu can be used to further limit the discoverable duration. However,
+ * max_disc_tu can be used to futher limit the discoverable duration. However,
* it should be noted that use of this parameter is not recommended since it
* would not be compliant with the P2P specification.
*/
diff --git a/src/p2p/p2p_pd.c b/src/p2p/p2p_pd.c
index 3994ec0..93a0535 100644
--- a/src/p2p/p2p_pd.c
+++ b/src/p2p/p2p_pd.c
@@ -1163,9 +1163,6 @@
msg.group_id, msg.group_id_len);
}
- if (reject != P2P_SC_FAIL_INFO_CURRENTLY_UNAVAILABLE)
- p2ps_prov_free(p2p);
-
if (reject == P2P_SC_SUCCESS) {
switch (config_methods) {
case WPS_CONFIG_DISPLAY:
@@ -1584,7 +1581,7 @@
report_config_methods);
if (p2p->state == P2P_PD_DURING_FIND) {
- p2p_stop_listen_for_freq(p2p, 0);
+ p2p_clear_timeout(p2p);
p2p_continue_find(p2p);
}
}
diff --git a/src/pae/ieee802_1x_kay.c b/src/pae/ieee802_1x_kay.c
index 63bbd13..a8e7efc 100644
--- a/src/pae/ieee802_1x_kay.c
+++ b/src/pae/ieee802_1x_kay.c
@@ -411,8 +411,6 @@
}
-static void ieee802_1x_kay_use_data_key(struct data_key *pkey);
-
/**
* ieee802_1x_kay_init_receive_sa -
*/
@@ -431,7 +429,6 @@
return NULL;
}
- ieee802_1x_kay_use_data_key(key);
psa->pkey = key;
psa->lowest_pn = lowest_pn;
psa->next_pn = lowest_pn;
@@ -443,21 +440,18 @@
dl_list_add(&psc->sa_list, &psa->list);
wpa_printf(MSG_DEBUG,
- "KaY: Create receive SA(AN: %hhu lowest_pn: %u of SC",
- an, lowest_pn);
+ "KaY: Create receive SA(AN: %hhu lowest_pn: %u of SC(channel: %d)",
+ an, lowest_pn, psc->channel);
return psa;
}
-static void ieee802_1x_kay_deinit_data_key(struct data_key *pkey);
-
/**
* ieee802_1x_kay_deinit_receive_sa -
*/
static void ieee802_1x_kay_deinit_receive_sa(struct receive_sa *psa)
{
- ieee802_1x_kay_deinit_data_key(psa->pkey);
psa->pkey = NULL;
wpa_printf(MSG_DEBUG,
"KaY: Delete receive SA(an: %hhu) of SC",
@@ -471,7 +465,8 @@
* ieee802_1x_kay_init_receive_sc -
*/
static struct receive_sc *
-ieee802_1x_kay_init_receive_sc(const struct ieee802_1x_mka_sci *psci)
+ieee802_1x_kay_init_receive_sc(const struct ieee802_1x_mka_sci *psci,
+ int channel)
{
struct receive_sc *psc;
@@ -485,27 +480,19 @@
}
os_memcpy(&psc->sci, psci, sizeof(psc->sci));
+ psc->channel = channel;
os_get_time(&psc->created_time);
psc->receiving = FALSE;
dl_list_init(&psc->sa_list);
- wpa_printf(MSG_DEBUG, "KaY: Create receive SC");
+ wpa_printf(MSG_DEBUG, "KaY: Create receive SC(channel: %d)", channel);
wpa_hexdump(MSG_DEBUG, "SCI: ", (u8 *)psci, sizeof(*psci));
return psc;
}
-static void ieee802_1x_delete_receive_sa(struct ieee802_1x_kay *kay,
- struct receive_sa *sa)
-{
- secy_disable_receive_sa(kay, sa);
- secy_delete_receive_sa(kay, sa);
- ieee802_1x_kay_deinit_receive_sa(sa);
-}
-
-
/**
* ieee802_1x_kay_deinit_receive_sc -
**/
@@ -515,11 +502,13 @@
{
struct receive_sa *psa, *pre_sa;
- wpa_printf(MSG_DEBUG, "KaY: Delete receive SC");
+ wpa_printf(MSG_DEBUG, "KaY: Delete receive SC(channel: %d)",
+ psc->channel);
dl_list_for_each_safe(psa, pre_sa, &psc->sa_list, struct receive_sa,
- list)
- ieee802_1x_delete_receive_sa(participant->kay, psa);
-
+ list) {
+ secy_disable_receive_sa(participant->kay, psa);
+ ieee802_1x_kay_deinit_receive_sa(psa);
+ }
dl_list_del(&psc->list);
os_free(psc);
}
@@ -563,6 +552,7 @@
{
struct ieee802_1x_kay_peer *peer;
struct receive_sc *rxsc;
+ u32 sc_ch = 0;
peer = ieee802_1x_kay_create_peer(mi, mn);
if (!peer)
@@ -571,7 +561,9 @@
os_memcpy(&peer->sci, &participant->current_peer_sci,
sizeof(peer->sci));
- rxsc = ieee802_1x_kay_init_receive_sc(&peer->sci);
+ secy_get_available_receive_sc(participant->kay, &sc_ch);
+
+ rxsc = ieee802_1x_kay_init_receive_sc(&peer->sci, sc_ch);
if (!rxsc) {
os_free(peer);
return NULL;
@@ -619,10 +611,12 @@
{
struct ieee802_1x_kay_peer *peer;
struct receive_sc *rxsc;
+ u32 sc_ch = 0;
peer = ieee802_1x_kay_get_potential_peer(participant, mi);
- rxsc = ieee802_1x_kay_init_receive_sc(&participant->current_peer_sci);
+ rxsc = ieee802_1x_kay_init_receive_sc(&participant->current_peer_sci,
+ sc_ch);
if (!rxsc)
return NULL;
@@ -637,6 +631,8 @@
dl_list_del(&peer->list);
dl_list_add_tail(&participant->live_peers, &peer->list);
+ secy_get_available_receive_sc(participant->kay, &sc_ch);
+
dl_list_add(&participant->rxsc_list, &rxsc->list);
secy_create_receive_sc(participant->kay, rxsc);
@@ -1618,7 +1614,6 @@
sa_key->an = body->dan;
ieee802_1x_kay_init_data_key(sa_key);
- ieee802_1x_kay_use_data_key(sa_key);
dl_list_add(&participant->sak_list, &sa_key->list);
ieee802_1x_cp_set_ciphersuite(kay->cp, cs->id);
@@ -1880,17 +1875,7 @@
/**
- * ieee802_1x_kay_use_data_key - Take reference on a key
- */
-static void ieee802_1x_kay_use_data_key(struct data_key *pkey)
-{
- pkey->user++;
-}
-
-
-/**
- * ieee802_1x_kay_deinit_data_key - Release reference on a key and
- * free if there are no remaining users
+ * ieee802_1x_kay_deinit_data_key -
*/
static void ieee802_1x_kay_deinit_data_key(struct data_key *pkey)
{
@@ -1901,6 +1886,7 @@
if (pkey->user > 1)
return;
+ dl_list_del(&pkey->list);
os_free(pkey->key);
os_free(pkey);
}
@@ -2010,9 +1996,7 @@
participant->new_key = sa_key;
- ieee802_1x_kay_use_data_key(sa_key);
dl_list_add(&participant->sak_list, &sa_key->list);
-
ieee802_1x_cp_set_ciphersuite(kay->cp, cs->id);
ieee802_1x_cp_sm_step(kay->cp);
ieee802_1x_cp_set_offset(kay->cp, kay->macsec_confidentiality);
@@ -2296,16 +2280,6 @@
static void ieee802_1x_kay_deinit_transmit_sa(struct transmit_sa *psa);
-
-static void ieee802_1x_delete_transmit_sa(struct ieee802_1x_kay *kay,
- struct transmit_sa *sa)
-{
- secy_disable_transmit_sa(kay, sa);
- secy_delete_transmit_sa(kay, sa);
- ieee802_1x_kay_deinit_transmit_sa(sa);
-}
-
-
/**
* ieee802_1x_participant_timer -
*/
@@ -2380,7 +2354,8 @@
dl_list_for_each_safe(txsa, pre_txsa,
&participant->txsc->sa_list,
struct transmit_sa, list) {
- ieee802_1x_delete_transmit_sa(kay, txsa);
+ secy_disable_transmit_sa(kay, txsa);
+ ieee802_1x_kay_deinit_transmit_sa(txsa);
}
ieee802_1x_cp_connect_authenticated(kay->cp);
@@ -2454,7 +2429,6 @@
psa->confidentiality = FALSE;
psa->an = an;
- ieee802_1x_kay_use_data_key(key);
psa->pkey = key;
psa->next_pn = next_PN;
psa->sc = psc;
@@ -2464,8 +2438,8 @@
dl_list_add(&psc->sa_list, &psa->list);
wpa_printf(MSG_DEBUG,
- "KaY: Create transmit SA(an: %hhu, next_PN: %u) of SC",
- an, next_PN);
+ "KaY: Create transmit SA(an: %hhu, next_PN: %u) of SC(channel: %d)",
+ an, next_PN, psc->channel);
return psa;
}
@@ -2476,7 +2450,6 @@
*/
static void ieee802_1x_kay_deinit_transmit_sa(struct transmit_sa *psa)
{
- ieee802_1x_kay_deinit_data_key(psa->pkey);
psa->pkey = NULL;
wpa_printf(MSG_DEBUG,
"KaY: Delete transmit SA(an: %hhu) of SC",
@@ -2490,7 +2463,8 @@
* init_transmit_sc -
*/
static struct transmit_sc *
-ieee802_1x_kay_init_transmit_sc(const struct ieee802_1x_mka_sci *sci)
+ieee802_1x_kay_init_transmit_sc(const struct ieee802_1x_mka_sci *sci,
+ int channel)
{
struct transmit_sc *psc;
@@ -2500,6 +2474,7 @@
return NULL;
}
os_memcpy(&psc->sci, sci, sizeof(psc->sci));
+ psc->channel = channel;
os_get_time(&psc->created_time);
psc->transmitting = FALSE;
@@ -2507,7 +2482,7 @@
psc->enciphering_sa = FALSE;
dl_list_init(&psc->sa_list);
- wpa_printf(MSG_DEBUG, "KaY: Create transmit SC");
+ wpa_printf(MSG_DEBUG, "KaY: Create transmit SC(channel: %d)", channel);
wpa_hexdump(MSG_DEBUG, "SCI: ", (u8 *)sci , sizeof(*sci));
return psc;
@@ -2523,9 +2498,13 @@
{
struct transmit_sa *psa, *tmp;
- wpa_printf(MSG_DEBUG, "KaY: Delete transmit SC");
- dl_list_for_each_safe(psa, tmp, &psc->sa_list, struct transmit_sa, list)
- ieee802_1x_delete_transmit_sa(participant->kay, psa);
+ wpa_printf(MSG_DEBUG, "KaY: Delete transmit SC(channel: %d)",
+ psc->channel);
+ dl_list_for_each_safe(psa, tmp, &psc->sa_list, struct transmit_sa,
+ list) {
+ secy_disable_transmit_sa(participant->kay, psa);
+ ieee802_1x_kay_deinit_transmit_sa(psa);
+ }
os_free(psc);
}
@@ -2603,32 +2582,6 @@
}
-static struct transmit_sa * lookup_txsa_by_an(struct transmit_sc *txsc, u8 an)
-{
- struct transmit_sa *txsa;
-
- dl_list_for_each(txsa, &txsc->sa_list, struct transmit_sa, list) {
- if (txsa->an == an)
- return txsa;
- }
-
- return NULL;
-}
-
-
-static struct receive_sa * lookup_rxsa_by_an(struct receive_sc *rxsc, u8 an)
-{
- struct receive_sa *rxsa;
-
- dl_list_for_each(rxsa, &rxsc->sa_list, struct receive_sa, list) {
- if (rxsa->an == an)
- return rxsa;
- }
-
- return NULL;
-}
-
-
/**
* ieee802_1x_kay_create_sas -
*/
@@ -2663,9 +2616,6 @@
}
dl_list_for_each(rxsc, &principal->rxsc_list, struct receive_sc, list) {
- while ((rxsa = lookup_rxsa_by_an(rxsc, latest_sak->an)) != NULL)
- ieee802_1x_delete_receive_sa(kay, rxsa);
-
rxsa = ieee802_1x_kay_init_receive_sa(rxsc, latest_sak->an, 1,
latest_sak);
if (!rxsa)
@@ -2674,10 +2624,6 @@
secy_create_receive_sa(kay, rxsa);
}
- while ((txsa = lookup_txsa_by_an(principal->txsc, latest_sak->an)) !=
- NULL)
- ieee802_1x_delete_transmit_sa(kay, txsa);
-
txsa = ieee802_1x_kay_init_transmit_sa(principal->txsc, latest_sak->an,
1, latest_sak);
if (!txsa)
@@ -2711,16 +2657,20 @@
/* remove the transmit sa */
dl_list_for_each_safe(txsa, pre_txsa, &principal->txsc->sa_list,
struct transmit_sa, list) {
- if (is_ki_equal(&txsa->pkey->key_identifier, ki))
- ieee802_1x_delete_transmit_sa(kay, txsa);
+ if (is_ki_equal(&txsa->pkey->key_identifier, ki)) {
+ secy_disable_transmit_sa(kay, txsa);
+ ieee802_1x_kay_deinit_transmit_sa(txsa);
+ }
}
/* remove the receive sa */
dl_list_for_each(rxsc, &principal->rxsc_list, struct receive_sc, list) {
dl_list_for_each_safe(rxsa, pre_rxsa, &rxsc->sa_list,
struct receive_sa, list) {
- if (is_ki_equal(&rxsa->pkey->key_identifier, ki))
- ieee802_1x_delete_receive_sa(kay, rxsa);
+ if (is_ki_equal(&rxsa->pkey->key_identifier, ki)) {
+ secy_disable_receive_sa(kay, rxsa);
+ ieee802_1x_kay_deinit_receive_sa(rxsa);
+ }
}
}
@@ -2728,7 +2678,6 @@
dl_list_for_each_safe(sa_key, pre_key, &principal->sak_list,
struct data_key, list) {
if (is_ki_equal(&sa_key->key_identifier, ki)) {
- dl_list_del(&sa_key->list);
ieee802_1x_kay_deinit_data_key(sa_key);
break;
}
@@ -3120,26 +3069,20 @@
kay->macsec_replay_window = 0;
kay->macsec_confidentiality = CONFIDENTIALITY_NONE;
} else {
- if (secy_get_capability(kay, &kay->macsec_capable) < 0) {
- os_free(kay);
- return NULL;
- }
-
+ kay->macsec_capable = MACSEC_CAP_INTEG_AND_CONF_0_30_50;
kay->macsec_desired = TRUE;
kay->macsec_protect = TRUE;
kay->macsec_validate = Strict;
kay->macsec_replay_protect = FALSE;
kay->macsec_replay_window = 0;
- if (kay->macsec_capable >= MACSEC_CAP_INTEG_AND_CONF)
- kay->macsec_confidentiality = CONFIDENTIALITY_OFFSET_0;
- else
- kay->macsec_confidentiality = MACSEC_CAP_INTEGRITY;
+ kay->macsec_confidentiality = CONFIDENTIALITY_OFFSET_0;
}
wpa_printf(MSG_DEBUG, "KaY: state machine created");
/* Initialize the SecY must be prio to CP, as CP will control SecY */
secy_init_macsec(kay);
+ secy_get_available_transmit_sc(kay, &kay->sc_ch);
wpa_printf(MSG_DEBUG, "KaY: secy init macsec done");
@@ -3300,7 +3243,8 @@
dl_list_init(&participant->sak_list);
participant->new_key = NULL;
dl_list_init(&participant->rxsc_list);
- participant->txsc = ieee802_1x_kay_init_transmit_sc(&kay->actor_sci);
+ participant->txsc = ieee802_1x_kay_init_transmit_sc(&kay->actor_sci,
+ kay->sc_ch);
secy_cp_control_protect_frames(kay, kay->macsec_protect);
secy_cp_control_replay(kay, kay->macsec_replay_protect,
kay->macsec_replay_window);
@@ -3396,7 +3340,8 @@
sak = dl_list_entry(participant->sak_list.next,
struct data_key, list);
dl_list_del(&sak->list);
- ieee802_1x_kay_deinit_data_key(sak);
+ os_free(sak->key);
+ os_free(sak);
}
while (!dl_list_empty(&participant->rxsc_list)) {
rxsc = dl_list_entry(participant->rxsc_list.next,
@@ -3464,7 +3409,6 @@
unsigned int cs_index)
{
struct ieee802_1x_mka_participant *participant;
- enum macsec_cap secy_cap;
if (!kay)
return -1;
@@ -3483,12 +3427,6 @@
kay->macsec_csindex = cs_index;
kay->macsec_capable = cipher_suite_tbl[kay->macsec_csindex].capable;
- if (secy_get_capability(kay, &secy_cap) < 0)
- return -3;
-
- if (kay->macsec_capable > secy_cap)
- kay->macsec_capable = secy_cap;
-
participant = ieee802_1x_kay_get_principal_participant(kay);
if (participant) {
wpa_printf(MSG_INFO, "KaY: Cipher Suite changed");
diff --git a/src/pae/ieee802_1x_kay.h b/src/pae/ieee802_1x_kay.h
index 576a8a0..afbaa33 100644
--- a/src/pae/ieee802_1x_kay.h
+++ b/src/pae/ieee802_1x_kay.h
@@ -15,7 +15,7 @@
struct macsec_init_params;
-#define MI_LEN 12 /* 96-bit Member Identifier */
+#define MI_LEN 12
#define MAX_KEY_LEN 32 /* 32 bytes, 256 bits */
#define MAX_CKN_LEN 32 /* 32 bytes, 256 bits */
@@ -24,12 +24,6 @@
#define MKA_LIFE_TIME 6000
#define MKA_SAK_RETIRE_TIME 3000
-/**
- * struct ieee802_1x_mka_ki - Key Identifier (KI)
- * @mi: Key Server's Member Identifier
- * @kn: Key Number, assigned by the Key Server
- * IEEE 802.1X-2010 9.8 SAK generation, distribution, and selection
- */
struct ieee802_1x_mka_ki {
u8 mi[MI_LEN];
u32 kn;
@@ -55,84 +49,6 @@
EAP_EXCHANGE,
};
-struct data_key {
- u8 *key;
- int key_len;
- struct ieee802_1x_mka_ki key_identifier;
- enum confidentiality_offset confidentiality_offset;
- u8 an;
- Boolean transmits;
- Boolean receives;
- struct os_time created_time;
- u32 next_pn;
-
- /* not defined data */
- Boolean rx_latest;
- Boolean tx_latest;
-
- int user;
-
- struct dl_list list;
-};
-
-/* TransmitSC in IEEE Std 802.1AE-2006, Figure 10-6 */
-struct transmit_sc {
- struct ieee802_1x_mka_sci sci; /* const SCI sci */
- Boolean transmitting; /* bool transmitting (read only) */
-
- struct os_time created_time; /* Time createdTime */
-
- u8 encoding_sa; /* AN encodingSA (read only) */
- u8 enciphering_sa; /* AN encipheringSA (read only) */
-
- /* not defined data */
- struct dl_list list;
- struct dl_list sa_list;
-};
-
-/* TransmitSA in IEEE Std 802.1AE-2006, Figure 10-6 */
-struct transmit_sa {
- Boolean in_use; /* bool inUse (read only) */
- u32 next_pn; /* PN nextPN (read only) */
- struct os_time created_time; /* Time createdTime */
-
- Boolean enable_transmit; /* bool EnableTransmit */
-
- u8 an;
- Boolean confidentiality;
- struct data_key *pkey;
-
- struct transmit_sc *sc;
- struct dl_list list; /* list entry in struct transmit_sc::sa_list */
-};
-
-/* ReceiveSC in IEEE Std 802.1AE-2006, Figure 10-6 */
-struct receive_sc {
- struct ieee802_1x_mka_sci sci; /* const SCI sci */
- Boolean receiving; /* bool receiving (read only) */
-
- struct os_time created_time; /* Time createdTime */
-
- struct dl_list list;
- struct dl_list sa_list;
-};
-
-/* ReceiveSA in IEEE Std 802.1AE-2006, Figure 10-6 */
-struct receive_sa {
- Boolean enable_receive; /* bool enableReceive */
- Boolean in_use; /* bool inUse (read only) */
-
- u32 next_pn; /* PN nextPN (read only) */
- u32 lowest_pn; /* PN lowestPN (read only) */
- u8 an;
- struct os_time created_time;
-
- struct data_key *pkey;
- struct receive_sc *sc; /* list entry in struct receive_sc::sa_list */
-
- struct dl_list list;
-};
-
struct ieee802_1x_kay_ctx {
/* pointer to arbitrary upper level context */
void *ctx;
@@ -140,29 +56,34 @@
/* abstract wpa driver interface */
int (*macsec_init)(void *ctx, struct macsec_init_params *params);
int (*macsec_deinit)(void *ctx);
- int (*macsec_get_capability)(void *priv, enum macsec_cap *cap);
int (*enable_protect_frames)(void *ctx, Boolean enabled);
int (*set_replay_protect)(void *ctx, Boolean enabled, u32 window);
int (*set_current_cipher_suite)(void *ctx, u64 cs);
int (*enable_controlled_port)(void *ctx, Boolean enabled);
- int (*get_receive_lowest_pn)(void *ctx, struct receive_sa *sa);
- int (*get_transmit_next_pn)(void *ctx, struct transmit_sa *sa);
- int (*set_transmit_next_pn)(void *ctx, struct transmit_sa *sa);
- int (*create_receive_sc)(void *ctx, struct receive_sc *sc,
+ int (*get_receive_lowest_pn)(void *ctx, u32 channel, u8 an,
+ u32 *lowest_pn);
+ int (*get_transmit_next_pn)(void *ctx, u32 channel, u8 an,
+ u32 *next_pn);
+ int (*set_transmit_next_pn)(void *ctx, u32 channel, u8 an, u32 next_pn);
+ int (*get_available_receive_sc)(void *ctx, u32 *channel);
+ int (*create_receive_sc)(void *ctx, u32 channel,
+ struct ieee802_1x_mka_sci *sci,
enum validate_frames vf,
enum confidentiality_offset co);
- int (*delete_receive_sc)(void *ctx, struct receive_sc *sc);
- int (*create_receive_sa)(void *ctx, struct receive_sa *sa);
- int (*delete_receive_sa)(void *ctx, struct receive_sa *sa);
- int (*enable_receive_sa)(void *ctx, struct receive_sa *sa);
- int (*disable_receive_sa)(void *ctx, struct receive_sa *sa);
- int (*create_transmit_sc)(void *ctx, struct transmit_sc *sc,
+ int (*delete_receive_sc)(void *ctx, u32 channel);
+ int (*create_receive_sa)(void *ctx, u32 channel, u8 an, u32 lowest_pn,
+ const u8 *sak);
+ int (*enable_receive_sa)(void *ctx, u32 channel, u8 an);
+ int (*disable_receive_sa)(void *ctx, u32 channel, u8 an);
+ int (*get_available_transmit_sc)(void *ctx, u32 *channel);
+ int (*create_transmit_sc)(void *ctx, u32 channel,
+ const struct ieee802_1x_mka_sci *sci,
enum confidentiality_offset co);
- int (*delete_transmit_sc)(void *ctx, struct transmit_sc *sc);
- int (*create_transmit_sa)(void *ctx, struct transmit_sa *sa);
- int (*delete_transmit_sa)(void *ctx, struct transmit_sa *sa);
- int (*enable_transmit_sa)(void *ctx, struct transmit_sa *sa);
- int (*disable_transmit_sa)(void *ctx, struct transmit_sa *sa);
+ int (*delete_transmit_sc)(void *ctx, u32 channel);
+ int (*create_transmit_sa)(void *ctx, u32 channel, u8 an, u32 next_pn,
+ Boolean confidentiality, const u8 *sak);
+ int (*enable_transmit_sa)(void *ctx, u32 channel, u8 an);
+ int (*disable_transmit_sa)(void *ctx, u32 channel, u8 an);
};
struct ieee802_1x_kay {
@@ -211,6 +132,7 @@
u8 mka_version;
u8 algo_agility[4];
+ u32 sc_ch;
u32 pn_exhaustion;
Boolean port_enable;
diff --git a/src/pae/ieee802_1x_kay_i.h b/src/pae/ieee802_1x_kay_i.h
index 0c4bb8e..622282e 100644
--- a/src/pae/ieee802_1x_kay_i.h
+++ b/src/pae/ieee802_1x_kay_i.h
@@ -54,6 +54,88 @@
struct dl_list list;
};
+struct data_key {
+ u8 *key;
+ int key_len;
+ struct ieee802_1x_mka_ki key_identifier;
+ enum confidentiality_offset confidentiality_offset;
+ u8 an;
+ Boolean transmits;
+ Boolean receives;
+ struct os_time created_time;
+ u32 next_pn;
+
+ /* not defined data */
+ Boolean rx_latest;
+ Boolean tx_latest;
+
+ int user; /* FIXME: to indicate if it can be delete safely */
+
+ struct dl_list list;
+};
+
+/* TransmitSC in IEEE Std 802.1AE-2006, Figure 10-6 */
+struct transmit_sc {
+ struct ieee802_1x_mka_sci sci; /* const SCI sci */
+ Boolean transmitting; /* bool transmitting (read only) */
+
+ struct os_time created_time; /* Time createdTime */
+
+ u8 encoding_sa; /* AN encodingSA (read only) */
+ u8 enciphering_sa; /* AN encipheringSA (read only) */
+
+ /* not defined data */
+ unsigned int channel;
+
+ struct dl_list list;
+ struct dl_list sa_list;
+};
+
+/* TransmitSA in IEEE Std 802.1AE-2006, Figure 10-6 */
+struct transmit_sa {
+ Boolean in_use; /* bool inUse (read only) */
+ u32 next_pn; /* PN nextPN (read only) */
+ struct os_time created_time; /* Time createdTime */
+
+ Boolean enable_transmit; /* bool EnableTransmit */
+
+ u8 an;
+ Boolean confidentiality;
+ struct data_key *pkey;
+
+ struct transmit_sc *sc;
+ struct dl_list list; /* list entry in struct transmit_sc::sa_list */
+};
+
+/* ReceiveSC in IEEE Std 802.1AE-2006, Figure 10-6 */
+struct receive_sc {
+ struct ieee802_1x_mka_sci sci; /* const SCI sci */
+ Boolean receiving; /* bool receiving (read only) */
+
+ struct os_time created_time; /* Time createdTime */
+
+ unsigned int channel;
+
+ struct dl_list list;
+ struct dl_list sa_list;
+};
+
+/* ReceiveSA in IEEE Std 802.1AE-2006, Figure 10-6 */
+struct receive_sa {
+ Boolean enable_receive; /* bool enableReceive */
+ Boolean in_use; /* bool inUse (read only) */
+
+ u32 next_pn; /* PN nextPN (read only) */
+ u32 lowest_pn; /* PN lowestPN (read only) */
+ u8 an;
+ struct os_time created_time;
+
+ struct data_key *pkey;
+ struct receive_sc *sc; /* list entry in struct receive_sc::sa_list */
+
+ struct dl_list list;
+};
+
struct macsec_ciphersuite {
u64 id;
char name[32];
@@ -168,22 +250,6 @@
#define MKA_HDR_LEN sizeof(struct ieee802_1x_mka_hdr)
-/**
- * struct ieee802_1x_mka_basic_body - Basic Parameter Set (Figure 11-8)
- * @version: MKA Version Identifier
- * @priority: Key Server Priority
- * @length: Parameter set body length
- * @macsec_capability: MACsec capability, as defined in ieee802_1x_defs.h
- * @macsec_desired: the participant wants MACsec to be used to protect frames
- * (9.6.1)
- * @key_server: the participant has not decided that another participant is or
- * will be the key server (9.5.1)
- * @length1: Parameter set body length (cont)
- * @actor_mi: Actor's Member Identifier
- * @actor_mn: Actor's Message Number
- * @algo_agility: Algorithm Agility parameter
- * @ckn: CAK Name
- */
struct ieee802_1x_mka_basic_body {
/* octet 1 */
u8 version;
@@ -213,14 +279,6 @@
u8 ckn[0];
};
-/**
- * struct ieee802_1x_mka_peer_body - Live Peer List and Potential Peer List
- * parameter sets (Figure 11-9)
- * @type: Parameter set type (1 or 2)
- * @length: Parameter set body length
- * @length1: Parameter set body length (cont)
- * @peer: array of (MI, MN) pairs
- */
struct ieee802_1x_mka_peer_body {
/* octet 1 */
u8 type;
@@ -241,28 +299,6 @@
/* followed by Peers */
};
-/**
- * struct ieee802_1x_mka_sak_use_body - MACsec SAK Use parameter set (Figure
- * 11-10)
- * @type: MKA message type
- * @lan: latest key AN
- * @ltx: latest key TX
- * @lrx: latest key RX
- * @oan: old key AN
- * @otx: old key TX
- * @orx: old key RX
- * @ptx: plain TX, ie protectFrames is False
- * @prx: plain RX, ie validateFrames is not Strict
- * @delay_protect: True if LPNs are being reported sufficiently frequently to
- * allow the recipient to provide data delay protection. If False, the LPN
- * can be reported as zero.
- * @lsrv_mi: latest key server MI
- * @lkn: latest key number (together with MI, form the KI)
- * @llpn: latest lowest acceptable PN (LPN)
- * @osrv_mi: old key server MI
- * @okn: old key number (together with MI, form the KI)
- * @olpn: old lowest acceptable PN (LPN)
- */
struct ieee802_1x_mka_sak_use_body {
/* octet 1 */
u8 type;
@@ -316,21 +352,7 @@
be32 olpn;
};
-/**
- * struct ieee802_1x_mka_dist_sak_body - Distributed SAK parameter set
- * (GCM-AES-128, Figure 11-11)
- * @type: Parameter set type (4)
- * @length: Parameter set body length
- * @length1: Parameter set body length (cont)
- * Total parameter body length values:
- * - 0 for plain text
- * - 28 for GCM-AES-128
- * - 36 or more for other cipher suites
- * @confid_offset: confidentiality offset, as defined in ieee802_1x_defs.h
- * @dan: distributed AN (0 for plain text)
- * @kn: Key Number
- * @sak: AES Key Wrap of SAK (see 9.8)
- */
+
struct ieee802_1x_mka_dist_sak_body {
/* octet 1 */
u8 type;
@@ -363,41 +385,6 @@
u8 sak[0];
};
-/**
- * struct ieee802_1x_mka_dist_cak_body - Distributed CAK parameter set (Figure
- * 11-13)
- * @type: Parameter set type (5)
- * @length: Parameter set body length
- * @length1: Parameter set body length (cont)
- * Total parameter body length values:
- * - 0 for plain text
- * - 28 for GCM-AES-128
- * - 36 or more for other cipher suites
- * @cak: AES Key Wrap of CAK (see 9.8)
- * @ckn: CAK Name
- */
-struct ieee802_1x_mka_dist_cak_body {
- /* octet 1 */
- u8 type;
- /* octet 2 */
- u8 reserve;
- /* octet 3 */
-#if __BYTE_ORDER == __LITTLE_ENDIAN
- u8 length:4;
- u8 reserve1:4;
-#elif __BYTE_ORDER == __BIG_ENDIAN
- u8 reserve1:4;
- u8 length:4;
-#endif
- /* octet 4 */
- u8 length1;
-
- /* octet 5 - 28 */
- u8 cak[24];
-
- /* followed by CAK Name, 29- */
- u8 ckn[0];
-};
struct ieee802_1x_mka_icv_body {
/* octet 1 */
diff --git a/src/pae/ieee802_1x_secy_ops.c b/src/pae/ieee802_1x_secy_ops.c
index b1a9d22..2d12911 100644
--- a/src/pae/ieee802_1x_secy_ops.c
+++ b/src/pae/ieee802_1x_secy_ops.c
@@ -113,26 +113,6 @@
}
-int secy_get_capability(struct ieee802_1x_kay *kay, enum macsec_cap *cap)
-{
- struct ieee802_1x_kay_ctx *ops;
-
- if (!kay) {
- wpa_printf(MSG_ERROR, "KaY: %s params invalid", __func__);
- return -1;
- }
-
- ops = kay->ctx;
- if (!ops || !ops->macsec_get_capability) {
- wpa_printf(MSG_ERROR,
- "KaY: secy macsec_get_capability operation not supported");
- return -1;
- }
-
- return ops->macsec_get_capability(ops->ctx, cap);
-}
-
-
int secy_get_receive_lowest_pn(struct ieee802_1x_kay *kay,
struct receive_sa *rxsa)
{
@@ -150,7 +130,10 @@
return -1;
}
- return ops->get_receive_lowest_pn(ops->ctx, rxsa);
+ return ops->get_receive_lowest_pn(ops->ctx,
+ rxsa->sc->channel,
+ rxsa->an,
+ &rxsa->lowest_pn);
}
@@ -171,7 +154,10 @@
return -1;
}
- return ops->get_transmit_next_pn(ops->ctx, txsa);
+ return ops->get_transmit_next_pn(ops->ctx,
+ txsa->sc->channel,
+ txsa->an,
+ &txsa->next_pn);
}
@@ -192,7 +178,30 @@
return -1;
}
- return ops->set_transmit_next_pn(ops->ctx, txsa);
+ return ops->set_transmit_next_pn(ops->ctx,
+ txsa->sc->channel,
+ txsa->an,
+ txsa->next_pn);
+}
+
+
+int secy_get_available_receive_sc(struct ieee802_1x_kay *kay, u32 *channel)
+{
+ struct ieee802_1x_kay_ctx *ops;
+
+ if (!kay) {
+ wpa_printf(MSG_ERROR, "KaY: %s params invalid", __func__);
+ return -1;
+ }
+
+ ops = kay->ctx;
+ if (!ops || !ops->get_available_receive_sc) {
+ wpa_printf(MSG_ERROR,
+ "KaY: secy get_available_receive_sc operation not supported");
+ return -1;
+ }
+
+ return ops->get_available_receive_sc(ops->ctx, channel);
}
@@ -212,7 +221,8 @@
return -1;
}
- return ops->create_receive_sc(ops->ctx, rxsc, kay->vf, kay->co);
+ return ops->create_receive_sc(ops->ctx, rxsc->channel, &rxsc->sci,
+ kay->vf, kay->co);
}
@@ -232,7 +242,7 @@
return -1;
}
- return ops->delete_receive_sc(ops->ctx, rxsc);
+ return ops->delete_receive_sc(ops->ctx, rxsc->channel);
}
@@ -252,27 +262,8 @@
return -1;
}
- return ops->create_receive_sa(ops->ctx, rxsa);
-}
-
-
-int secy_delete_receive_sa(struct ieee802_1x_kay *kay, struct receive_sa *rxsa)
-{
- struct ieee802_1x_kay_ctx *ops;
-
- if (!kay || !rxsa) {
- wpa_printf(MSG_ERROR, "KaY: %s params invalid", __func__);
- return -1;
- }
-
- ops = kay->ctx;
- if (!ops || !ops->delete_receive_sa) {
- wpa_printf(MSG_ERROR,
- "KaY: secy delete_receive_sa operation not supported");
- return -1;
- }
-
- return ops->delete_receive_sa(ops->ctx, rxsa);
+ return ops->create_receive_sa(ops->ctx, rxsa->sc->channel, rxsa->an,
+ rxsa->lowest_pn, rxsa->pkey->key);
}
@@ -294,7 +285,7 @@
rxsa->enable_receive = TRUE;
- return ops->enable_receive_sa(ops->ctx, rxsa);
+ return ops->enable_receive_sa(ops->ctx, rxsa->sc->channel, rxsa->an);
}
@@ -316,7 +307,27 @@
rxsa->enable_receive = FALSE;
- return ops->disable_receive_sa(ops->ctx, rxsa);
+ return ops->disable_receive_sa(ops->ctx, rxsa->sc->channel, rxsa->an);
+}
+
+
+int secy_get_available_transmit_sc(struct ieee802_1x_kay *kay, u32 *channel)
+{
+ struct ieee802_1x_kay_ctx *ops;
+
+ if (!kay) {
+ wpa_printf(MSG_ERROR, "KaY: %s params invalid", __func__);
+ return -1;
+ }
+
+ ops = kay->ctx;
+ if (!ops || !ops->get_available_transmit_sc) {
+ wpa_printf(MSG_ERROR,
+ "KaY: secy get_available_transmit_sc operation not supported");
+ return -1;
+ }
+
+ return ops->get_available_transmit_sc(ops->ctx, channel);
}
@@ -337,7 +348,8 @@
return -1;
}
- return ops->create_transmit_sc(ops->ctx, txsc, kay->co);
+ return ops->create_transmit_sc(ops->ctx, txsc->channel, &txsc->sci,
+ kay->co);
}
@@ -358,7 +370,7 @@
return -1;
}
- return ops->delete_transmit_sc(ops->ctx, txsc);
+ return ops->delete_transmit_sc(ops->ctx, txsc->channel);
}
@@ -379,28 +391,9 @@
return -1;
}
- return ops->create_transmit_sa(ops->ctx, txsa);
-}
-
-
-int secy_delete_transmit_sa(struct ieee802_1x_kay *kay,
- struct transmit_sa *txsa)
-{
- struct ieee802_1x_kay_ctx *ops;
-
- if (!kay || !txsa) {
- wpa_printf(MSG_ERROR, "KaY: %s params invalid", __func__);
- return -1;
- }
-
- ops = kay->ctx;
- if (!ops || !ops->delete_transmit_sa) {
- wpa_printf(MSG_ERROR,
- "KaY: secy delete_transmit_sa operation not supported");
- return -1;
- }
-
- return ops->delete_transmit_sa(ops->ctx, txsa);
+ return ops->create_transmit_sa(ops->ctx, txsa->sc->channel, txsa->an,
+ txsa->next_pn, txsa->confidentiality,
+ txsa->pkey->key);
}
@@ -423,7 +416,7 @@
txsa->enable_transmit = TRUE;
- return ops->enable_transmit_sa(ops->ctx, txsa);
+ return ops->enable_transmit_sa(ops->ctx, txsa->sc->channel, txsa->an);
}
@@ -446,7 +439,7 @@
txsa->enable_transmit = FALSE;
- return ops->disable_transmit_sa(ops->ctx, txsa);
+ return ops->disable_transmit_sa(ops->ctx, txsa->sc->channel, txsa->an);
}
diff --git a/src/pae/ieee802_1x_secy_ops.h b/src/pae/ieee802_1x_secy_ops.h
index 477120b..f5057ee 100644
--- a/src/pae/ieee802_1x_secy_ops.h
+++ b/src/pae/ieee802_1x_secy_ops.h
@@ -13,6 +13,10 @@
#include "common/ieee802_1x_defs.h"
struct ieee802_1x_kay_conf;
+struct receive_sa;
+struct transmit_sa;
+struct receive_sc;
+struct transmit_sc;
int secy_init_macsec(struct ieee802_1x_kay *kay);
int secy_deinit_macsec(struct ieee802_1x_kay *kay);
@@ -28,29 +32,27 @@
int secy_cp_control_enable_port(struct ieee802_1x_kay *kay, Boolean flag);
/****** KaY -> SecY *******/
-int secy_get_capability(struct ieee802_1x_kay *kay, enum macsec_cap *cap);
int secy_get_receive_lowest_pn(struct ieee802_1x_kay *kay,
struct receive_sa *rxsa);
int secy_get_transmit_next_pn(struct ieee802_1x_kay *kay,
struct transmit_sa *txsa);
int secy_set_transmit_next_pn(struct ieee802_1x_kay *kay,
struct transmit_sa *txsa);
+int secy_get_available_receive_sc(struct ieee802_1x_kay *kay, u32 *channel);
int secy_create_receive_sc(struct ieee802_1x_kay *kay, struct receive_sc *rxsc);
int secy_delete_receive_sc(struct ieee802_1x_kay *kay, struct receive_sc *rxsc);
int secy_create_receive_sa(struct ieee802_1x_kay *kay, struct receive_sa *rxsa);
-int secy_delete_receive_sa(struct ieee802_1x_kay *kay, struct receive_sa *rxsa);
int secy_enable_receive_sa(struct ieee802_1x_kay *kay, struct receive_sa *rxsa);
int secy_disable_receive_sa(struct ieee802_1x_kay *kay,
struct receive_sa *rxsa);
+int secy_get_available_transmit_sc(struct ieee802_1x_kay *kay, u32 *channel);
int secy_create_transmit_sc(struct ieee802_1x_kay *kay,
struct transmit_sc *txsc);
int secy_delete_transmit_sc(struct ieee802_1x_kay *kay,
struct transmit_sc *txsc);
int secy_create_transmit_sa(struct ieee802_1x_kay *kay,
struct transmit_sa *txsa);
-int secy_delete_transmit_sa(struct ieee802_1x_kay *kay,
- struct transmit_sa *txsa);
int secy_enable_transmit_sa(struct ieee802_1x_kay *kay,
struct transmit_sa *txsa);
int secy_disable_transmit_sa(struct ieee802_1x_kay *kay,
diff --git a/src/rsn_supp/peerkey.c b/src/rsn_supp/peerkey.c
index f06ed04..79764d9 100644
--- a/src/rsn_supp/peerkey.c
+++ b/src/rsn_supp/peerkey.c
@@ -65,9 +65,10 @@
{
size_t rlen;
struct wpa_eapol_key *err;
+ struct wpa_eapol_key_192 *err192;
struct rsn_error_kde error;
- u8 *rbuf, *pos, *mic;
- size_t kde_len, mic_len = 16;
+ u8 *rbuf, *pos;
+ size_t kde_len;
u16 key_info;
kde_len = 2 + RSN_SELECTOR_LEN + sizeof(error);
@@ -75,11 +76,11 @@
kde_len += 2 + RSN_SELECTOR_LEN + ETH_ALEN;
rbuf = wpa_sm_alloc_eapol(sm, IEEE802_1X_TYPE_EAPOL_KEY,
- NULL, sizeof(*err) + mic_len + 2 + kde_len,
- &rlen, (void *) &err);
+ NULL, sizeof(*err) + kde_len, &rlen,
+ (void *) &err);
if (rbuf == NULL)
return -1;
- mic = (u8 *) (err + 1);
+ err192 = (struct wpa_eapol_key_192 *) err;
err->type = EAPOL_KEY_TYPE_RSN;
key_info = ver | WPA_KEY_INFO_SMK_MESSAGE | WPA_KEY_INFO_MIC |
@@ -91,8 +92,8 @@
WPA_REPLAY_COUNTER_LEN);
inc_byte_array(sm->request_counter, WPA_REPLAY_COUNTER_LEN);
- WPA_PUT_BE16(mic + mic_len, (u16) kde_len);
- pos = mic + mic_len + 2;
+ WPA_PUT_BE16(err->key_data_length, (u16) kde_len);
+ pos = (u8 *) (err + 1);
if (peer) {
/* Peer MAC Address KDE */
@@ -113,8 +114,8 @@
"(mui %d error_type %d)", mui, error_type);
}
- wpa_eapol_key_send(sm, &sm->ptk, ver, dst, ETH_P_EAPOL, rbuf, rlen,
- mic);
+ wpa_eapol_key_send(sm, sm->ptk.kck, sm->ptk.kck_len, ver, dst,
+ ETH_P_EAPOL, rbuf, rlen, err192->key_mic);
return 0;
}
@@ -127,8 +128,9 @@
{
size_t rlen;
struct wpa_eapol_key *reply;
- u8 *rbuf, *pos, *mic;
- size_t kde_len, mic_len = 16;
+ struct wpa_eapol_key_192 *reply192;
+ u8 *rbuf, *pos;
+ size_t kde_len;
u16 key_info;
/* KDEs: Peer RSN IE, Initiator MAC Address, Initiator Nonce */
@@ -137,10 +139,11 @@
2 + RSN_SELECTOR_LEN + WPA_NONCE_LEN;
rbuf = wpa_sm_alloc_eapol(sm, IEEE802_1X_TYPE_EAPOL_KEY,
- NULL, sizeof(*reply) + mic_len + 2 + kde_len,
- &rlen, (void *) &reply);
+ NULL, sizeof(*reply) + kde_len, &rlen,
+ (void *) &reply);
if (rbuf == NULL)
return -1;
+ reply192 = (struct wpa_eapol_key_192 *) reply;
reply->type = EAPOL_KEY_TYPE_RSN;
key_info = ver | WPA_KEY_INFO_SMK_MESSAGE | WPA_KEY_INFO_MIC |
@@ -152,9 +155,8 @@
os_memcpy(reply->key_nonce, peerkey->pnonce, WPA_NONCE_LEN);
- mic = (u8 *) (reply + 1);
- WPA_PUT_BE16(mic + mic_len, (u16) kde_len);
- pos = mic + mic_len + 2;
+ WPA_PUT_BE16(reply->key_data_length, (u16) kde_len);
+ pos = (u8 *) (reply + 1);
/* Peer RSN IE */
pos = wpa_add_ie(pos, peerkey->rsnie_p, peerkey->rsnie_p_len);
@@ -166,8 +168,8 @@
wpa_add_kde(pos, RSN_KEY_DATA_NONCE, peerkey->inonce, WPA_NONCE_LEN);
wpa_printf(MSG_DEBUG, "RSN: Sending EAPOL-Key SMK M3");
- wpa_eapol_key_send(sm, &sm->ptk, ver, src_addr, ETH_P_EAPOL, rbuf, rlen,
- mic);
+ wpa_eapol_key_send(sm, sm->ptk.kck, sm->ptk.kck_len, ver, src_addr,
+ ETH_P_EAPOL, rbuf, rlen, reply192->key_mic);
return 0;
}
@@ -322,19 +324,18 @@
{
size_t mlen;
struct wpa_eapol_key *msg;
- u8 *mbuf, *mic;
- size_t kde_len, mic_len = 16;
+ u8 *mbuf;
+ size_t kde_len;
u16 key_info, ver;
kde_len = 2 + RSN_SELECTOR_LEN + PMKID_LEN;
mbuf = wpa_sm_alloc_eapol(sm, IEEE802_1X_TYPE_EAPOL_KEY, NULL,
- sizeof(*msg) + mic_len + 2 + kde_len, &mlen,
+ sizeof(*msg) + kde_len, &mlen,
(void *) &msg);
if (mbuf == NULL)
return;
- mic = (u8 *) (msg + 1);
msg->type = EAPOL_KEY_TYPE_RSN;
if (peerkey->cipher != WPA_CIPHER_TKIP)
@@ -354,8 +355,8 @@
WPA_REPLAY_COUNTER_LEN);
inc_byte_array(peerkey->replay_counter, WPA_REPLAY_COUNTER_LEN);
- WPA_PUT_BE16(mic + mic_len, kde_len);
- wpa_add_kde(mic + mic_len + 2, RSN_KEY_DATA_PMKID,
+ WPA_PUT_BE16(msg->key_data_length, kde_len);
+ wpa_add_kde((u8 *) (msg + 1), RSN_KEY_DATA_PMKID,
peerkey->smkid, PMKID_LEN);
if (random_get_bytes(peerkey->inonce, WPA_NONCE_LEN)) {
@@ -370,7 +371,7 @@
wpa_printf(MSG_DEBUG, "RSN: Sending EAPOL-Key STK 1/4 to " MACSTR,
MAC2STR(peerkey->addr));
- wpa_eapol_key_send(sm, NULL, ver, peerkey->addr, ETH_P_EAPOL,
+ wpa_eapol_key_send(sm, NULL, 0, ver, peerkey->addr, ETH_P_EAPOL,
mbuf, mlen, NULL);
}
@@ -380,8 +381,8 @@
{
size_t mlen;
struct wpa_eapol_key *msg;
- u8 *mbuf, *pos, *mic;
- size_t kde_len, mic_len = 16;
+ u8 *mbuf, *pos;
+ size_t kde_len;
u16 key_info, ver;
be32 lifetime;
@@ -389,12 +390,11 @@
2 + RSN_SELECTOR_LEN + sizeof(lifetime);
mbuf = wpa_sm_alloc_eapol(sm, IEEE802_1X_TYPE_EAPOL_KEY, NULL,
- sizeof(*msg) + mic_len + 2 + kde_len, &mlen,
+ sizeof(*msg) + kde_len, &mlen,
(void *) &msg);
if (mbuf == NULL)
return;
- mic = (u8 *) (msg + 1);
msg->type = EAPOL_KEY_TYPE_RSN;
if (peerkey->cipher != WPA_CIPHER_TKIP)
@@ -415,8 +415,8 @@
WPA_REPLAY_COUNTER_LEN);
inc_byte_array(peerkey->replay_counter, WPA_REPLAY_COUNTER_LEN);
- WPA_PUT_BE16(mic + mic_len, kde_len);
- pos = mic + mic_len;
+ WPA_PUT_BE16(msg->key_data_length, kde_len);
+ pos = (u8 *) (msg + 1);
pos = wpa_add_ie(pos, peerkey->rsnie_i, peerkey->rsnie_i_len);
lifetime = host_to_be32(peerkey->lifetime);
wpa_add_kde(pos, RSN_KEY_DATA_LIFETIME,
@@ -426,8 +426,9 @@
wpa_printf(MSG_DEBUG, "RSN: Sending EAPOL-Key STK 3/4 to " MACSTR,
MAC2STR(peerkey->addr));
- wpa_eapol_key_send(sm, &peerkey->stk, ver, peerkey->addr, ETH_P_EAPOL,
- mbuf, mlen, mic);
+ wpa_eapol_key_send(sm, peerkey->stk.kck, peerkey->stk.kck_len, ver,
+ peerkey->addr, ETH_P_EAPOL, mbuf, mlen,
+ msg->key_mic);
}
@@ -910,10 +911,10 @@
*/
int peerkey_verify_eapol_key_mic(struct wpa_sm *sm,
struct wpa_peerkey *peerkey,
- struct wpa_eapol_key *key, u16 ver,
+ struct wpa_eapol_key_192 *key, u16 ver,
const u8 *buf, size_t len)
{
- u8 mic[WPA_EAPOL_KEY_MIC_MAX_LEN], *mic_pos;
+ u8 mic[WPA_EAPOL_KEY_MIC_MAX_LEN];
size_t mic_len = 16;
int ok = 0;
@@ -925,13 +926,12 @@
peerkey->stk_set = 1;
}
- mic_pos = (u8 *) (key + 1);
- os_memcpy(mic, mic_pos, mic_len);
+ os_memcpy(mic, key->key_mic, mic_len);
if (peerkey->tstk_set) {
- os_memset(mic_pos, 0, mic_len);
+ os_memset(key->key_mic, 0, mic_len);
wpa_eapol_key_mic(peerkey->tstk.kck, peerkey->tstk.kck_len,
- sm->key_mgmt, ver, buf, len, mic_pos);
- if (os_memcmp_const(mic, mic_pos, mic_len) != 0) {
+ sm->key_mgmt, ver, buf, len, key->key_mic);
+ if (os_memcmp_const(mic, key->key_mic, mic_len) != 0) {
wpa_printf(MSG_WARNING, "RSN: Invalid EAPOL-Key MIC "
"when using TSTK - ignoring TSTK");
} else {
@@ -945,10 +945,10 @@
}
if (!ok && peerkey->stk_set) {
- os_memset(mic_pos, 0, mic_len);
+ os_memset(key->key_mic, 0, mic_len);
wpa_eapol_key_mic(peerkey->stk.kck, peerkey->stk.kck_len,
- sm->key_mgmt, ver, buf, len, mic_pos);
- if (os_memcmp_const(mic, mic_pos, mic_len) != 0) {
+ sm->key_mgmt, ver, buf, len, key->key_mic);
+ if (os_memcmp_const(mic, key->key_mic, mic_len) != 0) {
wpa_printf(MSG_WARNING, "RSN: Invalid EAPOL-Key MIC "
"- dropping packet");
return -1;
@@ -980,10 +980,10 @@
*/
int wpa_sm_stkstart(struct wpa_sm *sm, const u8 *peer)
{
- size_t rlen, kde_len, mic_len;
+ size_t rlen, kde_len;
struct wpa_eapol_key *req;
int key_info, ver;
- u8 bssid[ETH_ALEN], *rbuf, *pos, *count_pos, *mic;
+ u8 bssid[ETH_ALEN], *rbuf, *pos, *count_pos;
u16 count;
struct rsn_ie_hdr *hdr;
struct wpa_peerkey *peerkey;
@@ -999,7 +999,6 @@
return -1;
}
- mic_len = wpa_mic_len(sm->key_mgmt);
if (sm->pairwise_cipher != WPA_CIPHER_TKIP)
ver = WPA_KEY_INFO_TYPE_HMAC_SHA1_AES;
else
@@ -1048,7 +1047,7 @@
kde_len = peerkey->rsnie_i_len + 2 + RSN_SELECTOR_LEN + ETH_ALEN;
rbuf = wpa_sm_alloc_eapol(sm, IEEE802_1X_TYPE_EAPOL_KEY, NULL,
- sizeof(*req) + mic_len + 2 + kde_len, &rlen,
+ sizeof(*req) + kde_len, &rlen,
(void *) &req);
if (rbuf == NULL) {
wpa_supplicant_peerkey_free(sm, peerkey);
@@ -1075,10 +1074,8 @@
wpa_hexdump(MSG_DEBUG, "WPA: INonce for SMK handshake",
req->key_nonce, WPA_NONCE_LEN);
- mic = pos = (u8 *) (req + 1);
- pos += mic_len;
- WPA_PUT_BE16(pos, (u16) kde_len);
- pos += 2;
+ WPA_PUT_BE16(req->key_data_length, (u16) kde_len);
+ pos = (u8 *) (req + 1);
/* Initiator RSN IE */
pos = wpa_add_ie(pos, peerkey->rsnie_i, peerkey->rsnie_i_len);
@@ -1087,8 +1084,8 @@
wpa_printf(MSG_INFO, "RSN: Sending EAPOL-Key SMK M1 Request (peer "
MACSTR ")", MAC2STR(peer));
- wpa_eapol_key_send(sm, &sm->ptk, ver, bssid, ETH_P_EAPOL, rbuf, rlen,
- mic);
+ wpa_eapol_key_send(sm, sm->ptk.kck, sm->ptk.kck_len, ver, bssid,
+ ETH_P_EAPOL, rbuf, rlen, req->key_mic);
peerkey->next = sm->peerkey;
sm->peerkey = peerkey;
diff --git a/src/rsn_supp/peerkey.h b/src/rsn_supp/peerkey.h
index f3d07f3..6ccd948 100644
--- a/src/rsn_supp/peerkey.h
+++ b/src/rsn_supp/peerkey.h
@@ -38,7 +38,7 @@
int peerkey_verify_eapol_key_mic(struct wpa_sm *sm,
struct wpa_peerkey *peerkey,
- struct wpa_eapol_key *key, u16 ver,
+ struct wpa_eapol_key_192 *key, u16 ver,
const u8 *buf, size_t len);
void peerkey_rx_eapol_4way(struct wpa_sm *sm, struct wpa_peerkey *peerkey,
struct wpa_eapol_key *key, u16 key_info, u16 ver,
diff --git a/src/rsn_supp/tdls.c b/src/rsn_supp/tdls.c
index f57311e..e424168 100644
--- a/src/rsn_supp/tdls.c
+++ b/src/rsn_supp/tdls.c
@@ -2878,14 +2878,14 @@
static int wpa_tdls_prohibited(struct ieee802_11_elems *elems)
{
/* bit 38 - TDLS Prohibited */
- return !!(elems->ext_capab[4] & 0x40);
+ return !!(elems->ext_capab[2 + 4] & 0x40);
}
static int wpa_tdls_chan_switch_prohibited(struct ieee802_11_elems *elems)
{
/* bit 39 - TDLS Channel Switch Prohibited */
- return !!(elems->ext_capab[4] & 0x80);
+ return !!(elems->ext_capab[2 + 4] & 0x80);
}
@@ -2898,7 +2898,7 @@
if (ies == NULL ||
ieee802_11_parse_elems(ies, len, &elems, 0) == ParseFailed ||
- elems.ext_capab == NULL || elems.ext_capab_len < 5)
+ elems.ext_capab == NULL || elems.ext_capab_len < 2 + 5)
return;
sm->tdls_prohibited = wpa_tdls_prohibited(&elems);
@@ -2917,7 +2917,7 @@
if (ies == NULL ||
ieee802_11_parse_elems(ies, len, &elems, 0) == ParseFailed ||
- elems.ext_capab == NULL || elems.ext_capab_len < 5)
+ elems.ext_capab == NULL || elems.ext_capab_len < 2 + 5)
return;
if (!sm->tdls_prohibited && wpa_tdls_prohibited(&elems)) {
diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c
index 65e257a..3c47879 100644
--- a/src/rsn_supp/wpa.c
+++ b/src/rsn_supp/wpa.c
@@ -10,13 +10,10 @@
#include "includes.h"
#include "common.h"
-#include "crypto/aes.h"
#include "crypto/aes_wrap.h"
#include "crypto/crypto.h"
#include "crypto/random.h"
-#include "crypto/aes_siv.h"
#include "common/ieee802_11_defs.h"
-#include "common/ieee802_11_common.h"
#include "eapol_supp/eapol_supp_sm.h"
#include "wpa.h"
#include "eloop.h"
@@ -33,7 +30,8 @@
/**
* wpa_eapol_key_send - Send WPA/RSN EAPOL-Key message
* @sm: Pointer to WPA state machine data from wpa_sm_init()
- * @ptk: PTK for Key Confirmation/Encryption Key
+ * @kck: Key Confirmation Key (KCK, part of PTK)
+ * @kck_len: KCK length in octets
* @ver: Version field from Key Info
* @dest: Destination address for the frame
* @proto: Ethertype (usually ETH_P_EAPOL)
@@ -42,7 +40,7 @@
* @key_mic: Pointer to the buffer to which the EAPOL-Key MIC is written
* Returns: >= 0 on success, < 0 on failure
*/
-int wpa_eapol_key_send(struct wpa_sm *sm, struct wpa_ptk *ptk,
+int wpa_eapol_key_send(struct wpa_sm *sm, const u8 *kck, size_t kck_len,
int ver, const u8 *dest, u16 proto,
u8 *msg, size_t msg_len, u8 *key_mic)
{
@@ -66,87 +64,16 @@
MAC2STR(dest));
}
}
-
- if (mic_len) {
- if (key_mic && (!ptk || !ptk->kck_len))
- goto out;
-
- if (key_mic &&
- wpa_eapol_key_mic(ptk->kck, ptk->kck_len, sm->key_mgmt, ver,
- msg, msg_len, key_mic)) {
- wpa_msg(sm->ctx->msg_ctx, MSG_ERROR,
- "WPA: Failed to generate EAPOL-Key version %d key_mgmt 0x%x MIC",
- ver, sm->key_mgmt);
- goto out;
- }
- wpa_hexdump_key(MSG_DEBUG, "WPA: KCK", ptk->kck, ptk->kck_len);
- wpa_hexdump(MSG_DEBUG, "WPA: Derived Key MIC",
- key_mic, mic_len);
- } else {
-#ifdef CONFIG_FILS
- /* AEAD cipher - Key MIC field not used */
- struct ieee802_1x_hdr *s_hdr, *hdr;
- struct wpa_eapol_key *s_key, *key;
- u8 *buf, *s_key_data, *key_data;
- size_t buf_len = msg_len + AES_BLOCK_SIZE;
- size_t key_data_len;
- u16 eapol_len;
- const u8 *aad[1];
- size_t aad_len[1];
-
- if (!ptk || !ptk->kek_len)
- goto out;
-
- key_data_len = msg_len - sizeof(struct ieee802_1x_hdr) -
- sizeof(struct wpa_eapol_key) - 2;
-
- buf = os_malloc(buf_len);
- if (!buf)
- goto out;
-
- os_memcpy(buf, msg, msg_len);
- hdr = (struct ieee802_1x_hdr *) buf;
- key = (struct wpa_eapol_key *) (hdr + 1);
- key_data = ((u8 *) (key + 1)) + 2;
-
- /* Update EAPOL header to include AES-SIV overhead */
- eapol_len = be_to_host16(hdr->length);
- eapol_len += AES_BLOCK_SIZE;
- hdr->length = host_to_be16(eapol_len);
-
- /* Update Key Data Length field to include AES-SIV overhead */
- WPA_PUT_BE16((u8 *) (key + 1), AES_BLOCK_SIZE + key_data_len);
-
- s_hdr = (struct ieee802_1x_hdr *) msg;
- s_key = (struct wpa_eapol_key *) (s_hdr + 1);
- s_key_data = ((u8 *) (s_key + 1)) + 2;
-
- wpa_hexdump_key(MSG_DEBUG, "WPA: Plaintext Key Data",
- s_key_data, key_data_len);
-
- wpa_hexdump_key(MSG_DEBUG, "WPA: KEK", ptk->kek, ptk->kek_len);
- /* AES-SIV AAD from EAPOL protocol version field (inclusive) to
- * to Key Data (exclusive). */
- aad[0] = buf;
- aad_len[0] = key_data - buf;
- if (aes_siv_encrypt(ptk->kek, ptk->kek_len,
- s_key_data, key_data_len,
- 1, aad, aad_len, key_data) < 0) {
- os_free(buf);
- goto out;
- }
-
- wpa_hexdump(MSG_DEBUG, "WPA: Encrypted Key Data from SIV",
- key_data, AES_BLOCK_SIZE + key_data_len);
-
- os_free(msg);
- msg = buf;
- msg_len = buf_len;
-#else /* CONFIG_FILS */
+ if (key_mic &&
+ wpa_eapol_key_mic(kck, kck_len, sm->key_mgmt, ver, msg, msg_len,
+ key_mic)) {
+ wpa_msg(sm->ctx->msg_ctx, MSG_ERROR,
+ "WPA: Failed to generate EAPOL-Key version %d key_mgmt 0x%x MIC",
+ ver, sm->key_mgmt);
goto out;
-#endif /* CONFIG_FILS */
}
-
+ wpa_hexdump_key(MSG_DEBUG, "WPA: KCK", kck, kck_len);
+ wpa_hexdump(MSG_DEBUG, "WPA: Derived Key MIC", key_mic, mic_len);
wpa_hexdump(MSG_MSGDUMP, "WPA: TX EAPOL-Key", msg, msg_len);
ret = wpa_sm_ether_send(sm, dest, proto, msg, msg_len);
eapol_sm_notify_tx_eapol_key(sm->eapol);
@@ -170,8 +97,9 @@
{
size_t mic_len, hdrlen, rlen;
struct wpa_eapol_key *reply;
+ struct wpa_eapol_key_192 *reply192;
int key_info, ver;
- u8 bssid[ETH_ALEN], *rbuf, *key_mic, *mic;
+ u8 bssid[ETH_ALEN], *rbuf, *key_mic;
if (sm->key_mgmt == WPA_KEY_MGMT_OSEN ||
wpa_key_mgmt_suite_b(sm->key_mgmt))
@@ -191,20 +119,19 @@
}
mic_len = wpa_mic_len(sm->key_mgmt);
- hdrlen = sizeof(*reply) + mic_len + 2;
+ hdrlen = mic_len == 24 ? sizeof(*reply192) : sizeof(*reply);
rbuf = wpa_sm_alloc_eapol(sm, IEEE802_1X_TYPE_EAPOL_KEY, NULL,
hdrlen, &rlen, (void *) &reply);
if (rbuf == NULL)
return;
+ reply192 = (struct wpa_eapol_key_192 *) reply;
reply->type = (sm->proto == WPA_PROTO_RSN ||
sm->proto == WPA_PROTO_OSEN) ?
EAPOL_KEY_TYPE_RSN : EAPOL_KEY_TYPE_WPA;
key_info = WPA_KEY_INFO_REQUEST | ver;
if (sm->ptk_set)
- key_info |= WPA_KEY_INFO_SECURE;
- if (sm->ptk_set && mic_len)
- key_info |= WPA_KEY_INFO_MIC;
+ key_info |= WPA_KEY_INFO_MIC | WPA_KEY_INFO_SECURE;
if (error)
key_info |= WPA_KEY_INFO_ERROR;
if (pairwise)
@@ -215,19 +142,21 @@
WPA_REPLAY_COUNTER_LEN);
inc_byte_array(sm->request_counter, WPA_REPLAY_COUNTER_LEN);
- mic = (u8 *) (reply + 1);
- WPA_PUT_BE16(mic + mic_len, 0);
+ if (mic_len == 24)
+ WPA_PUT_BE16(reply192->key_data_length, 0);
+ else
+ WPA_PUT_BE16(reply->key_data_length, 0);
if (!(key_info & WPA_KEY_INFO_MIC))
key_mic = NULL;
else
- key_mic = mic;
+ key_mic = reply192->key_mic; /* same offset in reply */
wpa_msg(sm->ctx->msg_ctx, MSG_INFO,
"WPA: Sending EAPOL-Key Request (error=%d "
"pairwise=%d ptk_set=%d len=%lu)",
error, pairwise, sm->ptk_set, (unsigned long) rlen);
- wpa_eapol_key_send(sm, &sm->ptk, ver, bssid, ETH_P_EAPOL, rbuf, rlen,
- key_mic);
+ wpa_eapol_key_send(sm, sm->ptk.kck, sm->ptk.kck_len, ver, bssid,
+ ETH_P_EAPOL, rbuf, rlen, key_mic);
}
@@ -412,9 +341,9 @@
{
size_t mic_len, hdrlen, rlen;
struct wpa_eapol_key *reply;
+ struct wpa_eapol_key_192 *reply192;
u8 *rbuf, *key_mic;
u8 *rsn_ie_buf = NULL;
- u16 key_info;
if (wpa_ie == NULL) {
wpa_msg(sm->ctx->msg_ctx, MSG_WARNING, "WPA: No wpa_ie set - "
@@ -455,7 +384,7 @@
wpa_hexdump(MSG_DEBUG, "WPA: WPA IE for msg 2/4", wpa_ie, wpa_ie_len);
mic_len = wpa_mic_len(sm->key_mgmt);
- hdrlen = sizeof(*reply) + mic_len + 2;
+ hdrlen = mic_len == 24 ? sizeof(*reply192) : sizeof(*reply);
rbuf = wpa_sm_alloc_eapol(sm, IEEE802_1X_TYPE_EAPOL_KEY,
NULL, hdrlen + wpa_ie_len,
&rlen, (void *) &reply);
@@ -463,16 +392,13 @@
os_free(rsn_ie_buf);
return -1;
}
+ reply192 = (struct wpa_eapol_key_192 *) reply;
reply->type = (sm->proto == WPA_PROTO_RSN ||
sm->proto == WPA_PROTO_OSEN) ?
EAPOL_KEY_TYPE_RSN : EAPOL_KEY_TYPE_WPA;
- key_info = ver | WPA_KEY_INFO_KEY_TYPE;
- if (mic_len)
- key_info |= WPA_KEY_INFO_MIC;
- else
- key_info |= WPA_KEY_INFO_ENCR_KEY_DATA;
- WPA_PUT_BE16(reply->key_info, key_info);
+ WPA_PUT_BE16(reply->key_info,
+ ver | WPA_KEY_INFO_KEY_TYPE | WPA_KEY_INFO_MIC);
if (sm->proto == WPA_PROTO_RSN || sm->proto == WPA_PROTO_OSEN)
WPA_PUT_BE16(reply->key_length, 0);
else
@@ -482,16 +408,21 @@
wpa_hexdump(MSG_DEBUG, "WPA: Replay Counter", reply->replay_counter,
WPA_REPLAY_COUNTER_LEN);
- key_mic = (u8 *) (reply + 1);
- WPA_PUT_BE16(key_mic + mic_len, wpa_ie_len); /* Key Data Length */
- os_memcpy(key_mic + mic_len + 2, wpa_ie, wpa_ie_len); /* Key Data */
+ key_mic = reply192->key_mic; /* same offset for reply and reply192 */
+ if (mic_len == 24) {
+ WPA_PUT_BE16(reply192->key_data_length, wpa_ie_len);
+ os_memcpy(reply192 + 1, wpa_ie, wpa_ie_len);
+ } else {
+ WPA_PUT_BE16(reply->key_data_length, wpa_ie_len);
+ os_memcpy(reply + 1, wpa_ie, wpa_ie_len);
+ }
os_free(rsn_ie_buf);
os_memcpy(reply->key_nonce, nonce, WPA_NONCE_LEN);
wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, "WPA: Sending EAPOL-Key 2/4");
- return wpa_eapol_key_send(sm, ptk, ver, dst, ETH_P_EAPOL, rbuf, rlen,
- key_mic);
+ return wpa_eapol_key_send(sm, ptk->kck, ptk->kck_len, ver, dst,
+ ETH_P_EAPOL, rbuf, rlen, key_mic);
}
@@ -1216,24 +1147,22 @@
{
size_t mic_len, hdrlen, rlen;
struct wpa_eapol_key *reply;
+ struct wpa_eapol_key_192 *reply192;
u8 *rbuf, *key_mic;
mic_len = wpa_mic_len(sm->key_mgmt);
- hdrlen = sizeof(*reply) + mic_len + 2;
+ hdrlen = mic_len == 24 ? sizeof(*reply192) : sizeof(*reply);
rbuf = wpa_sm_alloc_eapol(sm, IEEE802_1X_TYPE_EAPOL_KEY, NULL,
hdrlen, &rlen, (void *) &reply);
if (rbuf == NULL)
return -1;
+ reply192 = (struct wpa_eapol_key_192 *) reply;
reply->type = (sm->proto == WPA_PROTO_RSN ||
sm->proto == WPA_PROTO_OSEN) ?
EAPOL_KEY_TYPE_RSN : EAPOL_KEY_TYPE_WPA;
key_info &= WPA_KEY_INFO_SECURE;
- key_info |= ver | WPA_KEY_INFO_KEY_TYPE;
- if (mic_len)
- key_info |= WPA_KEY_INFO_MIC;
- else
- key_info |= WPA_KEY_INFO_ENCR_KEY_DATA;
+ key_info |= ver | WPA_KEY_INFO_KEY_TYPE | WPA_KEY_INFO_MIC;
WPA_PUT_BE16(reply->key_info, key_info);
if (sm->proto == WPA_PROTO_RSN || sm->proto == WPA_PROTO_OSEN)
WPA_PUT_BE16(reply->key_length, 0);
@@ -1242,12 +1171,15 @@
os_memcpy(reply->replay_counter, key->replay_counter,
WPA_REPLAY_COUNTER_LEN);
- key_mic = (u8 *) (reply + 1);
- WPA_PUT_BE16(key_mic + mic_len, 0);
+ key_mic = reply192->key_mic; /* same offset for reply and reply192 */
+ if (mic_len == 24)
+ WPA_PUT_BE16(reply192->key_data_length, 0);
+ else
+ WPA_PUT_BE16(reply->key_data_length, 0);
wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, "WPA: Sending EAPOL-Key 4/4");
- return wpa_eapol_key_send(sm, ptk, ver, dst, ETH_P_EAPOL, rbuf, rlen,
- key_mic);
+ return wpa_eapol_key_send(sm, ptk->kck, ptk->kck_len, ver, dst,
+ ETH_P_EAPOL, rbuf, rlen, key_mic);
}
@@ -1524,22 +1456,22 @@
{
size_t mic_len, hdrlen, rlen;
struct wpa_eapol_key *reply;
+ struct wpa_eapol_key_192 *reply192;
u8 *rbuf, *key_mic;
mic_len = wpa_mic_len(sm->key_mgmt);
- hdrlen = sizeof(*reply) + mic_len + 2;
+ hdrlen = mic_len == 24 ? sizeof(*reply192) : sizeof(*reply);
rbuf = wpa_sm_alloc_eapol(sm, IEEE802_1X_TYPE_EAPOL_KEY, NULL,
hdrlen, &rlen, (void *) &reply);
if (rbuf == NULL)
return -1;
+ reply192 = (struct wpa_eapol_key_192 *) reply;
reply->type = (sm->proto == WPA_PROTO_RSN ||
sm->proto == WPA_PROTO_OSEN) ?
EAPOL_KEY_TYPE_RSN : EAPOL_KEY_TYPE_WPA;
key_info &= WPA_KEY_INFO_KEY_INDEX_MASK;
- key_info |= ver | WPA_KEY_INFO_SECURE;
- if (mic_len)
- key_info |= WPA_KEY_INFO_MIC;
+ key_info |= ver | WPA_KEY_INFO_MIC | WPA_KEY_INFO_SECURE;
WPA_PUT_BE16(reply->key_info, key_info);
if (sm->proto == WPA_PROTO_RSN || sm->proto == WPA_PROTO_OSEN)
WPA_PUT_BE16(reply->key_length, 0);
@@ -1548,12 +1480,15 @@
os_memcpy(reply->replay_counter, key->replay_counter,
WPA_REPLAY_COUNTER_LEN);
- key_mic = (u8 *) (reply + 1);
- WPA_PUT_BE16(key_mic + mic_len, 0);
+ key_mic = reply192->key_mic; /* same offset for reply and reply192 */
+ if (mic_len == 24)
+ WPA_PUT_BE16(reply192->key_data_length, 0);
+ else
+ WPA_PUT_BE16(reply->key_data_length, 0);
wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, "WPA: Sending EAPOL-Key 2/2");
- return wpa_eapol_key_send(sm, &sm->ptk, ver, sm->bssid, ETH_P_EAPOL,
- rbuf, rlen, key_mic);
+ return wpa_eapol_key_send(sm, sm->ptk.kck, sm->ptk.kck_len, ver,
+ sm->bssid, ETH_P_EAPOL, rbuf, rlen, key_mic);
}
@@ -1629,7 +1564,7 @@
static int wpa_supplicant_verify_eapol_key_mic(struct wpa_sm *sm,
- struct wpa_eapol_key *key,
+ struct wpa_eapol_key_192 *key,
u16 ver,
const u8 *buf, size_t len)
{
@@ -1637,12 +1572,12 @@
int ok = 0;
size_t mic_len = wpa_mic_len(sm->key_mgmt);
- os_memcpy(mic, key + 1, mic_len);
+ os_memcpy(mic, key->key_mic, mic_len);
if (sm->tptk_set) {
- os_memset(key + 1, 0, mic_len);
+ os_memset(key->key_mic, 0, mic_len);
wpa_eapol_key_mic(sm->tptk.kck, sm->tptk.kck_len, sm->key_mgmt,
- ver, buf, len, (u8 *) (key + 1));
- if (os_memcmp_const(mic, key + 1, mic_len) != 0) {
+ ver, buf, len, key->key_mic);
+ if (os_memcmp_const(mic, key->key_mic, mic_len) != 0) {
wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
"WPA: Invalid EAPOL-Key MIC "
"when using TPTK - ignoring TPTK");
@@ -1656,10 +1591,10 @@
}
if (!ok && sm->ptk_set) {
- os_memset(key + 1, 0, mic_len);
+ os_memset(key->key_mic, 0, mic_len);
wpa_eapol_key_mic(sm->ptk.kck, sm->ptk.kck_len, sm->key_mgmt,
- ver, buf, len, (u8 *) (key + 1));
- if (os_memcmp_const(mic, key + 1, mic_len) != 0) {
+ ver, buf, len, key->key_mic);
+ if (os_memcmp_const(mic, key->key_mic, mic_len) != 0) {
wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
"WPA: Invalid EAPOL-Key MIC - "
"dropping packet");
@@ -1684,8 +1619,7 @@
/* Decrypt RSN EAPOL-Key key data (RC4 or AES-WRAP) */
static int wpa_supplicant_decrypt_key_data(struct wpa_sm *sm,
- struct wpa_eapol_key *key,
- size_t mic_len, u16 ver,
+ struct wpa_eapol_key *key, u16 ver,
u8 *key_data, size_t *key_data_len)
{
wpa_hexdump(MSG_DEBUG, "RSN: encrypted key data",
@@ -1744,7 +1678,7 @@
}
os_memcpy(key_data, buf, *key_data_len);
bin_clear_free(buf, *key_data_len);
- WPA_PUT_BE16(((u8 *) (key + 1)) + mic_len, *key_data_len);
+ WPA_PUT_BE16(key->key_data_length, *key_data_len);
} else {
wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
"WPA: Unsupported key_info type %d", ver);
@@ -1807,76 +1741,6 @@
}
-#ifdef CONFIG_FILS
-static int wpa_supp_aead_decrypt(struct wpa_sm *sm, u8 *buf, size_t buf_len,
- size_t *key_data_len)
-{
- struct wpa_ptk *ptk;
- struct ieee802_1x_hdr *hdr;
- struct wpa_eapol_key *key;
- u8 *pos, *tmp;
- const u8 *aad[1];
- size_t aad_len[1];
-
- if (*key_data_len < AES_BLOCK_SIZE) {
- wpa_printf(MSG_INFO, "No room for AES-SIV data in the frame");
- return -1;
- }
-
- if (sm->tptk_set)
- ptk = &sm->tptk;
- else if (sm->ptk_set)
- ptk = &sm->ptk;
- else
- return -1;
-
- hdr = (struct ieee802_1x_hdr *) buf;
- key = (struct wpa_eapol_key *) (hdr + 1);
- pos = (u8 *) (key + 1);
- pos += 2; /* Pointing at the Encrypted Key Data field */
-
- tmp = os_malloc(*key_data_len);
- if (!tmp)
- return -1;
-
- /* AES-SIV AAD from EAPOL protocol version field (inclusive) to
- * to Key Data (exclusive). */
- aad[0] = buf;
- aad_len[0] = pos - buf;
- if (aes_siv_decrypt(ptk->kek, ptk->kek_len, pos, *key_data_len,
- 1, aad, aad_len, tmp) < 0) {
- wpa_printf(MSG_INFO, "Invalid AES-SIV data in the frame");
- bin_clear_free(tmp, *key_data_len);
- return -1;
- }
-
- /* AEAD decryption and validation completed successfully */
- (*key_data_len) -= AES_BLOCK_SIZE;
- wpa_hexdump_key(MSG_DEBUG, "WPA: Decrypted Key Data",
- tmp, *key_data_len);
-
- /* Replace Key Data field with the decrypted version */
- os_memcpy(pos, tmp, *key_data_len);
- pos -= 2; /* Key Data Length field */
- WPA_PUT_BE16(pos, *key_data_len);
- bin_clear_free(tmp, *key_data_len);
-
- if (sm->tptk_set) {
- sm->tptk_set = 0;
- sm->ptk_set = 1;
- os_memcpy(&sm->ptk, &sm->tptk, sizeof(sm->ptk));
- os_memset(&sm->tptk, 0, sizeof(sm->tptk));
- }
-
- os_memcpy(sm->rx_replay_counter, key->replay_counter,
- WPA_REPLAY_COUNTER_LEN);
- sm->rx_replay_counter_set = 1;
-
- return 0;
-}
-#endif /* CONFIG_FILS */
-
-
/**
* wpa_sm_rx_eapol - Process received WPA EAPOL frames
* @sm: Pointer to WPA state machine data from wpa_sm_init()
@@ -1899,11 +1763,12 @@
size_t plen, data_len, key_data_len;
const struct ieee802_1x_hdr *hdr;
struct wpa_eapol_key *key;
+ struct wpa_eapol_key_192 *key192;
u16 key_info, ver;
u8 *tmp = NULL;
int ret = -1;
struct wpa_peerkey *peerkey = NULL;
- u8 *mic, *key_data;
+ u8 *key_data;
size_t mic_len, keyhdrlen;
#ifdef CONFIG_IEEE80211R
@@ -1911,7 +1776,7 @@
#endif /* CONFIG_IEEE80211R */
mic_len = wpa_mic_len(sm->key_mgmt);
- keyhdrlen = sizeof(*key) + mic_len + 2;
+ keyhdrlen = mic_len == 24 ? sizeof(*key192) : sizeof(*key);
if (len < sizeof(*hdr) + keyhdrlen) {
wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG,
@@ -1963,8 +1828,12 @@
goto out;
os_memcpy(tmp, buf, data_len);
key = (struct wpa_eapol_key *) (tmp + sizeof(struct ieee802_1x_hdr));
- mic = (u8 *) (key + 1);
- key_data = mic + mic_len + 2;
+ key192 = (struct wpa_eapol_key_192 *)
+ (tmp + sizeof(struct ieee802_1x_hdr));
+ if (mic_len == 24)
+ key_data = (u8 *) (key192 + 1);
+ else
+ key_data = (u8 *) (key + 1);
if (key->type != EAPOL_KEY_TYPE_WPA && key->type != EAPOL_KEY_TYPE_RSN)
{
@@ -1975,8 +1844,11 @@
goto out;
}
- key_data_len = WPA_GET_BE16(mic + mic_len);
- wpa_eapol_key_dump(sm, key, key_data_len, mic, mic_len);
+ if (mic_len == 24)
+ key_data_len = WPA_GET_BE16(key192->key_data_length);
+ else
+ key_data_len = WPA_GET_BE16(key->key_data_length);
+ wpa_eapol_key_dump(sm, key, key_data_len, key192->key_mic, mic_len);
if (key_data_len > plen - keyhdrlen) {
wpa_msg(sm->ctx->msg_ctx, MSG_INFO, "WPA: Invalid EAPOL-Key "
@@ -1995,7 +1867,6 @@
#endif /* CONFIG_IEEE80211R || CONFIG_IEEE80211W */
ver != WPA_KEY_INFO_TYPE_HMAC_SHA1_AES &&
!wpa_key_mgmt_suite_b(sm->key_mgmt) &&
- !wpa_key_mgmt_fils(sm->key_mgmt) &&
sm->key_mgmt != WPA_KEY_MGMT_OSEN) {
wpa_msg(sm->ctx->msg_ctx, MSG_INFO,
"WPA: Unsupported EAPOL-Key descriptor version %d",
@@ -2011,8 +1882,7 @@
goto out;
}
- if ((wpa_key_mgmt_suite_b(sm->key_mgmt) ||
- wpa_key_mgmt_fils(sm->key_mgmt)) &&
+ if (wpa_key_mgmt_suite_b(sm->key_mgmt) &&
ver != WPA_KEY_INFO_TYPE_AKM_DEFINED) {
wpa_msg(sm->ctx->msg_ctx, MSG_INFO,
"RSN: Unsupported EAPOL-Key descriptor version %d (expected AKM defined = 0)",
@@ -2034,7 +1904,6 @@
if (wpa_key_mgmt_sha256(sm->key_mgmt)) {
if (ver != WPA_KEY_INFO_TYPE_AES_128_CMAC &&
sm->key_mgmt != WPA_KEY_MGMT_OSEN &&
- !wpa_key_mgmt_fils(sm->key_mgmt) &&
!wpa_key_mgmt_suite_b(sm->key_mgmt)) {
wpa_msg(sm->ctx->msg_ctx, MSG_INFO,
"WPA: AP did not use the "
@@ -2045,7 +1914,6 @@
#endif /* CONFIG_IEEE80211W */
if (sm->pairwise_cipher == WPA_CIPHER_CCMP &&
!wpa_key_mgmt_suite_b(sm->key_mgmt) &&
- !wpa_key_mgmt_fils(sm->key_mgmt) &&
ver != WPA_KEY_INFO_TYPE_HMAC_SHA1_AES) {
wpa_msg(sm->ctx->msg_ctx, MSG_INFO,
"WPA: CCMP is used, but EAPOL-Key "
@@ -2136,27 +2004,19 @@
}
if ((key_info & WPA_KEY_INFO_MIC) && !peerkey &&
- wpa_supplicant_verify_eapol_key_mic(sm, key, ver, tmp, data_len))
+ wpa_supplicant_verify_eapol_key_mic(sm, key192, ver, tmp, data_len))
goto out;
#ifdef CONFIG_PEERKEY
if ((key_info & WPA_KEY_INFO_MIC) && peerkey &&
- peerkey_verify_eapol_key_mic(sm, peerkey, key, ver, tmp,
+ peerkey_verify_eapol_key_mic(sm, peerkey, key192, ver, tmp,
data_len))
goto out;
#endif /* CONFIG_PEERKEY */
-#ifdef CONFIG_FILS
- if (!mic_len && (key_info & WPA_KEY_INFO_ENCR_KEY_DATA)) {
- if (wpa_supp_aead_decrypt(sm, tmp, data_len, &key_data_len))
- goto out;
- }
-#endif /* CONFIG_FILS */
-
if ((sm->proto == WPA_PROTO_RSN || sm->proto == WPA_PROTO_OSEN) &&
- (key_info & WPA_KEY_INFO_ENCR_KEY_DATA) && mic_len) {
- if (wpa_supplicant_decrypt_key_data(sm, key, mic_len,
- ver, key_data,
+ (key_info & WPA_KEY_INFO_ENCR_KEY_DATA)) {
+ if (wpa_supplicant_decrypt_key_data(sm, key, ver, key_data,
&key_data_len))
goto out;
}
@@ -2172,8 +2032,7 @@
/* PeerKey 4-Way Handshake */
peerkey_rx_eapol_4way(sm, peerkey, key, key_info, ver,
key_data, key_data_len);
- } else if (key_info & (WPA_KEY_INFO_MIC |
- WPA_KEY_INFO_ENCR_KEY_DATA)) {
+ } else if (key_info & WPA_KEY_INFO_MIC) {
/* 3/4 4-Way Handshake */
wpa_supplicant_process_3_of_4(sm, key, ver, key_data,
key_data_len);
@@ -2188,15 +2047,14 @@
peerkey_rx_eapol_smk(sm, src_addr, key, key_data_len, key_info,
ver);
} else {
- if ((mic_len && (key_info & WPA_KEY_INFO_MIC)) ||
- (!mic_len && (key_info & WPA_KEY_INFO_ENCR_KEY_DATA))) {
+ if (key_info & WPA_KEY_INFO_MIC) {
/* 1/2 Group Key Handshake */
wpa_supplicant_process_1_of_2(sm, src_addr, key,
key_data, key_data_len,
ver);
} else {
wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
- "WPA: EAPOL-Key (Group) without Mic/Encr bit - "
+ "WPA: EAPOL-Key (Group) without Mic bit - "
"dropped");
}
}
@@ -2478,16 +2336,6 @@
clear_ptk = 0;
}
#endif /* CONFIG_IEEE80211R */
-#ifdef CONFIG_FILS
- if (sm->fils_completed) {
- /*
- * Clear portValid to kick EAPOL state machine to re-enter
- * AUTHENTICATED state to get the EAPOL port Authorized.
- */
- wpa_supplicant_key_neg_complete(sm, sm->bssid, 1);
- clear_ptk = 0;
- }
-#endif /* CONFIG_FILS */
if (clear_ptk) {
/*
@@ -2530,9 +2378,6 @@
#ifdef CONFIG_TDLS
wpa_tdls_disassoc(sm);
#endif /* CONFIG_TDLS */
-#ifdef CONFIG_FILS
- sm->fils_completed = 0;
-#endif /* CONFIG_FILS */
/* Keys are not needed in the WPA state machine anymore */
wpa_sm_drop_sa(sm);
@@ -2881,10 +2726,6 @@
os_memcpy(sm->assoc_wpa_ie, wpa_ie, *wpa_ie_len);
sm->assoc_wpa_ie_len = *wpa_ie_len;
- } else {
- wpa_hexdump(MSG_DEBUG,
- "WPA: Leave previously set WPA IE default",
- sm->assoc_wpa_ie, sm->assoc_wpa_ie_len);
}
return 0;
@@ -3213,441 +3054,3 @@
sm->test_assoc_ie = buf;
}
#endif /* CONFIG_TESTING_OPTIONS */
-
-
-#ifdef CONFIG_FILS
-
-struct wpabuf * fils_build_auth(struct wpa_sm *sm)
-{
- struct wpabuf *buf = NULL;
- struct wpabuf *erp_msg;
-
- erp_msg = eapol_sm_build_erp_reauth_start(sm->eapol);
- if (!erp_msg && !sm->cur_pmksa) {
- wpa_printf(MSG_DEBUG,
- "FILS: Neither ERP EAP-Initiate/Re-auth nor PMKSA cache entry is available - skip FILS");
- goto fail;
- }
-
- wpa_printf(MSG_DEBUG, "FILS: Try to use FILS (erp=%d pmksa_cache=%d)",
- erp_msg != NULL, sm->cur_pmksa != NULL);
-
- sm->fils_completed = 0;
-
- if (!sm->assoc_wpa_ie) {
- wpa_printf(MSG_INFO, "FILS: No own RSN IE set for FILS");
- goto fail;
- }
-
- if (random_get_bytes(sm->fils_nonce, FILS_NONCE_LEN) < 0 ||
- random_get_bytes(sm->fils_session, FILS_SESSION_LEN) < 0)
- goto fail;
-
- wpa_hexdump(MSG_DEBUG, "FILS: Generated FILS Nonce",
- sm->fils_nonce, FILS_NONCE_LEN);
- wpa_hexdump(MSG_DEBUG, "FILS: Generated FILS Session",
- sm->fils_session, FILS_SESSION_LEN);
-
- buf = wpabuf_alloc(1000 + sm->assoc_wpa_ie_len);
- if (!buf)
- goto fail;
-
- /* Fields following the Authentication algorithm number field */
-
- /* Authentication Transaction seq# */
- wpabuf_put_le16(buf, 1);
-
- /* Status Code */
- wpabuf_put_le16(buf, WLAN_STATUS_SUCCESS);
-
- /* TODO: Finite Cyclic Group when using PK or PFS */
- /* TODO: Element when using PK or PFS */
-
- /* RSNE */
- wpa_hexdump(MSG_DEBUG, "FILS: RSNE in FILS Authentication frame",
- sm->assoc_wpa_ie, sm->assoc_wpa_ie_len);
- wpabuf_put_data(buf, sm->assoc_wpa_ie, sm->assoc_wpa_ie_len);
-
- /* TODO: MDE when using FILS for FT initial association */
- /* TODO: FTE when using FILS for FT initial association */
-
- /* FILS Nonce */
- wpabuf_put_u8(buf, WLAN_EID_EXTENSION); /* Element ID */
- wpabuf_put_u8(buf, 1 + FILS_NONCE_LEN); /* Length */
- /* Element ID Extension */
- wpabuf_put_u8(buf, WLAN_EID_EXT_FILS_NONCE);
- wpabuf_put_data(buf, sm->fils_nonce, FILS_NONCE_LEN);
-
- /* FILS Session */
- wpabuf_put_u8(buf, WLAN_EID_EXTENSION); /* Element ID */
- wpabuf_put_u8(buf, 1 + FILS_SESSION_LEN); /* Length */
- /* Element ID Extension */
- wpabuf_put_u8(buf, WLAN_EID_EXT_FILS_SESSION);
- wpabuf_put_data(buf, sm->fils_session, FILS_SESSION_LEN);
-
- /* FILS Wrapped Data */
- if (erp_msg) {
- wpabuf_put_u8(buf, WLAN_EID_EXTENSION); /* Element ID */
- wpabuf_put_u8(buf, 1 + wpabuf_len(erp_msg)); /* Length */
- /* Element ID Extension */
- wpabuf_put_u8(buf, WLAN_EID_EXT_FILS_WRAPPED_DATA);
- wpabuf_put_buf(buf, erp_msg);
- }
-
- wpa_hexdump_buf(MSG_DEBUG, "RSN: FILS fields for Authentication frame",
- buf);
-
-fail:
- wpabuf_free(erp_msg);
- return buf;
-}
-
-
-int fils_process_auth(struct wpa_sm *sm, const u8 *data, size_t len)
-{
- const u8 *pos, *end;
- struct ieee802_11_elems elems;
- struct wpa_ie_data rsn;
- int pmkid_match = 0;
- u8 ick[FILS_ICK_MAX_LEN];
- size_t ick_len;
- int res;
-
- wpa_hexdump(MSG_DEBUG, "FILS: Authentication frame fields",
- data, len);
- pos = data;
- end = data + len;
-
- /* TODO: Finite Cyclic Group when using PK or PFS */
- /* TODO: Element when using PK or PFS */
-
- wpa_hexdump(MSG_DEBUG, "FILS: Remaining IEs", pos, end - pos);
- if (ieee802_11_parse_elems(pos, end - pos, &elems, 1) == ParseFailed) {
- wpa_printf(MSG_DEBUG, "FILS: Could not parse elements");
- return -1;
- }
-
- /* RSNE */
- wpa_hexdump(MSG_DEBUG, "FILS: RSN element", elems.rsn_ie,
- elems.rsn_ie_len);
- if (!elems.rsn_ie ||
- wpa_parse_wpa_ie_rsn(elems.rsn_ie - 2, elems.rsn_ie_len + 2,
- &rsn) < 0) {
- wpa_printf(MSG_DEBUG, "FILS: No RSN element");
- return -1;
- }
-
- if (!elems.fils_nonce) {
- wpa_printf(MSG_DEBUG, "FILS: No FILS Nonce field");
- return -1;
- }
- os_memcpy(sm->fils_anonce, elems.fils_nonce, FILS_NONCE_LEN);
- wpa_hexdump(MSG_DEBUG, "FILS: ANonce", sm->fils_anonce, FILS_NONCE_LEN);
-
- /* TODO: MDE when using FILS+FT */
- /* TODO: FTE when using FILS+FT */
-
- /* PMKID List */
- if (rsn.pmkid && rsn.num_pmkid > 0) {
- wpa_hexdump(MSG_DEBUG, "FILS: PMKID List",
- rsn.pmkid, rsn.num_pmkid * PMKID_LEN);
-
- if (rsn.num_pmkid != 1) {
- wpa_printf(MSG_DEBUG, "FILS: Invalid PMKID selection");
- return -1;
- }
- wpa_hexdump(MSG_DEBUG, "FILS: PMKID", rsn.pmkid, PMKID_LEN);
- if (os_memcmp(sm->cur_pmksa->pmkid, rsn.pmkid, PMKID_LEN) != 0)
- {
- wpa_printf(MSG_DEBUG, "FILS: PMKID mismatch");
- wpa_hexdump(MSG_DEBUG, "FILS: Expected PMKID",
- sm->cur_pmksa->pmkid, PMKID_LEN);
- return -1;
- }
- wpa_printf(MSG_DEBUG,
- "FILS: Matching PMKID - continue using PMKSA caching");
- pmkid_match = 1;
- }
- if (!pmkid_match && sm->cur_pmksa) {
- wpa_printf(MSG_DEBUG,
- "FILS: No PMKID match - cannot use cached PMKSA entry");
- sm->cur_pmksa = NULL;
- }
-
- /* FILS Session */
- if (!elems.fils_session) {
- wpa_printf(MSG_DEBUG, "FILS: No FILS Session element");
- return -1;
- }
- wpa_hexdump(MSG_DEBUG, "FILS: FILS Session", elems.fils_session,
- FILS_SESSION_LEN);
- if (os_memcmp(sm->fils_session, elems.fils_session, FILS_SESSION_LEN)
- != 0) {
- wpa_printf(MSG_DEBUG, "FILS: Session mismatch");
- wpa_hexdump(MSG_DEBUG, "FILS: Expected FILS Session",
- sm->fils_session, FILS_SESSION_LEN);
- return -1;
- }
-
- /* FILS Wrapped Data */
- if (!sm->cur_pmksa && elems.fils_wrapped_data) {
- wpa_hexdump(MSG_DEBUG, "FILS: Wrapped Data",
- elems.fils_wrapped_data,
- elems.fils_wrapped_data_len);
- eapol_sm_process_erp_finish(sm->eapol, elems.fils_wrapped_data,
- elems.fils_wrapped_data_len);
- if (eapol_sm_failed(sm->eapol))
- return -1;
-
- res = eapol_sm_get_key(sm->eapol, sm->pmk, PMK_LEN);
- if (res)
- return -1;
-
- wpa_printf(MSG_DEBUG, "FILS: ERP processing succeeded - add PMKSA cache entry for the result");
- sm->cur_pmksa = pmksa_cache_add(sm->pmksa, sm->pmk, PMK_LEN,
- NULL, NULL, 0, sm->bssid,
- sm->own_addr,
- sm->network_ctx, sm->key_mgmt);
- }
-
- if (!sm->cur_pmksa) {
- wpa_printf(MSG_DEBUG,
- "FILS: No remaining options to continue FILS authentication");
- return -1;
- }
-
- if (fils_pmk_to_ptk(sm->pmk, sm->pmk_len, sm->own_addr, sm->bssid,
- sm->fils_nonce, sm->fils_anonce, &sm->ptk,
- ick, &ick_len, sm->key_mgmt, sm->pairwise_cipher) <
- 0) {
- wpa_printf(MSG_DEBUG, "FILS: Failed to derive PTK");
- return -1;
- }
- sm->ptk_set = 1;
- sm->tptk_set = 0;
- os_memset(&sm->tptk, 0, sizeof(sm->tptk));
-
- res = fils_key_auth_sk(ick, ick_len, sm->fils_nonce,
- sm->fils_anonce, sm->own_addr, sm->bssid,
- NULL, 0, NULL, 0, /* TODO: SK+PFS */
- sm->key_mgmt, sm->fils_key_auth_sta,
- sm->fils_key_auth_ap,
- &sm->fils_key_auth_len);
- os_memset(ick, 0, sizeof(ick));
- return res;
-}
-
-
-struct wpabuf * fils_build_assoc_req(struct wpa_sm *sm, const u8 **kek,
- size_t *kek_len, const u8 **snonce,
- const u8 **anonce)
-{
- struct wpabuf *buf;
-
- buf = wpabuf_alloc(1000);
- if (!buf)
- return NULL;
-
- /* FILS Session */
- wpabuf_put_u8(buf, WLAN_EID_EXTENSION); /* Element ID */
- wpabuf_put_u8(buf, 1 + FILS_SESSION_LEN); /* Length */
- /* Element ID Extension */
- wpabuf_put_u8(buf, WLAN_EID_EXT_FILS_SESSION);
- wpabuf_put_data(buf, sm->fils_session, FILS_SESSION_LEN);
-
- /* Everything after FILS Session element gets encrypted in the driver
- * with KEK. The buffer returned from here is the plaintext version. */
-
- /* TODO: FILS Public Key */
-
- /* FILS Key Confirm */
- wpabuf_put_u8(buf, WLAN_EID_EXTENSION); /* Element ID */
- wpabuf_put_u8(buf, 1 + sm->fils_key_auth_len); /* Length */
- /* Element ID Extension */
- wpabuf_put_u8(buf, WLAN_EID_EXT_FILS_KEY_CONFIRM);
- wpabuf_put_data(buf, sm->fils_key_auth_sta, sm->fils_key_auth_len);
-
- /* TODO: FILS HLP Container */
-
- /* TODO: FILS IP Address Assignment */
-
- wpa_hexdump_buf(MSG_DEBUG, "FILS: Association Request plaintext", buf);
-
- *kek = sm->ptk.kek;
- *kek_len = sm->ptk.kek_len;
- wpa_hexdump_key(MSG_DEBUG, "FILS: KEK for AEAD", *kek, *kek_len);
- *snonce = sm->fils_nonce;
- wpa_hexdump(MSG_DEBUG, "FILS: SNonce for AEAD AAD",
- *snonce, FILS_NONCE_LEN);
- *anonce = sm->fils_anonce;
- wpa_hexdump(MSG_DEBUG, "FILS: ANonce for AEAD AAD",
- *anonce, FILS_NONCE_LEN);
-
- return buf;
-}
-
-
-int fils_process_assoc_resp(struct wpa_sm *sm, const u8 *resp, size_t len)
-{
- const struct ieee80211_mgmt *mgmt;
- const u8 *end, *ie_start;
- struct ieee802_11_elems elems;
- int keylen, rsclen;
- enum wpa_alg alg;
- struct wpa_gtk_data gd;
- int maxkeylen;
- struct wpa_eapol_ie_parse kde;
-
- if (!sm || !sm->ptk_set) {
- wpa_printf(MSG_DEBUG, "FILS: No KEK available");
- return -1;
- }
-
- if (!wpa_key_mgmt_fils(sm->key_mgmt)) {
- wpa_printf(MSG_DEBUG, "FILS: Not a FILS AKM");
- return -1;
- }
-
- wpa_hexdump(MSG_DEBUG, "FILS: (Re)Association Response frame",
- resp, len);
-
- mgmt = (const struct ieee80211_mgmt *) resp;
- if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.assoc_resp))
- return -1;
-
- end = resp + len;
- /* Same offset for Association Response and Reassociation Response */
- ie_start = mgmt->u.assoc_resp.variable;
-
- if (ieee802_11_parse_elems(ie_start, end - ie_start, &elems, 1) ==
- ParseFailed) {
- wpa_printf(MSG_DEBUG,
- "FILS: Failed to parse decrypted elements");
- goto fail;
- }
-
- if (!elems.fils_session) {
- wpa_printf(MSG_DEBUG, "FILS: No FILS Session element");
- return -1;
- }
- if (os_memcmp(elems.fils_session, sm->fils_session,
- FILS_SESSION_LEN) != 0) {
- wpa_printf(MSG_DEBUG, "FILS: FILS Session mismatch");
- wpa_hexdump(MSG_DEBUG, "FILS: Received FILS Session",
- elems.fils_session, FILS_SESSION_LEN);
- wpa_hexdump(MSG_DEBUG, "FILS: Expected FILS Session",
- sm->fils_session, FILS_SESSION_LEN);
- }
-
- /* TODO: FILS Public Key */
-
- if (!elems.fils_key_confirm) {
- wpa_printf(MSG_DEBUG, "FILS: No FILS Key Confirm element");
- goto fail;
- }
- if (elems.fils_key_confirm_len != sm->fils_key_auth_len) {
- wpa_printf(MSG_DEBUG,
- "FILS: Unexpected Key-Auth length %d (expected %d)",
- elems.fils_key_confirm_len,
- (int) sm->fils_key_auth_len);
- goto fail;
- }
- if (os_memcmp(elems.fils_key_confirm, sm->fils_key_auth_ap,
- sm->fils_key_auth_len) != 0) {
- wpa_printf(MSG_DEBUG, "FILS: Key-Auth mismatch");
- wpa_hexdump(MSG_DEBUG, "FILS: Received Key-Auth",
- elems.fils_key_confirm,
- elems.fils_key_confirm_len);
- wpa_hexdump(MSG_DEBUG, "FILS: Expected Key-Auth",
- sm->fils_key_auth_ap, sm->fils_key_auth_len);
- goto fail;
- }
-
- /* Key Delivery */
- if (!elems.key_delivery) {
- wpa_printf(MSG_DEBUG, "FILS: No Key Delivery element");
- goto fail;
- }
-
- /* Parse GTK and set the key to the driver */
- os_memset(&gd, 0, sizeof(gd));
- if (wpa_supplicant_parse_ies(elems.key_delivery + WPA_KEY_RSC_LEN,
- elems.key_delivery_len - WPA_KEY_RSC_LEN,
- &kde) < 0) {
- wpa_printf(MSG_DEBUG, "FILS: Failed to parse KDEs");
- goto fail;
- }
- if (!kde.gtk) {
- wpa_printf(MSG_DEBUG, "FILS: No GTK KDE");
- goto fail;
- }
- maxkeylen = gd.gtk_len = kde.gtk_len - 2;
- if (wpa_supplicant_check_group_cipher(sm, sm->group_cipher,
- gd.gtk_len, maxkeylen,
- &gd.key_rsc_len, &gd.alg))
- goto fail;
-
- wpa_hexdump_key(MSG_DEBUG, "FILS: Received GTK", kde.gtk, kde.gtk_len);
- gd.keyidx = kde.gtk[0] & 0x3;
- gd.tx = wpa_supplicant_gtk_tx_bit_workaround(sm,
- !!(kde.gtk[0] & BIT(2)));
- if (kde.gtk_len - 2 > sizeof(gd.gtk)) {
- wpa_printf(MSG_DEBUG, "FILS: Too long GTK in GTK KDE (len=%lu)",
- (unsigned long) kde.gtk_len - 2);
- goto fail;
- }
- os_memcpy(gd.gtk, kde.gtk + 2, kde.gtk_len - 2);
-
- wpa_printf(MSG_DEBUG, "FILS: Set GTK to driver");
- if (wpa_supplicant_install_gtk(sm, &gd, elems.key_delivery) < 0) {
- wpa_printf(MSG_DEBUG, "FILS: Failed to set GTK");
- goto fail;
- }
-
- if (ieee80211w_set_keys(sm, &kde) < 0) {
- wpa_printf(MSG_DEBUG, "FILS: Failed to set IGTK");
- goto fail;
- }
-
- alg = wpa_cipher_to_alg(sm->pairwise_cipher);
- keylen = wpa_cipher_key_len(sm->pairwise_cipher);
- rsclen = wpa_cipher_rsc_len(sm->pairwise_cipher);
- wpa_hexdump_key(MSG_DEBUG, "FILS: Set TK to driver",
- sm->ptk.tk, keylen);
- if (wpa_sm_set_key(sm, alg, sm->bssid, 0, 1, null_rsc, rsclen,
- sm->ptk.tk, keylen) < 0) {
- wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
- "FILS: Failed to set PTK to the driver (alg=%d keylen=%d bssid="
- MACSTR ")",
- alg, keylen, MAC2STR(sm->bssid));
- goto fail;
- }
-
- /* TODO: TK could be cleared after auth frame exchange now that driver
- * takes care of association frame encryption/decryption. */
- /* TK is not needed anymore in supplicant */
- os_memset(sm->ptk.tk, 0, WPA_TK_MAX_LEN);
-
- /* TODO: FILS HLP Container */
-
- /* TODO: FILS IP Address Assignment */
-
- wpa_printf(MSG_DEBUG, "FILS: Auth+Assoc completed successfully");
- sm->fils_completed = 1;
-
- return 0;
-fail:
- return -1;
-}
-
-#endif /* CONFIG_FILS */
-
-
-int wpa_fils_is_completed(struct wpa_sm *sm)
-{
-#ifdef CONFIG_FILS
- return sm && sm->fils_completed;
-#else /* CONFIG_FILS */
- return 0;
-#endif /* CONFIG_FILS */
-}
diff --git a/src/rsn_supp/wpa.h b/src/rsn_supp/wpa.h
index 20d5b8e..0b7477f 100644
--- a/src/rsn_supp/wpa.h
+++ b/src/rsn_supp/wpa.h
@@ -426,12 +426,4 @@
int wpa_wnmsleep_install_key(struct wpa_sm *sm, u8 subelem_id, u8 *buf);
void wpa_sm_set_test_assoc_ie(struct wpa_sm *sm, struct wpabuf *buf);
-struct wpabuf * fils_build_auth(struct wpa_sm *sm);
-int fils_process_auth(struct wpa_sm *sm, const u8 *data, size_t len);
-struct wpabuf * fils_build_assoc_req(struct wpa_sm *sm, const u8 **kek,
- size_t *kek_len, const u8 **snonce,
- const u8 **anonce);
-int fils_process_assoc_resp(struct wpa_sm *sm, const u8 *resp, size_t len);
-int wpa_fils_is_completed(struct wpa_sm *sm);
-
#endif /* WPA_H */
diff --git a/src/rsn_supp/wpa_i.h b/src/rsn_supp/wpa_i.h
index 44d5424..f653ba6 100644
--- a/src/rsn_supp/wpa_i.h
+++ b/src/rsn_supp/wpa_i.h
@@ -138,16 +138,6 @@
#ifdef CONFIG_TESTING_OPTIONS
struct wpabuf *test_assoc_ie;
#endif /* CONFIG_TESTING_OPTIONS */
-
-#ifdef CONFIG_FILS
- u8 fils_nonce[FILS_NONCE_LEN];
- u8 fils_session[FILS_SESSION_LEN];
- u8 fils_anonce[FILS_NONCE_LEN];
- u8 fils_key_auth_ap[FILS_MAX_KEY_AUTH_LEN];
- u8 fils_key_auth_sta[FILS_MAX_KEY_AUTH_LEN];
- size_t fils_key_auth_len;
- unsigned int fils_completed:1;
-#endif /* CONFIG_FILS */
};
@@ -363,7 +353,7 @@
return sm->ctx->key_mgmt_set_pmk(sm->ctx->ctx, pmk, pmk_len);
}
-int wpa_eapol_key_send(struct wpa_sm *sm, struct wpa_ptk *ptk,
+int wpa_eapol_key_send(struct wpa_sm *sm, const u8 *kck, size_t kck_len,
int ver, const u8 *dest, u16 proto,
u8 *msg, size_t msg_len, u8 *key_mic);
int wpa_supplicant_send_2_of_4(struct wpa_sm *sm, const unsigned char *dst,
diff --git a/src/rsn_supp/wpa_ie.c b/src/rsn_supp/wpa_ie.c
index 3be3087..c44844e 100644
--- a/src/rsn_supp/wpa_ie.c
+++ b/src/rsn_supp/wpa_ie.c
@@ -180,18 +180,6 @@
RSN_SELECTOR_PUT(pos, RSN_AUTH_KEY_MGMT_802_1X_SUITE_B_192);
} else if (key_mgmt == WPA_KEY_MGMT_IEEE8021X_SUITE_B) {
RSN_SELECTOR_PUT(pos, RSN_AUTH_KEY_MGMT_802_1X_SUITE_B);
-#ifdef CONFIG_FILS
- } else if (key_mgmt & WPA_KEY_MGMT_FILS_SHA256) {
- RSN_SELECTOR_PUT(pos, RSN_AUTH_KEY_MGMT_FILS_SHA256);
- } else if (key_mgmt & WPA_KEY_MGMT_FILS_SHA384) {
- RSN_SELECTOR_PUT(pos, RSN_AUTH_KEY_MGMT_FILS_SHA384);
-#ifdef CONFIG_IEEE80211R
- } else if (key_mgmt & WPA_KEY_MGMT_FT_FILS_SHA256) {
- RSN_SELECTOR_PUT(pos, RSN_AUTH_KEY_MGMT_FT_FILS_SHA256);
- } else if (key_mgmt & WPA_KEY_MGMT_FT_FILS_SHA384) {
- RSN_SELECTOR_PUT(pos, RSN_AUTH_KEY_MGMT_FT_FILS_SHA384);
-#endif /* CONFIG_IEEE80211R */
-#endif /* CONFIG_FILS */
} else {
wpa_printf(MSG_WARNING, "Invalid key management type (%d).",
key_mgmt);
diff --git a/src/tls/tlsv1_common.c b/src/tls/tlsv1_common.c
index 67b55db..6b28417 100644
--- a/src/tls/tlsv1_common.c
+++ b/src/tls/tlsv1_common.c
@@ -482,21 +482,21 @@
os_memcmp(buf, "\x30\x31\x30\x0d\x06\x09\x60\x86\x48\x01"
"\x65\x03\x04\x02\x01\x05\x00\x04\x20", 19) == 0)
{
- wpa_printf(MSG_DEBUG, "TLSv1.2: DigestAlgorithm = SHA-256");
+ wpa_printf(MSG_DEBUG, "TLSv1.2: DigestAlgorithn = SHA-256");
decrypted = buf + 19;
buflen -= 19;
} else if (buflen >= 19 + 48 &&
os_memcmp(buf, "\x30\x41\x30\x0d\x06\x09\x60\x86\x48\x01"
"\x65\x03\x04\x02\x02\x05\x00\x04\x30", 19) == 0)
{
- wpa_printf(MSG_DEBUG, "TLSv1.2: DigestAlgorithm = SHA-384");
+ wpa_printf(MSG_DEBUG, "TLSv1.2: DigestAlgorithn = SHA-384");
decrypted = buf + 19;
buflen -= 19;
} else if (buflen >= 19 + 64 &&
os_memcmp(buf, "\x30\x51\x30\x0d\x06\x09\x60\x86\x48\x01"
"\x65\x03\x04\x02\x03\x05\x00\x04\x40", 19) == 0)
{
- wpa_printf(MSG_DEBUG, "TLSv1.2: DigestAlgorithm = SHA-512");
+ wpa_printf(MSG_DEBUG, "TLSv1.2: DigestAlgorithn = SHA-512");
decrypted = buf + 19;
buflen -= 19;
diff --git a/src/utils/Makefile b/src/utils/Makefile
index 52efc53..8aad813 100644
--- a/src/utils/Makefile
+++ b/src/utils/Makefile
@@ -17,7 +17,6 @@
base64.o \
bitfield.o \
common.o \
- crc32.o \
ip_addr.o \
radiotap.o \
trace.o \
diff --git a/src/utils/common.c b/src/utils/common.c
index 04a533a..68413b2 100644
--- a/src/utils/common.c
+++ b/src/utils/common.c
@@ -1001,7 +1001,7 @@
* @delim: a string of delimiters
* @last: a pointer to a character following the returned token
* It has to be set to NULL for the first call and passed for any
- * further call.
+ * futher call.
* Returns: a pointer to token position in str or NULL
*
* This function is similar to str_token, but it can be used with both
diff --git a/src/utils/crc32.h b/src/utils/crc32.h
deleted file mode 100644
index dc31399..0000000
--- a/src/utils/crc32.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * 32-bit CRC for FCS calculation
- * Copyright (c) 2010, Jouni Malinen <j@w1.fi>
- *
- * This software may be distributed under the terms of the BSD license.
- * See README for more details.
- */
-
-#ifndef CRC32_H
-#define CRC32_H
-
-u32 crc32(const u8 *frame, size_t frame_len);
-
-#endif /* CRC32_H */
diff --git a/src/utils/wpabuf.c b/src/utils/wpabuf.c
index 77ee472..96cb25c 100644
--- a/src/utils/wpabuf.c
+++ b/src/utils/wpabuf.c
@@ -244,13 +244,15 @@
if (a)
len += wpabuf_len(a);
- len += wpabuf_len(b);
+ if (b)
+ len += wpabuf_len(b);
n = wpabuf_alloc(len);
if (n) {
if (a)
wpabuf_put_buf(n, a);
- wpabuf_put_buf(n, b);
+ if (b)
+ wpabuf_put_buf(n, b);
}
wpabuf_free(a);