mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-02-18 09:10:38 +01:00
eap: Introduce state reset
This is meant to reset the EAP state back to its original state without affecting any state variables obtained through load_settings. This can be useful for EAP Reauthentication triggered by the AP.
This commit is contained in:
parent
16a2fb2664
commit
5894051d6c
14
src/eap.c
14
src/eap.c
@ -93,6 +93,20 @@ void eap_set_event_func(struct eap_state *eap, eap_event_func_t func)
|
|||||||
eap->event_func = func;
|
eap->event_func = func;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool eap_reset(struct eap_state *eap)
|
||||||
|
{
|
||||||
|
if (eap->method_state && eap->method->reset_state) {
|
||||||
|
if (!eap->method->reset_state(eap))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
eap->method_success = false;
|
||||||
|
l_timeout_remove(eap->complete_timeout);
|
||||||
|
eap->complete_timeout = NULL;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void eap_free(struct eap_state *eap)
|
void eap_free(struct eap_state *eap)
|
||||||
{
|
{
|
||||||
if (eap->method_state && eap->method->free)
|
if (eap->method_state && eap->method->free)
|
||||||
|
@ -70,6 +70,7 @@ int eap_check_settings(struct l_settings *settings, struct l_queue *secrets,
|
|||||||
struct l_queue **out_missing);
|
struct l_queue **out_missing);
|
||||||
bool eap_load_settings(struct eap_state *eap, struct l_settings *settings,
|
bool eap_load_settings(struct eap_state *eap, struct l_settings *settings,
|
||||||
const char *prefix);
|
const char *prefix);
|
||||||
|
bool eap_reset(struct eap_state *eap);
|
||||||
|
|
||||||
void eap_set_key_material_func(struct eap_state *eap,
|
void eap_set_key_material_func(struct eap_state *eap,
|
||||||
eap_key_material_func_t func);
|
eap_key_material_func_t func);
|
||||||
@ -130,6 +131,9 @@ struct eap_method {
|
|||||||
bool (*load_settings)(struct eap_state *eap,
|
bool (*load_settings)(struct eap_state *eap,
|
||||||
struct l_settings *settings,
|
struct l_settings *settings,
|
||||||
const char *prefix);
|
const char *prefix);
|
||||||
|
|
||||||
|
/* Reset the internal state back to initial conditions */
|
||||||
|
bool (*reset_state)(struct eap_state *eap);
|
||||||
void (*free)(struct eap_state *eap);
|
void (*free)(struct eap_state *eap);
|
||||||
|
|
||||||
void (*handle_request)(struct eap_state *eap,
|
void (*handle_request)(struct eap_state *eap,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user