]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Enable SAE-H2E for client when joining a 6 GHz group
authorQiwei Cai <quic_qcai@quicinc.com>
Wed, 11 Jan 2023 11:59:01 +0000 (19:59 +0800)
committerJouni Malinen <j@w1.fi>
Mon, 30 Jan 2023 21:21:33 +0000 (23:21 +0200)
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>
wpa_supplicant/p2p_supplicant.c

index 894b6ba26d0edd505ed6012dc1f67a7fe4e1139c..f2eaa377cca75f37470cb25aca35780fdd925349 100644 (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);