esp_wifi: Make enterprise support configurable to save binary size.

This commit is contained in:
aditi_lonkar 2023-06-16 13:19:50 +05:30
parent 9080a7ac7c
commit 0624d5e58f
5 changed files with 20 additions and 0 deletions

View File

@ -563,4 +563,13 @@ menu "Wi-Fi"
help
Select this to enable unity test for DPP.
config ESP_WIFI_ENTERPRISE_SUPPORT
bool "Enable enterprise option"
default y
help
Select this to enable/disable enterprise connection support.
disabling this will reduce binary size.
disabling this will disable the use of any esp_wifi_sta_wpa2_ent_* (as APIs will be meaningless)
endmenu # Wi-Fi

View File

@ -184,9 +184,11 @@ bool wpa_deattach(void)
{
struct wpa_sm *sm = &gWpaSm;
esp_wpa3_free_sae_data();
#ifdef CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT
if (sm->wpa_sm_wpa2_ent_disable) {
sm->wpa_sm_wpa2_ent_disable();
}
#endif
if (sm->wpa_sm_wps_disable) {
sm->wpa_sm_wps_disable();
}

View File

@ -51,6 +51,7 @@ typedef enum { FALSE = 0, TRUE = 1 } Boolean;
static inline int wpa_key_mgmt_wpa_ieee8021x(int akm)
{
#ifdef CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT
return !!(akm & (WPA_KEY_MGMT_IEEE8021X |
WPA_KEY_MGMT_FT_IEEE8021X |
WPA_KEY_MGMT_CCKM |
@ -58,6 +59,9 @@ static inline int wpa_key_mgmt_wpa_ieee8021x(int akm)
WPA_KEY_MGMT_IEEE8021X_SHA256 |
WPA_KEY_MGMT_IEEE8021X_SUITE_B |
WPA_KEY_MGMT_IEEE8021X_SUITE_B_192));
#else
return 0;
#endif
}
static inline int wpa_key_mgmt_wpa_psk(int akm)

View File

@ -170,6 +170,7 @@ unsigned cipher_type_map_public_to_supp(wifi_cipher_type_t cipher)
}
}
#ifdef CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT
static bool is_wpa2_enterprise_connection(void)
{
uint8_t authmode;
@ -185,6 +186,7 @@ static bool is_wpa2_enterprise_connection(void)
return false;
}
#endif
/**
* get_bssid - Get the current BSSID
@ -688,9 +690,11 @@ void wpa_supplicant_process_1_of_4(struct wpa_sm *sm,
if (res)
goto failed;
#ifdef CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT
if (is_wpa2_enterprise_connection()) {
pmksa_cache_set_current(sm, NULL, sm->bssid, 0, 0);
}
#endif
if (sm->renew_snonce) {
if (os_get_random(sm->snonce, WPA_NONCE_LEN)) {

View File

@ -323,6 +323,7 @@ The following binary size optimizations apply to a particular component or a fun
- Disabling :ref:`CONFIG_ESP_WIFI_ENABLE_WPA3_SAE` will save some Wi-Fi binary size if WPA3 support is not needed. (Note that WPA3 is mandatory for new Wi-Fi device certifications.)
- Disabling :ref:`CONFIG_ESP_WIFI_SOFTAP_SUPPORT` will save some Wi-Fi binary size if soft-AP support is not needed.
- Disabling :ref:`CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT` will save some Wi-Fi binary size if enterprise support is not needed.
.. only:: esp32