From 128d46be9f840b33a54b6eb14dce79bdcb3caad4 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 16 Aug 2019 23:25:31 +0300 Subject: [PATCH] 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 --- src/eap_common/eap_teap_common.c | 9 +++++++++ src/eap_common/eap_teap_common.h | 1 + 2 files changed, 10 insertions(+) diff --git a/src/eap_common/eap_teap_common.c b/src/eap_common/eap_teap_common.c index ea90f589d..0af7f4a13 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 32443dc36..7448cf51d 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);