P2P: Enable SAE-H2E for client when joining a 6 GHz group

Both P2P GO and client always save key_mgmt = WPA_KEY_MGMT_PSK in the
configuration when storing a persistent group. Next time, when a GO is
started as an autonomous GO on a 6 GHz channel, it will change key_mgmt
to SAE and use hash-to-element mechanism, but the P2P client doesn't
change the parameter even if the group it wants to join is operating on
a 6 GHz channel. The P2P connection will be failed due to reason 'reject
due to mismatch with WPA/WPA2'.

Enable SAE-H2E for P2P client in this case.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
This commit is contained in:
Qiwei Cai 2023-01-11 19:59:01 +08:00 committed by Jouni Malinen
parent 37f8257c4f
commit 1aadcca0a7

View file

@ -6938,6 +6938,16 @@ static int wpas_start_p2p_client(struct wpa_supplicant *wpa_s,
WPA_CIPHER_CCMP;
ssid->group_cipher = params->pbss ? WPA_CIPHER_GCMP : WPA_CIPHER_CCMP;
ssid->key_mgmt = WPA_KEY_MGMT_PSK;
if (is_6ghz_freq(freq) &&
is_p2p_6ghz_capable(wpa_s->global->p2p)) {
ssid->auth_alg |= WPA_AUTH_ALG_SAE;
ssid->key_mgmt |= WPA_KEY_MGMT_SAE;
ssid->ieee80211w = MGMT_FRAME_PROTECTION_OPTIONAL;
ssid->sae_pwe = SAE_PWE_HASH_TO_ELEMENT;
wpa_dbg(wpa_s, MSG_DEBUG,
"P2P: Enable SAE auth_alg and key_mgmt");
}
ssid->ssid = os_malloc(params->ssid_len);
if (ssid->ssid == NULL) {
wpa_config_remove_network(wpa_s->conf, ssid->id);