SAE: Pass SAE password on connect for SAE authentication offload support

Pass SAE password on connect if driver advertises SAE authentication
offload support.

Signed-off-by: Chung-Hsien Hsu <chung-hsien.hsu@infineon.com>
Signed-off-by: Daisuke Mizobuchi <mizo@atmark-techno.com>
This commit is contained in:
Chung-Hsien Hsu 2023-07-19 14:22:27 +09:00 committed by Jouni Malinen
parent 6cc78b3945
commit 236c0cfbcd

View file

@ -1761,7 +1761,8 @@ int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
sel = ie.key_mgmt & ssid->key_mgmt;
#ifdef CONFIG_SAE
if (!(wpa_s->drv_flags & WPA_DRIVER_FLAGS_SAE) ||
if ((!(wpa_s->drv_flags & WPA_DRIVER_FLAGS_SAE) &&
!(wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_SAE_OFFLOAD_STA)) ||
wpas_is_sae_avoided(wpa_s, ssid, &ie))
sel &= ~(WPA_KEY_MGMT_SAE | WPA_KEY_MGMT_SAE_EXT_KEY |
WPA_KEY_MGMT_FT_SAE | WPA_KEY_MGMT_FT_SAE_EXT_KEY);
@ -4311,6 +4312,17 @@ static void wpas_start_assoc_cb(struct wpa_radio_work *work, int deinit)
params.psk = psk;
}
if ((wpa_s->drv_flags2 & WPA_DRIVER_FLAGS2_SAE_OFFLOAD_STA) &&
wpa_key_mgmt_sae(params.key_mgmt_suite)) {
params.auth_alg = WPA_AUTH_ALG_SAE;
if (ssid->sae_password) {
params.sae_password = ssid->sae_password;
params.sae_password_id = ssid->sae_password_id;
} else if (ssid->passphrase) {
params.passphrase = ssid->passphrase;
}
}
params.drop_unencrypted = use_crypt;
params.mgmt_frame_protection = wpas_get_ssid_pmf(wpa_s, ssid);