wpa_supplicant : Add support for unregistering wifi wpa3 callbacks.

Unregister wifi callbacks allows for disabling support for wpa3 functions when not required.
This commit is contained in:
jgujarathi 2023-02-15 17:59:18 +05:30
parent 7cf3f99bfa
commit f283b589ed
2 changed files with 10 additions and 1 deletions

View File

@ -260,4 +260,12 @@ void esp_wifi_register_wpa3_cb(struct wpa_funcs *wpa_cb)
wpa_cb->wpa3_parse_sae_msg = wpa3_parse_sae_msg;
}
void esp_wifi_unregister_wpa3_cb(void)
{
extern struct wpa_funcs *wpa_cb;
wpa_cb->wpa3_build_sae_msg = NULL;
wpa_cb->wpa3_parse_sae_msg = NULL;
}
#endif /* CONFIG_WPA3_SAE */

View File

@ -40,6 +40,7 @@
#include "wps/wps_defs.h"
const wifi_osi_funcs_t *wifi_funcs;
struct wpa_funcs *wpa_cb;
void wpa_install_key(enum wpa_alg alg, u8 *addr, int key_idx, int set_tx,
u8 *seq, size_t seq_len, u8 *key, size_t key_len, enum key_flag key_flag)
@ -311,7 +312,6 @@ static bool hostap_sta_join(void **sta, u8 *bssid, u8 *wpa_ie, u8 wpa_ie_len, bo
int esp_supplicant_init(void)
{
int ret = ESP_OK;
struct wpa_funcs *wpa_cb;
wifi_funcs = WIFI_OSI_FUNCS_INITIALIZER();
if (!wifi_funcs) {
@ -370,5 +370,6 @@ int esp_supplicant_deinit(void)
{
esp_supplicant_common_deinit();
eloop_destroy();
wpa_cb = NULL;
return esp_wifi_unregister_wpa_cb_internal();
}