sm->user_eap_method_index++].method;
wpa_printf(MSG_DEBUG, "EAP-TTLS: try EAP type %d",
next_type);
- eap_ttls_phase2_eap_init(sm, data, next_type);
+ if (eap_ttls_phase2_eap_init(sm, data, next_type)) {
+ wpa_printf(MSG_DEBUG, "EAP-TTLS: Failed to "
+ "initialize EAP type %d",
+ next_type);
+ eap_ttls_state(data, FAILURE);
+ return;
+ }
} else {
eap_ttls_state(data, FAILURE);
}
break;
}
- eap_ttls_phase2_eap_init(sm, data, next_type);
+ if (eap_ttls_phase2_eap_init(sm, data, next_type)) {
+ wpa_printf(MSG_DEBUG, "EAP-TTLS: Failed to initialize EAP "
+ "type %d", next_type);
+ eap_ttls_state(data, FAILURE);
+ }
}