diff --git a/components/esp_wifi/include/esp_wifi_types_generic.h b/components/esp_wifi/include/esp_wifi_types_generic.h index acb21d0b5f..755a85925a 100644 --- a/components/esp_wifi/include/esp_wifi_types_generic.h +++ b/components/esp_wifi/include/esp_wifi_types_generic.h @@ -563,7 +563,7 @@ typedef struct { uint32_t ft_enabled: 1; /**< Whether FT is enabled for the connection */ uint32_t owe_enabled: 1; /**< Whether OWE is enabled for the connection */ uint32_t transition_disable: 1; /**< Whether to enable transition disable feature */ - uint32_t wpa3_compatible_mode: 1; /**< Whether to enable wpa3 compatible authmode feature */ + uint32_t disable_wpa3_compatible_mode: 1; /**< Whether to enable wpa3 compatible authmode feature */ uint32_t reserved1: 25; /**< Reserved for future feature set */ wifi_sae_pwe_method_t sae_pwe_h2e; /**< Configuration for SAE PWE derivation method */ wifi_sae_pk_mode_t sae_pk_mode; /**< Configuration for SAE-PK (Public Key) Authentication method */ diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_hostap.c b/components/wpa_supplicant/esp_supplicant/src/esp_hostap.c index 4eaaa50af4..b2eb14c324 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_hostap.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_hostap.c @@ -109,7 +109,7 @@ void *hostap_init(void) } } #endif /* CONFIG_IEEE80211W */ - if (esp_wifi_wpa3_compatible_mode_enabled(WIFI_IF_AP)) { + if (esp_wifi_is_wpa3_compatible_mode_enabled(WIFI_IF_AP)) { #ifdef CONFIG_WPA3_COMPAT hapd->conf->sae_pwe = SAE_PWE_HASH_TO_ELEMENT; auth_conf->rsn_override_omit_rsnxe = 1; @@ -121,7 +121,7 @@ void *hostap_init(void) auth_conf->rsn_override_pairwise = WPA_CIPHER_CCMP; auth_conf->rsn_override_mfp = MGMT_FRAME_PROTECTION_REQUIRED; #else - wpa_printf(MSG_ERROR, "ESP_WIFI_WPA3_COMPATIBLE_SUPPORT disabled ignoring wpa3_compatible configuration"); + wpa_printf(MSG_ERROR, "ESP_WIFI_WPA3_COMPATIBLE_SUPPORT disabled, ignoring wpa3_compatible configuration"); #endif } /* TKIP is compulsory in WPA Mode */ @@ -208,7 +208,7 @@ void *hostap_init(void) #ifdef CONFIG_SAE if (authmode == WIFI_AUTH_WPA3_PSK || authmode == WIFI_AUTH_WPA2_WPA3_PSK || - esp_wifi_wpa3_compatible_mode_enabled(WIFI_IF_AP)) { + esp_wifi_is_wpa3_compatible_mode_enabled(WIFI_IF_AP)) { if (wpa3_hostap_auth_init(hapd) != 0) { goto fail; } @@ -444,9 +444,10 @@ bool hostap_new_assoc_sta(struct sta_info *sta, uint8_t *bssid, u8 *wpa_ie, } #ifdef CONFIG_WPA3_COMPAT +#define RSN_SELECTION_IE_OUI_LEN 4 if (rsn_selection_ie) { - rsn_selection_variant_len = rsn_selection_ie[1] - 4; - rsn_selection_variant_ie = &rsn_selection_ie[6]; + rsn_selection_variant_len = rsn_selection_ie[1] - RSN_SELECTION_IE_OUI_LEN; + rsn_selection_variant_ie = &rsn_selection_ie[RSN_SELECTION_IE_OUI_LEN + 2]; } wpa_auth_set_rsn_selection(sta->wpa_sm, rsn_selection_variant_ie, rsn_selection_variant_len); diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_wifi_driver.h b/components/wpa_supplicant/esp_supplicant/src/esp_wifi_driver.h index 874f32c97f..348a48c500 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_wifi_driver.h +++ b/components/wpa_supplicant/esp_supplicant/src/esp_wifi_driver.h @@ -310,6 +310,5 @@ int esp_wifi_softap_set_obss_overlap(bool overlap); void esp_wifi_set_sigma_internal(bool flag); void esp_wifi_ap_set_group_mgmt_cipher_internal(wifi_cipher_type_t cipher); uint8_t esp_wifi_op_class_supported_internal(uint8_t op_class, uint8_t min_chan, uint8_t max_chan, uint8_t inc, uint8_t bw, channel_bitmap_t *non_pref_channels); -bool esp_wifi_wpa3_compatible_mode_enabled(uint8_t if_index); - +bool esp_wifi_is_wpa3_compatible_mode_enabled(uint8_t if_index); #endif /* _ESP_WIFI_DRIVER_H_ */ diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_wpa3.c b/components/wpa_supplicant/esp_supplicant/src/esp_wpa3.c index c5ef241f94..153fc63334 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_wpa3.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_wpa3.c @@ -47,7 +47,7 @@ static esp_err_t wpa3_build_sae_commit(u8 *bssid, size_t *sae_msg_len) } #ifdef CONFIG_WPA3_COMPAT - if (esp_wifi_wpa3_compatible_mode_enabled(WIFI_IF_STA)) { + if (esp_wifi_is_wpa3_compatible_mode_enabled(WIFI_IF_STA)) { rsnxe = esp_wifi_sta_get_ie((u8*)bssid, WFA_RSNXE_OVERRIDE_OUI_TYPE); if (rsnxe) { rsnxe_capa = rsnxe[2 + 4]; diff --git a/components/wpa_supplicant/src/rsn_supp/wpa.c b/components/wpa_supplicant/src/rsn_supp/wpa.c index d2a8d7140f..19d760e95e 100644 --- a/components/wpa_supplicant/src/rsn_supp/wpa.c +++ b/components/wpa_supplicant/src/rsn_supp/wpa.c @@ -2629,12 +2629,12 @@ int wpa_set_bss(uint8_t *macddr, uint8_t *bssid, uint8_t pairwise_cipher, uint8_ #ifdef CONFIG_WPA3_COMPAT wpa_sm_set_param(sm, WPA_PARAM_RSN_OVERRIDE_SUPPORT, - esp_wifi_wpa3_compatible_mode_enabled(WIFI_IF_STA)); + esp_wifi_is_wpa3_compatible_mode_enabled(WIFI_IF_STA)); wpa_sm_set_param(sm, WPA_PARAM_RSN_OVERRIDE, RSN_OVERRIDE_NOT_USED); ie = esp_wifi_sta_get_ie(bssid, WFA_RSNE_OVERRIDE_OUI_TYPE); - if (esp_wifi_wpa3_compatible_mode_enabled(WIFI_IF_STA) && ie) { + if (esp_wifi_is_wpa3_compatible_mode_enabled(WIFI_IF_STA) && ie) { enum rsn_selection_variant variant = RSN_SELECTION_RSNE; if (ie && ie[0] == WLAN_EID_VENDOR_SPECIFIC && ie[1] >= 4) { diff --git a/examples/wifi/getting_started/softAP/main/softap_example_main.c b/examples/wifi/getting_started/softAP/main/softap_example_main.c index a19978070b..e9a9d03f45 100644 --- a/examples/wifi/getting_started/softAP/main/softap_example_main.c +++ b/examples/wifi/getting_started/softAP/main/softap_example_main.c @@ -75,11 +75,10 @@ void wifi_init_softap(void) #ifdef CONFIG_ESP_WIFI_SOFTAP_SAE_SUPPORT .authmode = WIFI_AUTH_WPA3_PSK, .sae_pwe_h2e = WPA3_SAE_PWE_BOTH, + .pairwise_cipher = WIFI_CIPHER_TYPE_GCMP256, + .sae_ext = 1, #else /* CONFIG_ESP_WIFI_SOFTAP_SAE_SUPPORT */ .authmode = WIFI_AUTH_WPA2_PSK, -#endif -#ifdef CONFIG_ESP_WIFI_WPA3_COMPATIBLE_SUPPORT - .wpa3_compatible_mode = 1, #endif .pmf_cfg = { .required = true, diff --git a/examples/wifi/getting_started/station/main/station_example_main.c b/examples/wifi/getting_started/station/main/station_example_main.c index 45c9a14a93..1cc82b0b83 100644 --- a/examples/wifi/getting_started/station/main/station_example_main.c +++ b/examples/wifi/getting_started/station/main/station_example_main.c @@ -130,7 +130,7 @@ void wifi_init_sta(void) .sae_pwe_h2e = ESP_WIFI_SAE_MODE, .sae_h2e_identifier = EXAMPLE_H2E_IDENTIFIER, #ifdef CONFIG_ESP_WIFI_WPA3_COMPATIBLE_SUPPORT - .wpa3_compatible_mode = 1, + .disable_wpa3_compatible_mode = 0, #endif }, };