diff --git a/components/esp_wifi/include/esp_wifi_types.h b/components/esp_wifi/include/esp_wifi_types.h index 1bc273be67..029aeebb83 100644 --- a/components/esp_wifi/include/esp_wifi_types.h +++ b/components/esp_wifi/include/esp_wifi_types.h @@ -277,7 +277,8 @@ typedef struct { uint32_t rm_enabled:1; /**< Whether Radio Measurements are enabled for the connection */ uint32_t btm_enabled:1; /**< Whether BSS Transition Management is enabled for the connection */ uint32_t mbo_enabled:1; /**< Whether MBO is enabled for the connection */ - uint32_t reserved:29; /**< Reserved for future feature set */ + uint32_t transition_disable:1; /**< Whether to enable transition disable feature */ + uint32_t reserved:28; /**< Reserved for future feature set */ wifi_sae_pwe_method_t sae_pwe_h2e; /**< Whether SAE hash to element is enabled */ uint8_t failure_retry_cnt; /**< Number of connection retries station will do before moving to next AP. scan_method should be set as WIFI_ALL_CHANNEL_SCAN to use this config. Note: Enabling this may cause connection time to increase incase best AP doesn't behave properly. */ } wifi_sta_config_t; diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_wpas_glue.c b/components/wpa_supplicant/esp_supplicant/src/esp_wpas_glue.c index 1e3fc424c7..1cf6686a69 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_wpas_glue.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_wpas_glue.c @@ -61,6 +61,15 @@ void wpa_sm_free_eapol(u8 *buffer) os_free(buffer); } +void wpa_supplicant_transition_disable(void *sm, u8 bitmap) +{ + wpa_printf(MSG_INFO, "TRANSITION_DISABLE %02x", bitmap); + + if (bitmap & TRANSITION_DISABLE_WPA3_PERSONAL) { + esp_wifi_sta_disable_wpa2_authmode_internal(); + } +} + void wpa_sm_deauthenticate(struct wpa_sm *sm, u8 reason_code) { diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_wpas_glue.h b/components/wpa_supplicant/esp_supplicant/src/esp_wpas_glue.h index 4d867962e7..24dff6184e 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_wpas_glue.h +++ b/components/wpa_supplicant/esp_supplicant/src/esp_wpas_glue.h @@ -30,4 +30,6 @@ int wpa_sm_get_beacon_ie(struct wpa_sm *sm); void wpa_sm_free_eapol(u8 *buffer); +void wpa_supplicant_transition_disable(void *sm, u8 bitmap); + #endif /* WPAS_GLUE_H */ diff --git a/components/wpa_supplicant/src/common/wpa_common.h b/components/wpa_supplicant/src/common/wpa_common.h index 9a4b619cfb..e38af8cc5f 100644 --- a/components/wpa_supplicant/src/common/wpa_common.h +++ b/components/wpa_supplicant/src/common/wpa_common.h @@ -311,6 +311,10 @@ struct rsn_rdie { #endif /* CONFIG_IEEE80211R */ +/* WFA Transition Disable KDE (using OUI_WFA) */ +/* Transition Disable Bitmap bits */ +#define TRANSITION_DISABLE_WPA3_PERSONAL BIT(0) + struct wpa_ie_data { int proto; int pairwise_cipher; diff --git a/components/wpa_supplicant/src/rsn_supp/wpa.c b/components/wpa_supplicant/src/rsn_supp/wpa.c index 9a9e0fd3d1..b00250e758 100644 --- a/components/wpa_supplicant/src/rsn_supp/wpa.c +++ b/components/wpa_supplicant/src/rsn_supp/wpa.c @@ -1264,8 +1264,9 @@ static void wpa_supplicant_process_3_of_4(struct wpa_sm *sm, goto failed; } - if (ie.transition_disable) - esp_wifi_sta_disable_wpa2_authmode_internal(); + if (ie.transition_disable) { + wpa_supplicant_transition_disable(sm, ie.transition_disable[0]); + } if (sm->key_install && sm->key_info & WPA_KEY_INFO_INSTALL && sm->use_ext_key_id) { wpa_supplicant_install_ptk(sm, KEY_FLAG_RX);