eap-ttls: Remove eap_new calls after load_settings
load_settings ensures that ttls->eap is correctly initialized. So this code should be treated as an error condition. We also do not support EAP chaining, so remove that logic as well
This commit is contained in:
parent
2fe2ed61e1
commit
a217b4f8b9
|
@ -325,23 +325,12 @@ static void eap_ttls_eap_complete(enum eap_result result, void *user_data)
|
||||||
{
|
{
|
||||||
struct eap_state *eap = user_data;
|
struct eap_state *eap = user_data;
|
||||||
struct eap_ttls_state *ttls = eap_get_data(eap);
|
struct eap_ttls_state *ttls = eap_get_data(eap);
|
||||||
uint8_t last_id;
|
|
||||||
|
|
||||||
eap_save_last_id(ttls->eap, &last_id);
|
/*
|
||||||
|
* TODO: We currently do not implement chaining per Section 11.3,
|
||||||
/* Prepare for possible chained authentication */
|
* so simply set completed to true
|
||||||
/* We currently have no way to configure the new instance */
|
*/
|
||||||
eap_free(ttls->eap);
|
|
||||||
ttls->eap = eap_new(eap_ttls_eap_tx_packet,
|
|
||||||
eap_ttls_eap_complete, eap);
|
|
||||||
|
|
||||||
if (!ttls->eap) {
|
|
||||||
ttls->completed = true;
|
ttls->completed = true;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Preserve the last_id as mandated by 11.3 */
|
|
||||||
eap_restore_last_id(ttls->eap, last_id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void eap_ttls_ready_cb(const char *peer_identity, void *user_data)
|
static void eap_ttls_ready_cb(const char *peer_identity, void *user_data)
|
||||||
|
@ -381,14 +370,8 @@ static void eap_ttls_ready_cb(const char *peer_identity, void *user_data)
|
||||||
NULL, 0);
|
NULL, 0);
|
||||||
|
|
||||||
/* Start the EAP negotiation */
|
/* Start the EAP negotiation */
|
||||||
if (!ttls->eap) {
|
if (!ttls->eap)
|
||||||
ttls->eap = eap_new(eap_ttls_eap_tx_packet,
|
|
||||||
eap_ttls_eap_complete, eap);
|
|
||||||
if (!ttls->eap) {
|
|
||||||
l_error("Could not create the TTLS inner EAP instance");
|
|
||||||
goto err;
|
goto err;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Consume a fake Request/Identity packet so that the EAP instance
|
* Consume a fake Request/Identity packet so that the EAP instance
|
||||||
|
|
Loading…
Reference in New Issue