1580
1580
data->resuming = 0;
1585
* Application data included in the handshake message.
1587
free(data->pending_phase2_req);
1588
data->pending_phase2_req = resp;
1589
data->pending_phase2_req_len = *respDataLen;
1592
res = eap_ttls_decrypt(sm, data, ret, req, pos, left,
1593
&resp, respDataLen);
1584
1597
if (data->ttls_version == 0 && ret->methodState == METHOD_DONE) {
1643
1659
size_t buflen, int verbose)
1645
1661
struct eap_ttls_data *data = priv;
1648
1664
len = eap_tls_status(sm, &data->ssl, buf, buflen, verbose);
1649
len += snprintf(buf + len, buflen - len, "EAP-TTLSv%d Phase2 method=",
1650
data->ttls_version);
1665
ret = snprintf(buf + len, buflen - len, "EAP-TTLSv%d Phase2 method=",
1666
data->ttls_version);
1667
if (ret < 0 || (size_t) ret >= buflen - len)
1651
1670
switch (data->phase2_type) {
1652
1671
case EAP_TTLS_PHASE2_EAP:
1653
len += snprintf(buf + len, buflen - len, "EAP-%s\n",
1654
data->phase2_method ? data->phase2_method->name
1672
ret = snprintf(buf + len, buflen - len, "EAP-%s\n",
1673
data->phase2_method ? data->phase2_method->name
1657
1676
case EAP_TTLS_PHASE2_MSCHAPV2:
1658
len += snprintf(buf + len, buflen - len, "MSCHAPV2\n");
1677
ret = snprintf(buf + len, buflen - len, "MSCHAPV2\n");
1660
1679
case EAP_TTLS_PHASE2_MSCHAP:
1661
len += snprintf(buf + len, buflen - len, "MSCHAP\n");
1680
ret = snprintf(buf + len, buflen - len, "MSCHAP\n");
1663
1682
case EAP_TTLS_PHASE2_PAP:
1664
len += snprintf(buf + len, buflen - len, "PAP\n");
1683
ret = snprintf(buf + len, buflen - len, "PAP\n");
1666
1685
case EAP_TTLS_PHASE2_CHAP:
1667
len += snprintf(buf + len, buflen - len, "CHAP\n");
1686
ret = snprintf(buf + len, buflen - len, "CHAP\n");
1692
if (ret < 0 || (size_t) ret >= buflen - len)