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-03-23 11:51:02 +05:30 committed by BOT
parent 3ce1d93958
commit a09946e3c3
2 changed files with 12 additions and 1 deletions

View File

@ -260,4 +260,13 @@ 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

@ -29,6 +29,8 @@
#include "esp_wpa2.h"
#include "esp_common_i.h"
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)
{
@ -223,7 +225,6 @@ static void wpa_sta_disconnected_cb(uint8_t reason_code)
int esp_supplicant_init(void)
{
int ret = ESP_OK;
struct wpa_funcs *wpa_cb;
wpa_cb = (struct wpa_funcs *)os_zalloc(sizeof(struct wpa_funcs));
if (!wpa_cb) {
@ -271,5 +272,6 @@ int esp_supplicant_init(void)
int esp_supplicant_deinit(void)
{
esp_supplicant_common_deinit();
wpa_cb=NULL;
return esp_wifi_unregister_wpa_cb_internal();
}