3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-23 06:02:37 +01:00

station: support OSEN IE setting in handshake

The check for MFP is now skipped for OSEN as it should not be set for
this AKM.
This commit is contained in:
James Prestwood 2019-06-10 15:46:59 -07:00 committed by Denis Kenzior
parent c62ca4e185
commit e38cbcd31b

View File

@ -539,6 +539,7 @@ static int station_build_handshake_rsn(struct handshake_state *hs,
uint8_t rsne_buf[256]; uint8_t rsne_buf[256];
struct ie_rsn_info info; struct ie_rsn_info info;
uint32_t mfp_setting; uint32_t mfp_setting;
uint8_t *ap_ie;
memset(&info, 0, sizeof(info)); memset(&info, 0, sizeof(info));
@ -578,6 +579,13 @@ static int station_build_handshake_rsn(struct handshake_state *hs,
if (!info.pairwise_ciphers || !info.group_cipher) if (!info.pairwise_ciphers || !info.group_cipher)
goto not_supported; goto not_supported;
/* Management frame protection is explicitly off for OSEN */
if (info.akm_suites & IE_RSN_AKM_SUITE_OSEN) {
info.group_management_cipher =
IE_RSN_CIPHER_SUITE_NO_GROUP_TRAFFIC;
goto build_ie;
}
if (!l_settings_get_uint(settings, "General", if (!l_settings_get_uint(settings, "General",
"ManagementFrameProtection", &mfp_setting)) "ManagementFrameProtection", &mfp_setting))
mfp_setting = 1; mfp_setting = 1;
@ -616,16 +624,25 @@ static int station_build_handshake_rsn(struct handshake_state *hs,
if (bss_info.mfpr && !info.mfpc) if (bss_info.mfpr && !info.mfpc)
goto not_supported; goto not_supported;
build_ie:
/* RSN takes priority */ /* RSN takes priority */
if (bss->rsne) { if (bss->rsne) {
ap_ie = bss->rsne;
ie_build_rsne(&info, rsne_buf); ie_build_rsne(&info, rsne_buf);
handshake_state_set_authenticator_ie(hs, bss->rsne); } else if (bss->wpa) {
handshake_state_set_supplicant_ie(hs, rsne_buf); ap_ie = bss->wpa;
} else {
ie_build_wpa(&info, rsne_buf); ie_build_wpa(&info, rsne_buf);
handshake_state_set_authenticator_ie(hs, bss->wpa); } else if (bss->osen) {
handshake_state_set_supplicant_ie(hs, rsne_buf); ap_ie = bss->osen;
} ie_build_osen(&info, rsne_buf);
} else
goto not_supported;
if (!handshake_state_set_authenticator_ie(hs, ap_ie))
goto not_supported;
if (!handshake_state_set_supplicant_ie(hs, rsne_buf))
goto not_supported;
if (info.akm_suites & (IE_RSN_AKM_SUITE_FT_OVER_8021X | if (info.akm_suites & (IE_RSN_AKM_SUITE_FT_OVER_8021X |
IE_RSN_AKM_SUITE_FT_USING_PSK | IE_RSN_AKM_SUITE_FT_USING_PSK |