aboutsummaryrefslogtreecommitdiffstats
path: root/src/eap_common
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2019-08-16 20:25:31 (GMT)
committerJouni Malinen <j@w1.fi>2019-08-16 21:08:47 (GMT)
commit128d46be9f840b33a54b6eb14dce79bdcb3caad4 (patch)
tree6c7a3eff4a98afda088e25691445c3c66a12a13a /src/eap_common
parent234489efd12b402e9941298eae493335351b0d00 (diff)
downloadhostap-128d46be9f840b33a54b6eb14dce79bdcb3caad4.zip
hostap-128d46be9f840b33a54b6eb14dce79bdcb3caad4.tar.gz
hostap-128d46be9f840b33a54b6eb14dce79bdcb3caad4.tar.bz2
EAP-TEAP: Add parsing of Error TLV
This TLV needs to be processed properly instead of NAK'ed as unsupported. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/eap_common')
-rw-r--r--src/eap_common/eap_teap_common.c9
-rw-r--r--src/eap_common/eap_teap_common.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/src/eap_common/eap_teap_common.c b/src/eap_common/eap_teap_common.c
index ea90f58..0af7f4a 100644
--- a/src/eap_common/eap_teap_common.c
+++ b/src/eap_common/eap_teap_common.c
@@ -461,6 +461,15 @@ int eap_teap_parse_tlv(struct eap_teap_tlv_parse *tlv,
tlv->nak = pos;
tlv->nak_len = len;
break;
+ case TEAP_TLV_ERROR:
+ if (len < 4) {
+ wpa_printf(MSG_INFO, "EAP-TEAP: Too short Error TLV");
+ tlv->result = TEAP_STATUS_FAILURE;
+ break;
+ }
+ tlv->error_code = WPA_GET_BE32(pos);
+ wpa_printf(MSG_DEBUG, "EAP-TEAP: Error: %u", tlv->error_code);
+ break;
case TEAP_TLV_REQUEST_ACTION:
wpa_hexdump(MSG_MSGDUMP, "EAP-TEAP: Request-Action TLV",
pos, len);
diff --git a/src/eap_common/eap_teap_common.h b/src/eap_common/eap_teap_common.h
index 32443dc..7448cf5 100644
--- a/src/eap_common/eap_teap_common.h
+++ b/src/eap_common/eap_teap_common.h
@@ -188,6 +188,7 @@ struct eap_teap_tlv_parse {
size_t basic_auth_req_len;
u8 *basic_auth_resp;
size_t basic_auth_resp_len;
+ u32 error_code;
};
void eap_teap_put_tlv_hdr(struct wpabuf *buf, u16 type, u16 len);