diff --git a/components/wpa_supplicant/src/eapol_auth/eapol_auth_sm.c b/components/wpa_supplicant/src/eapol_auth/eapol_auth_sm.c index c77f40b00e..10d3368caf 100644 --- a/components/wpa_supplicant/src/eapol_auth/eapol_auth_sm.c +++ b/components/wpa_supplicant/src/eapol_auth/eapol_auth_sm.c @@ -327,6 +327,13 @@ SM_STATE(AUTH_PAE, AUTHENTICATING) sm->keyDone = false; } +#ifdef ESP_SUPPLICANT +static void wifi_ap_wps_disable_timeout_handler(void *eloop_ctx, void *user_ctx) +{ + extern int wifi_ap_wps_disable_internal(void); + wifi_ap_wps_disable_internal(); +} +#endif SM_STATE(AUTH_PAE, ABORTING) { @@ -344,6 +351,10 @@ SM_STATE(AUTH_PAE, ABORTING) sm->authAbort = true; sm->keyRun = false; sm->keyDone = false; +#ifdef ESP_SUPPLICANT + sm->exit_sm_step_run = true; + eloop_register_timeout(0, 0, wifi_ap_wps_disable_timeout_handler, NULL, NULL); +#endif } @@ -921,6 +932,12 @@ restart: if (sm->initializing || eapol_sm_sta_entry_alive(eapol, addr)) SM_STEP_RUN(CTRL_DIR); +#ifdef ESP_SUPPLICANT + if (sm->exit_sm_step_run) { + return; + } +#endif + if (prev_auth_pae != sm->auth_pae_state || prev_be_auth != sm->be_auth_state || prev_reauth_timer != sm->reauth_timer_state || diff --git a/components/wpa_supplicant/src/eapol_auth/eapol_auth_sm_i.h b/components/wpa_supplicant/src/eapol_auth/eapol_auth_sm_i.h index a8a5850c96..360d9dd98d 100644 --- a/components/wpa_supplicant/src/eapol_auth/eapol_auth_sm_i.h +++ b/components/wpa_supplicant/src/eapol_auth/eapol_auth_sm_i.h @@ -171,6 +171,9 @@ struct eapol_state_machine { int remediation; u64 acct_multi_session_id; +#ifdef ESP_SUPPLICANT + bool exit_sm_step_run; +#endif }; #endif /* EAPOL_AUTH_SM_I_H */