diff --git a/components/wpa_supplicant/src/eap_peer/eap.c b/components/wpa_supplicant/src/eap_peer/eap.c index 23903d07f1..8100830ebc 100644 --- a/components/wpa_supplicant/src/eap_peer/eap.c +++ b/components/wpa_supplicant/src/eap_peer/eap.c @@ -614,6 +614,7 @@ void eap_peer_config_deinit(struct eap_sm *sm) os_free(sm->config.new_password); os_free(sm->config.eap_methods); os_bzero(&sm->config, sizeof(struct eap_peer_config)); + config_methods = NULL; } int eap_peer_blob_init(struct eap_sm *sm) diff --git a/components/wpa_supplicant/src/esp_supplicant/esp_wpa3.c b/components/wpa_supplicant/src/esp_supplicant/esp_wpa3.c index 62fc38e561..118728906f 100644 --- a/components/wpa_supplicant/src/esp_supplicant/esp_wpa3.c +++ b/components/wpa_supplicant/src/esp_supplicant/esp_wpa3.c @@ -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 */ diff --git a/components/wpa_supplicant/src/esp_supplicant/esp_wpa_main.c b/components/wpa_supplicant/src/esp_supplicant/esp_wpa_main.c index 573b16de33..2d5405b0b4 100644 --- a/components/wpa_supplicant/src/esp_supplicant/esp_wpa_main.c +++ b/components/wpa_supplicant/src/esp_supplicant/esp_wpa_main.c @@ -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(); }