mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-03 10:30:58 +02:00
fix(esp_wifi): Resolve comments for wpa3_compatible_mode
This commit is contained in:
committed by
Kapil Gupta
parent
a7f32f5a2a
commit
3eca66cc0d
@@ -563,7 +563,7 @@ typedef struct {
|
|||||||
uint32_t ft_enabled: 1; /**< Whether FT is enabled for the connection */
|
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 owe_enabled: 1; /**< Whether OWE is enabled for the connection */
|
||||||
uint32_t transition_disable: 1; /**< Whether to enable transition disable feature */
|
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 */
|
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_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 */
|
wifi_sae_pk_mode_t sae_pk_mode; /**< Configuration for SAE-PK (Public Key) Authentication method */
|
||||||
|
@@ -109,7 +109,7 @@ void *hostap_init(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_IEEE80211W */
|
#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
|
#ifdef CONFIG_WPA3_COMPAT
|
||||||
hapd->conf->sae_pwe = SAE_PWE_HASH_TO_ELEMENT;
|
hapd->conf->sae_pwe = SAE_PWE_HASH_TO_ELEMENT;
|
||||||
auth_conf->rsn_override_omit_rsnxe = 1;
|
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_pairwise = WPA_CIPHER_CCMP;
|
||||||
auth_conf->rsn_override_mfp = MGMT_FRAME_PROTECTION_REQUIRED;
|
auth_conf->rsn_override_mfp = MGMT_FRAME_PROTECTION_REQUIRED;
|
||||||
#else
|
#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
|
#endif
|
||||||
}
|
}
|
||||||
/* TKIP is compulsory in WPA Mode */
|
/* TKIP is compulsory in WPA Mode */
|
||||||
@@ -208,7 +208,7 @@ void *hostap_init(void)
|
|||||||
#ifdef CONFIG_SAE
|
#ifdef CONFIG_SAE
|
||||||
if (authmode == WIFI_AUTH_WPA3_PSK ||
|
if (authmode == WIFI_AUTH_WPA3_PSK ||
|
||||||
authmode == WIFI_AUTH_WPA2_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) {
|
if (wpa3_hostap_auth_init(hapd) != 0) {
|
||||||
goto fail;
|
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
|
#ifdef CONFIG_WPA3_COMPAT
|
||||||
|
#define RSN_SELECTION_IE_OUI_LEN 4
|
||||||
if (rsn_selection_ie) {
|
if (rsn_selection_ie) {
|
||||||
rsn_selection_variant_len = rsn_selection_ie[1] - 4;
|
rsn_selection_variant_len = rsn_selection_ie[1] - RSN_SELECTION_IE_OUI_LEN;
|
||||||
rsn_selection_variant_ie = &rsn_selection_ie[6];
|
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);
|
wpa_auth_set_rsn_selection(sta->wpa_sm, rsn_selection_variant_ie, rsn_selection_variant_len);
|
||||||
|
@@ -310,6 +310,5 @@ int esp_wifi_softap_set_obss_overlap(bool overlap);
|
|||||||
void esp_wifi_set_sigma_internal(bool flag);
|
void esp_wifi_set_sigma_internal(bool flag);
|
||||||
void esp_wifi_ap_set_group_mgmt_cipher_internal(wifi_cipher_type_t cipher);
|
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);
|
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_ */
|
#endif /* _ESP_WIFI_DRIVER_H_ */
|
||||||
|
@@ -47,7 +47,7 @@ static esp_err_t wpa3_build_sae_commit(u8 *bssid, size_t *sae_msg_len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_WPA3_COMPAT
|
#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);
|
rsnxe = esp_wifi_sta_get_ie((u8*)bssid, WFA_RSNXE_OVERRIDE_OUI_TYPE);
|
||||||
if (rsnxe) {
|
if (rsnxe) {
|
||||||
rsnxe_capa = rsnxe[2 + 4];
|
rsnxe_capa = rsnxe[2 + 4];
|
||||||
|
@@ -2629,12 +2629,12 @@ int wpa_set_bss(uint8_t *macddr, uint8_t *bssid, uint8_t pairwise_cipher, uint8_
|
|||||||
|
|
||||||
#ifdef CONFIG_WPA3_COMPAT
|
#ifdef CONFIG_WPA3_COMPAT
|
||||||
wpa_sm_set_param(sm, WPA_PARAM_RSN_OVERRIDE_SUPPORT,
|
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,
|
wpa_sm_set_param(sm, WPA_PARAM_RSN_OVERRIDE,
|
||||||
RSN_OVERRIDE_NOT_USED);
|
RSN_OVERRIDE_NOT_USED);
|
||||||
ie = esp_wifi_sta_get_ie(bssid, WFA_RSNE_OVERRIDE_OUI_TYPE);
|
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;
|
enum rsn_selection_variant variant = RSN_SELECTION_RSNE;
|
||||||
|
|
||||||
if (ie && ie[0] == WLAN_EID_VENDOR_SPECIFIC && ie[1] >= 4) {
|
if (ie && ie[0] == WLAN_EID_VENDOR_SPECIFIC && ie[1] >= 4) {
|
||||||
|
@@ -75,11 +75,10 @@ void wifi_init_softap(void)
|
|||||||
#ifdef CONFIG_ESP_WIFI_SOFTAP_SAE_SUPPORT
|
#ifdef CONFIG_ESP_WIFI_SOFTAP_SAE_SUPPORT
|
||||||
.authmode = WIFI_AUTH_WPA3_PSK,
|
.authmode = WIFI_AUTH_WPA3_PSK,
|
||||||
.sae_pwe_h2e = WPA3_SAE_PWE_BOTH,
|
.sae_pwe_h2e = WPA3_SAE_PWE_BOTH,
|
||||||
|
.pairwise_cipher = WIFI_CIPHER_TYPE_GCMP256,
|
||||||
|
.sae_ext = 1,
|
||||||
#else /* CONFIG_ESP_WIFI_SOFTAP_SAE_SUPPORT */
|
#else /* CONFIG_ESP_WIFI_SOFTAP_SAE_SUPPORT */
|
||||||
.authmode = WIFI_AUTH_WPA2_PSK,
|
.authmode = WIFI_AUTH_WPA2_PSK,
|
||||||
#endif
|
|
||||||
#ifdef CONFIG_ESP_WIFI_WPA3_COMPATIBLE_SUPPORT
|
|
||||||
.wpa3_compatible_mode = 1,
|
|
||||||
#endif
|
#endif
|
||||||
.pmf_cfg = {
|
.pmf_cfg = {
|
||||||
.required = true,
|
.required = true,
|
||||||
|
@@ -130,7 +130,7 @@ void wifi_init_sta(void)
|
|||||||
.sae_pwe_h2e = ESP_WIFI_SAE_MODE,
|
.sae_pwe_h2e = ESP_WIFI_SAE_MODE,
|
||||||
.sae_h2e_identifier = EXAMPLE_H2E_IDENTIFIER,
|
.sae_h2e_identifier = EXAMPLE_H2E_IDENTIFIER,
|
||||||
#ifdef CONFIG_ESP_WIFI_WPA3_COMPATIBLE_SUPPORT
|
#ifdef CONFIG_ESP_WIFI_WPA3_COMPATIBLE_SUPPORT
|
||||||
.wpa3_compatible_mode = 1,
|
.disable_wpa3_compatible_mode = 0,
|
||||||
#endif
|
#endif
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user