Remove CONFIG_IEEE80211W build parameter
Hardcode this to be defined and remove the separate build options for PMF since this functionality is needed with large number of newer protocol extensions and is also something that should be enabled in all WPA2/WPA3 networks. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
0229261874
commit
7d2ed8bae8
76 changed files with 11 additions and 537 deletions
|
@ -8,7 +8,6 @@ install:
|
|||
|
||||
include ../lib.rules
|
||||
|
||||
CFLAGS += -DCONFIG_IEEE80211W
|
||||
CFLAGS += -DCONFIG_IEEE80211R
|
||||
CFLAGS += -DCONFIG_TDLS
|
||||
CFLAGS += -DCONFIG_WNM
|
||||
|
|
|
@ -1051,7 +1051,6 @@ static int wpa_supplicant_pairwise_gtk(struct wpa_sm *sm,
|
|||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_IEEE80211W
|
||||
static int wpa_supplicant_install_igtk(struct wpa_sm *sm,
|
||||
const struct wpa_igtk_kde *igtk,
|
||||
int wnm_sleep)
|
||||
|
@ -1118,13 +1117,11 @@ static int wpa_supplicant_install_igtk(struct wpa_sm *sm,
|
|||
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_IEEE80211W */
|
||||
|
||||
|
||||
static int ieee80211w_set_keys(struct wpa_sm *sm,
|
||||
struct wpa_eapol_ie_parse *ie)
|
||||
{
|
||||
#ifdef CONFIG_IEEE80211W
|
||||
if (!wpa_cipher_valid_mgmt_group(sm->mgmt_group_cipher))
|
||||
return 0;
|
||||
|
||||
|
@ -1142,9 +1139,6 @@ static int ieee80211w_set_keys(struct wpa_sm *sm,
|
|||
}
|
||||
|
||||
return 0;
|
||||
#else /* CONFIG_IEEE80211W */
|
||||
return 0;
|
||||
#endif /* CONFIG_IEEE80211W */
|
||||
}
|
||||
|
||||
|
||||
|
@ -1455,7 +1449,6 @@ static void wpa_supplicant_process_3_of_4(struct wpa_sm *sm,
|
|||
"WPA: GTK IE in unencrypted key data");
|
||||
goto failed;
|
||||
}
|
||||
#ifdef CONFIG_IEEE80211W
|
||||
if (ie.igtk && !(key_info & WPA_KEY_INFO_ENCR_KEY_DATA)) {
|
||||
wpa_msg(sm->ctx->msg_ctx, MSG_WARNING,
|
||||
"WPA: IGTK KDE in unencrypted key data");
|
||||
|
@ -1471,7 +1464,6 @@ static void wpa_supplicant_process_3_of_4(struct wpa_sm *sm,
|
|||
(unsigned long) ie.igtk_len);
|
||||
goto failed;
|
||||
}
|
||||
#endif /* CONFIG_IEEE80211W */
|
||||
|
||||
if (wpa_supplicant_validate_ie(sm, sm->bssid, &ie) < 0)
|
||||
goto failed;
|
||||
|
@ -2294,9 +2286,7 @@ int wpa_sm_rx_eapol(struct wpa_sm *sm, const u8 *src_addr,
|
|||
key_info = WPA_GET_BE16(key->key_info);
|
||||
ver = key_info & WPA_KEY_INFO_TYPE_MASK;
|
||||
if (ver != WPA_KEY_INFO_TYPE_HMAC_MD5_RC4 &&
|
||||
#if defined(CONFIG_IEEE80211R) || defined(CONFIG_IEEE80211W)
|
||||
ver != WPA_KEY_INFO_TYPE_AES_128_CMAC &&
|
||||
#endif /* CONFIG_IEEE80211R || CONFIG_IEEE80211W */
|
||||
ver != WPA_KEY_INFO_TYPE_HMAC_SHA1_AES &&
|
||||
!wpa_use_akm_defined(sm->key_mgmt)) {
|
||||
wpa_msg(sm->ctx->msg_ctx, MSG_INFO,
|
||||
|
@ -2324,7 +2314,6 @@ int wpa_sm_rx_eapol(struct wpa_sm *sm, const u8 *src_addr,
|
|||
}
|
||||
} else
|
||||
#endif /* CONFIG_IEEE80211R */
|
||||
#ifdef CONFIG_IEEE80211W
|
||||
if (wpa_key_mgmt_sha256(sm->key_mgmt)) {
|
||||
if (ver != WPA_KEY_INFO_TYPE_AES_128_CMAC &&
|
||||
!wpa_use_akm_defined(sm->key_mgmt)) {
|
||||
|
@ -2333,11 +2322,9 @@ int wpa_sm_rx_eapol(struct wpa_sm *sm, const u8 *src_addr,
|
|||
"negotiated AES-128-CMAC");
|
||||
goto out;
|
||||
}
|
||||
} else
|
||||
#endif /* CONFIG_IEEE80211W */
|
||||
if (sm->pairwise_cipher == WPA_CIPHER_CCMP &&
|
||||
!wpa_use_akm_defined(sm->key_mgmt) &&
|
||||
ver != WPA_KEY_INFO_TYPE_HMAC_SHA1_AES) {
|
||||
} else if (sm->pairwise_cipher == WPA_CIPHER_CCMP &&
|
||||
!wpa_use_akm_defined(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 "
|
||||
"descriptor version (%d) is not 2", ver);
|
||||
|
@ -2480,12 +2467,10 @@ static u32 wpa_key_mgmt_suite(struct wpa_sm *sm)
|
|||
case WPA_KEY_MGMT_FT_PSK:
|
||||
return RSN_AUTH_KEY_MGMT_FT_PSK;
|
||||
#endif /* CONFIG_IEEE80211R */
|
||||
#ifdef CONFIG_IEEE80211W
|
||||
case WPA_KEY_MGMT_IEEE8021X_SHA256:
|
||||
return RSN_AUTH_KEY_MGMT_802_1X_SHA256;
|
||||
case WPA_KEY_MGMT_PSK_SHA256:
|
||||
return RSN_AUTH_KEY_MGMT_PSK_SHA256;
|
||||
#endif /* CONFIG_IEEE80211W */
|
||||
case WPA_KEY_MGMT_CCKM:
|
||||
return (sm->proto == WPA_PROTO_RSN ?
|
||||
RSN_AUTH_KEY_MGMT_CCKM:
|
||||
|
@ -2768,10 +2753,8 @@ void wpa_sm_notify_assoc(struct wpa_sm *sm, const u8 *bssid)
|
|||
os_memset(&sm->tptk, 0, sizeof(sm->tptk));
|
||||
os_memset(&sm->gtk, 0, sizeof(sm->gtk));
|
||||
os_memset(&sm->gtk_wnm_sleep, 0, sizeof(sm->gtk_wnm_sleep));
|
||||
#ifdef CONFIG_IEEE80211W
|
||||
os_memset(&sm->igtk, 0, sizeof(sm->igtk));
|
||||
os_memset(&sm->igtk_wnm_sleep, 0, sizeof(sm->igtk_wnm_sleep));
|
||||
#endif /* CONFIG_IEEE80211W */
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
|
@ -3043,11 +3026,9 @@ int wpa_sm_set_param(struct wpa_sm *sm, enum wpa_sm_conf_params param,
|
|||
case WPA_PARAM_KEY_MGMT:
|
||||
sm->key_mgmt = value;
|
||||
break;
|
||||
#ifdef CONFIG_IEEE80211W
|
||||
case WPA_PARAM_MGMT_GROUP:
|
||||
sm->mgmt_group_cipher = value;
|
||||
break;
|
||||
#endif /* CONFIG_IEEE80211W */
|
||||
case WPA_PARAM_RSN_ENABLED:
|
||||
sm->rsn_enabled = value;
|
||||
break;
|
||||
|
@ -3375,10 +3356,8 @@ void wpa_sm_drop_sa(struct wpa_sm *sm)
|
|||
os_memset(&sm->tptk, 0, sizeof(sm->tptk));
|
||||
os_memset(&sm->gtk, 0, sizeof(sm->gtk));
|
||||
os_memset(&sm->gtk_wnm_sleep, 0, sizeof(sm->gtk_wnm_sleep));
|
||||
#ifdef CONFIG_IEEE80211W
|
||||
os_memset(&sm->igtk, 0, sizeof(sm->igtk));
|
||||
os_memset(&sm->igtk_wnm_sleep, 0, sizeof(sm->igtk_wnm_sleep));
|
||||
#endif /* CONFIG_IEEE80211W */
|
||||
#ifdef CONFIG_IEEE80211R
|
||||
os_memset(sm->xxkey, 0, sizeof(sm->xxkey));
|
||||
sm->xxkey_len = 0;
|
||||
|
@ -3452,14 +3431,12 @@ int wpa_wnmsleep_install_key(struct wpa_sm *sm, u8 subelem_id, u8 *buf)
|
|||
return -1;
|
||||
}
|
||||
forced_memzero(&gd, sizeof(gd));
|
||||
#ifdef CONFIG_IEEE80211W
|
||||
} else if (subelem_id == WNM_SLEEP_SUBELEM_IGTK) {
|
||||
const struct wpa_igtk_kde *igtk;
|
||||
|
||||
igtk = (const struct wpa_igtk_kde *) (buf + 2);
|
||||
if (wpa_supplicant_install_igtk(sm, igtk, 1) < 0)
|
||||
return -1;
|
||||
#endif /* CONFIG_IEEE80211W */
|
||||
} else {
|
||||
wpa_printf(MSG_DEBUG, "Unknown element id");
|
||||
return -1;
|
||||
|
@ -4019,10 +3996,8 @@ static int fils_ft_build_assoc_req_rsne(struct wpa_sm *sm, struct wpabuf *buf)
|
|||
|
||||
/* RSN Capabilities */
|
||||
capab = 0;
|
||||
#ifdef CONFIG_IEEE80211W
|
||||
if (sm->mgmt_group_cipher == WPA_CIPHER_AES_128_CMAC)
|
||||
capab |= WPA_CAPABILITY_MFPC;
|
||||
#endif /* CONFIG_IEEE80211W */
|
||||
if (sm->ocv)
|
||||
capab |= WPA_CAPABILITY_OCVC;
|
||||
wpabuf_put_le16(buf, capab);
|
||||
|
@ -4062,13 +4037,11 @@ static int fils_ft_build_assoc_req_rsne(struct wpa_sm *sm, struct wpabuf *buf)
|
|||
WPA_PMK_NAME_LEN);
|
||||
os_memcpy(pos, sm->pmk_r1_name, WPA_PMK_NAME_LEN);
|
||||
|
||||
#ifdef CONFIG_IEEE80211W
|
||||
if (sm->mgmt_group_cipher == WPA_CIPHER_AES_128_CMAC) {
|
||||
/* Management Group Cipher Suite */
|
||||
pos = wpabuf_put(buf, RSN_SELECTOR_LEN);
|
||||
RSN_SELECTOR_PUT(pos, RSN_CIPHER_SUITE_AES_128_CMAC);
|
||||
}
|
||||
#endif /* CONFIG_IEEE80211W */
|
||||
|
||||
rsnie->len = ((u8 *) wpabuf_put(buf, 0) - (u8 *) rsnie) - 2;
|
||||
return 0;
|
||||
|
|
|
@ -246,12 +246,10 @@ static u8 * wpa_ft_gen_req_ies(struct wpa_sm *sm, size_t *len,
|
|||
|
||||
/* RSN Capabilities */
|
||||
capab = 0;
|
||||
#ifdef CONFIG_IEEE80211W
|
||||
if (sm->mfp)
|
||||
capab |= WPA_CAPABILITY_MFPC;
|
||||
if (sm->mfp == 2)
|
||||
capab |= WPA_CAPABILITY_MFPR;
|
||||
#endif /* CONFIG_IEEE80211W */
|
||||
if (sm->ocv)
|
||||
capab |= WPA_CAPABILITY_OCVC;
|
||||
WPA_PUT_LE16(pos, capab);
|
||||
|
@ -265,7 +263,6 @@ static u8 * wpa_ft_gen_req_ies(struct wpa_sm *sm, size_t *len,
|
|||
os_memcpy(pos, pmk_name, WPA_PMK_NAME_LEN);
|
||||
pos += WPA_PMK_NAME_LEN;
|
||||
|
||||
#ifdef CONFIG_IEEE80211W
|
||||
/* Management Group Cipher Suite */
|
||||
switch (sm->mgmt_group_cipher) {
|
||||
case WPA_CIPHER_AES_128_CMAC:
|
||||
|
@ -285,7 +282,6 @@ static u8 * wpa_ft_gen_req_ies(struct wpa_sm *sm, size_t *len,
|
|||
pos += RSN_SELECTOR_LEN;
|
||||
break;
|
||||
}
|
||||
#endif /* CONFIG_IEEE80211W */
|
||||
|
||||
rsnie->len = (pos - (u8 *) rsnie) - 2;
|
||||
|
||||
|
@ -597,13 +593,11 @@ int wpa_ft_process_response(struct wpa_sm *sm, const u8 *ies, size_t ies_len,
|
|||
return -1;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_IEEE80211W
|
||||
if (sm->mfp == 2 && !(parse.rsn_capab & WPA_CAPABILITY_MFPC)) {
|
||||
wpa_printf(MSG_INFO,
|
||||
"FT: Target AP does not support PMF, but local configuration requires that");
|
||||
return -1;
|
||||
}
|
||||
#endif /* CONFIG_IEEE80211W */
|
||||
|
||||
os_memcpy(sm->r1kh_id, parse.r1kh_id, FT_R1KH_ID_LEN);
|
||||
wpa_hexdump(MSG_DEBUG, "FT: R1KH-ID", sm->r1kh_id, FT_R1KH_ID_LEN);
|
||||
|
@ -774,7 +768,6 @@ static int wpa_ft_process_gtk_subelem(struct wpa_sm *sm, const u8 *gtk_elem,
|
|||
}
|
||||
|
||||
|
||||
#ifdef CONFIG_IEEE80211W
|
||||
static int wpa_ft_process_igtk_subelem(struct wpa_sm *sm, const u8 *igtk_elem,
|
||||
size_t igtk_elem_len)
|
||||
{
|
||||
|
@ -842,7 +835,6 @@ static int wpa_ft_process_igtk_subelem(struct wpa_sm *sm, const u8 *igtk_elem,
|
|||
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_IEEE80211W */
|
||||
|
||||
|
||||
int wpa_ft_validate_reassoc_resp(struct wpa_sm *sm, const u8 *ies,
|
||||
|
@ -1025,10 +1017,8 @@ int wpa_ft_validate_reassoc_resp(struct wpa_sm *sm, const u8 *ies,
|
|||
if (wpa_ft_process_gtk_subelem(sm, parse.gtk, parse.gtk_len) < 0)
|
||||
return -1;
|
||||
|
||||
#ifdef CONFIG_IEEE80211W
|
||||
if (wpa_ft_process_igtk_subelem(sm, parse.igtk, parse.igtk_len) < 0)
|
||||
return -1;
|
||||
#endif /* CONFIG_IEEE80211W */
|
||||
|
||||
if (sm->set_ptk_after_assoc) {
|
||||
wpa_printf(MSG_DEBUG, "FT: Try to set PTK again now that we "
|
||||
|
|
|
@ -31,10 +31,8 @@ struct wpa_sm {
|
|||
u8 request_counter[WPA_REPLAY_COUNTER_LEN];
|
||||
struct wpa_gtk gtk;
|
||||
struct wpa_gtk gtk_wnm_sleep;
|
||||
#ifdef CONFIG_IEEE80211W
|
||||
struct wpa_igtk igtk;
|
||||
struct wpa_igtk igtk_wnm_sleep;
|
||||
#endif /* CONFIG_IEEE80211W */
|
||||
|
||||
struct eapol_sm *eapol; /* EAPOL state machine from upper level code */
|
||||
|
||||
|
|
|
@ -168,12 +168,10 @@ static int wpa_gen_wpa_ie_rsn(u8 *rsn_ie, size_t rsn_ie_len,
|
|||
} else if (key_mgmt == WPA_KEY_MGMT_FT_PSK) {
|
||||
RSN_SELECTOR_PUT(pos, RSN_AUTH_KEY_MGMT_FT_PSK);
|
||||
#endif /* CONFIG_IEEE80211R */
|
||||
#ifdef CONFIG_IEEE80211W
|
||||
} else if (key_mgmt == WPA_KEY_MGMT_IEEE8021X_SHA256) {
|
||||
RSN_SELECTOR_PUT(pos, RSN_AUTH_KEY_MGMT_802_1X_SHA256);
|
||||
} else if (key_mgmt == WPA_KEY_MGMT_PSK_SHA256) {
|
||||
RSN_SELECTOR_PUT(pos, RSN_AUTH_KEY_MGMT_PSK_SHA256);
|
||||
#endif /* CONFIG_IEEE80211W */
|
||||
#ifdef CONFIG_SAE
|
||||
} else if (key_mgmt == WPA_KEY_MGMT_SAE) {
|
||||
RSN_SELECTOR_PUT(pos, RSN_AUTH_KEY_MGMT_SAE);
|
||||
|
@ -217,12 +215,10 @@ static int wpa_gen_wpa_ie_rsn(u8 *rsn_ie, size_t rsn_ie_len,
|
|||
|
||||
/* RSN Capabilities */
|
||||
capab = 0;
|
||||
#ifdef CONFIG_IEEE80211W
|
||||
if (sm->mfp)
|
||||
capab |= WPA_CAPABILITY_MFPC;
|
||||
if (sm->mfp == 2)
|
||||
capab |= WPA_CAPABILITY_MFPR;
|
||||
#endif /* CONFIG_IEEE80211W */
|
||||
if (sm->ocv)
|
||||
capab |= WPA_CAPABILITY_OCVC;
|
||||
WPA_PUT_LE16(pos, capab);
|
||||
|
@ -237,7 +233,6 @@ static int wpa_gen_wpa_ie_rsn(u8 *rsn_ie, size_t rsn_ie_len,
|
|||
pos += PMKID_LEN;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_IEEE80211W
|
||||
if (wpa_cipher_valid_mgmt_group(mgmt_group_cipher)) {
|
||||
if (!sm->cur_pmksa) {
|
||||
/* PMKID Count */
|
||||
|
@ -250,7 +245,6 @@ static int wpa_gen_wpa_ie_rsn(u8 *rsn_ie, size_t rsn_ie_len,
|
|||
mgmt_group_cipher));
|
||||
pos += RSN_SELECTOR_LEN;
|
||||
}
|
||||
#endif /* CONFIG_IEEE80211W */
|
||||
|
||||
hdr->len = (pos - rsn_ie) - 2;
|
||||
|
||||
|
@ -435,7 +429,6 @@ static int wpa_parse_generic(const u8 *pos, const u8 *end,
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_IEEE80211W
|
||||
if (pos[1] > RSN_SELECTOR_LEN + 2 &&
|
||||
RSN_SELECTOR_GET(pos + 2) == RSN_KEY_DATA_IGTK) {
|
||||
ie->igtk = pos + 2 + RSN_SELECTOR_LEN;
|
||||
|
@ -444,7 +437,6 @@ static int wpa_parse_generic(const u8 *pos, const u8 *end,
|
|||
pos, pos[1] + 2);
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_IEEE80211W */
|
||||
|
||||
#ifdef CONFIG_P2P
|
||||
if (pos[1] >= RSN_SELECTOR_LEN + 1 &&
|
||||
|
|
|
@ -21,10 +21,8 @@ struct wpa_eapol_ie_parse {
|
|||
size_t gtk_len;
|
||||
const u8 *mac_addr;
|
||||
size_t mac_addr_len;
|
||||
#ifdef CONFIG_IEEE80211W
|
||||
const u8 *igtk;
|
||||
size_t igtk_len;
|
||||
#endif /* CONFIG_IEEE80211W */
|
||||
const u8 *mdie;
|
||||
size_t mdie_len;
|
||||
const u8 *ftie;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue