enum teap_error_codes error_code;
enum teap_identity_types cur_id_type;
+
+ bool check_crypto_binding;
};
static int eap_teap_process_phase2_start(struct eap_sm *sm,
struct eap_teap_data *data);
+static int eap_teap_phase2_init(struct eap_sm *sm, struct eap_teap_data *data,
+ int vendor, enum eap_type eap_type);
static const char * eap_teap_state_txt(int state)
wpa_hexdump(MSG_MSGDUMP, "EAP-TEAP: MSK Compound MAC",
cb->msk_compound_mac, sizeof(cb->msk_compound_mac));
+ data->check_crypto_binding = true;
+
return buf;
}
struct eap_teap_data *data = priv;
struct wpabuf *req = NULL;
int piggyback = 0;
+ bool move_to_method = true;
if (data->ssl.state == FRAG_ACK) {
return eap_server_tls_build_ack(id, EAP_TYPE_TEAP,
break;
case CRYPTO_BINDING:
req = eap_teap_build_crypto_binding(sm, data);
+ if (req && sm->cfg->eap_teap_auth == 0 &&
+ data->inner_eap_not_done &&
+ !data->phase2_method &&
+ sm->cfg->eap_teap_method_sequence == 0) {
+ wpa_printf(MSG_DEBUG,
+ "EAP-TEAP: Continue with inner EAP authentication for second credential (optimized)");
+ eap_teap_state(data, PHASE2_ID);
+ if (eap_teap_phase2_init(sm, data, EAP_VENDOR_IETF,
+ EAP_TYPE_IDENTITY) < 0) {
+ eap_teap_state(data, FAILURE);
+ wpabuf_free(req);
+ return NULL;
+ }
+ move_to_method = false;
+ }
if (data->phase2_method) {
/*
* Include the start of the next EAP method in the
eap = eap_teap_build_phase2_req(sm, data, id);
req = wpabuf_concat(req, eap);
- eap_teap_state(data, PHASE2_METHOD);
+ if (move_to_method)
+ eap_teap_state(data, PHASE2_METHOD);
}
break;
case REQUEST_PAC:
struct wpabuf *in_data)
{
struct eap_teap_tlv_parse tlv;
- int check_crypto_binding = data->state == CRYPTO_BINDING;
+ bool check_crypto_binding = data->state == CRYPTO_BINDING ||
+ data->check_crypto_binding;
if (eap_teap_parse_tlvs(in_data, &tlv) < 0) {
wpa_printf(MSG_DEBUG,
wpa_printf(MSG_DEBUG,
"EAP-TEAP: Valid Crypto-Binding TLV received");
+ data->check_crypto_binding = false;
if (data->final_result) {
wpa_printf(MSG_DEBUG,
"EAP-TEAP: Authentication completed successfully");
"EAP-TEAP: Continue with basic password authentication for second credential");
eap_teap_state(data, PHASE2_BASIC_AUTH);
} else if (check_crypto_binding && data->state == CRYPTO_BINDING &&
- sm->cfg->eap_teap_auth == 0 && data->inner_eap_not_done) {
+ sm->cfg->eap_teap_auth == 0 && data->inner_eap_not_done &&
+ sm->cfg->eap_teap_method_sequence == 1) {
wpa_printf(MSG_DEBUG,
"EAP-TEAP: Continue with inner EAP authentication for second credential");
eap_teap_state(data, PHASE2_ID);