]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
EAP-TEAP: Add parsing of Error TLV
authorJouni Malinen <j@w1.fi>
Fri, 16 Aug 2019 20:25:31 +0000 (23:25 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 16 Aug 2019 21:08:47 +0000 (00:08 +0300)
This TLV needs to be processed properly instead of NAK'ed as
unsupported.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/eap_common/eap_teap_common.c
src/eap_common/eap_teap_common.h

index ea90f589daa4100da088cbe0cc32d9509342937c..0af7f4a13de6b5a7389f72eb0e004b90866dd51f 100644 (file)
@@ -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);
index 32443dc36e261978de3723ed34511f7a524c041f..7448cf51de6be430146e1a5f8ccc69ddfdca5aa8 100644 (file)
@@ -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);