aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2008-02-10 18:52:31 (GMT)
committerJouni Malinen <j@w1.fi>2008-02-10 18:52:31 (GMT)
commitc2717b85e445abbcce63bb5e8e74ed18b0de50a9 (patch)
tree43ede09184e5b1364047d78c8071473e95e23055
parent9d5f4d2cc11d73ba7074fe4a60e3e796156b744e (diff)
downloadhostap-history-c2717b85e445abbcce63bb5e8e74ed18b0de50a9.zip
hostap-history-c2717b85e445abbcce63bb5e8e74ed18b0de50a9.tar.gz
hostap-history-c2717b85e445abbcce63bb5e8e74ed18b0de50a9.tar.bz2
Updated EAP-TLV definitions to use new EAP-PEAP draft version -10
draft-josefsson-ppext-eap-tls-eap-10.txt removes conflicts with the TLV types defined for EAP-FAST (RFC 4851), so this cleans up some of the definitions.
-rw-r--r--src/eap_common/eap_tlv_common.h21
-rw-r--r--src/eap_peer/eap_fast.c4
-rw-r--r--src/eap_server/eap_fast.c4
-rw-r--r--src/eap_server/eap_peap.c2
4 files changed, 17 insertions, 14 deletions
diff --git a/src/eap_common/eap_tlv_common.h b/src/eap_common/eap_tlv_common.h
index 691ed92..75a3b49 100644
--- a/src/eap_common/eap_tlv_common.h
+++ b/src/eap_common/eap_tlv_common.h
@@ -1,6 +1,6 @@
/*
- * EAP-TLV definitions (draft-josefsson-pppext-eap-tls-eap-07.txt)
- * Copyright (c) 2004-2007, Jouni Malinen <j@w1.fi>
+ * EAP-TLV definitions (draft-josefsson-pppext-eap-tls-eap-10.txt)
+ * Copyright (c) 2004-2008, Jouni Malinen <j@w1.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -15,11 +15,10 @@
#ifndef EAP_TLV_COMMON_H
#define EAP_TLV_COMMON_H
-/* EAP-TLV TLVs (draft-josefsson-ppext-eap-tls-eap-07.txt) */
+/* EAP-TLV TLVs (draft-josefsson-ppext-eap-tls-eap-10.txt) */
#define EAP_TLV_RESULT_TLV 3 /* Acknowledged Result */
#define EAP_TLV_NAK_TLV 4
-/* Note: RFC 4851, Section 4.2.4 defines 5 as Error TLV */
-#define EAP_TLV_CRYPTO_BINDING_TLV 5
+#define EAP_TLV_ERROR_CODE_TLV 5
#define EAP_TLV_CONNECTION_BINDING_TLV 6
#define EAP_TLV_VENDOR_SPECIFIC_TLV 7
#define EAP_TLV_URI_TLV 8
@@ -27,17 +26,21 @@
#define EAP_TLV_INTERMEDIATE_RESULT_TLV 10
#define EAP_TLV_PAC_TLV 11 /* draft-cam-winget-eap-fast-provisioning-04.txt,
* Section 4.2 */
-#define EAP_TLV_CRYPTO_BINDING_TLV_ 12 /* RFC 4851, Section 4.2.8 */
-/* draft-cam-winget-eap-fast-provisiong-04.txt, Section 4.3.1 */
+#define EAP_TLV_CRYPTO_BINDING_TLV 12
+#define EAP_TLV_CALLING_STATION_ID_TLV 13
+#define EAP_TLV_CALLED_STATION_ID_TLV 14
+#define EAP_TLV_NAS_PORT_TYPE_TLV 15
+#define EAP_TLV_SERVER_IDENTIFIER_TLV 16
+#define EAP_TLV_IDENTITY_TYPE_TLV 17
#define EAP_TLV_SERVER_TRUSTED_ROOT_TLV 18
-#define EAP_TLV_REQUEST_ACTION_TLV 19 /* RFC 4851, Section 4.2.9 */
-/* draft-cam-winget-eap-fast-provisiong-04.txt, Section 4.3.2 */
+#define EAP_TLV_REQUEST_ACTION_TLV 19
#define EAP_TLV_PKCS7_TLV 20
#define EAP_TLV_RESULT_SUCCESS 1
#define EAP_TLV_RESULT_FAILURE 2
#define EAP_TLV_TYPE_MANDATORY 0x8000
+#define EAP_TLV_TYPE_MASK 0x3fff
#ifdef _MSC_VER
#pragma pack(push, 1)
diff --git a/src/eap_peer/eap_fast.c b/src/eap_peer/eap_fast.c
index d2e3d09..caca89e 100644
--- a/src/eap_peer/eap_fast.c
+++ b/src/eap_peer/eap_fast.c
@@ -691,7 +691,7 @@ static void eap_fast_write_crypto_binding(
struct eap_tlv_crypto_binding__tlv *_bind, const u8 *cmk)
{
rbind->tlv_type = host_to_be16(EAP_TLV_TYPE_MANDATORY |
- EAP_TLV_CRYPTO_BINDING_TLV_);
+ EAP_TLV_CRYPTO_BINDING_TLV);
rbind->length = host_to_be16(sizeof(*rbind) -
sizeof(struct eap_tlv_hdr));
rbind->version = EAP_FAST_VERSION;
@@ -1230,7 +1230,7 @@ static int eap_fast_parse_tlv(struct eap_fast_tlv_parse *tlv,
tlv->iresult == EAP_TLV_RESULT_SUCCESS ?
"Success" : "Failure");
break;
- case EAP_TLV_CRYPTO_BINDING_TLV_:
+ case EAP_TLV_CRYPTO_BINDING_TLV:
wpa_hexdump(MSG_MSGDUMP, "EAP-FAST: Crypto-Binding TLV",
pos, len);
tlv->crypto_binding_len = sizeof(struct eap_tlv_hdr) + len;
diff --git a/src/eap_server/eap_fast.c b/src/eap_server/eap_fast.c
index 01341a4..86d27e4 100644
--- a/src/eap_server/eap_fast.c
+++ b/src/eap_server/eap_fast.c
@@ -711,7 +711,7 @@ static struct wpabuf * eap_fast_build_crypto_binding(
/* Crypto-Binding TLV */
binding = wpabuf_put(buf, sizeof(*binding));
binding->tlv_type = host_to_be16(EAP_TLV_TYPE_MANDATORY |
- EAP_TLV_CRYPTO_BINDING_TLV_);
+ EAP_TLV_CRYPTO_BINDING_TLV);
binding->length = host_to_be16(sizeof(*binding) -
sizeof(struct eap_tlv_hdr));
binding->version = EAP_FAST_VERSION;
@@ -1165,7 +1165,7 @@ static int eap_fast_parse_tlv(struct eap_fast_tlv_parse *tlv,
tlv->iresult == EAP_TLV_RESULT_SUCCESS ?
"Success" : "Failure");
break;
- case EAP_TLV_CRYPTO_BINDING_TLV_:
+ case EAP_TLV_CRYPTO_BINDING_TLV:
wpa_hexdump(MSG_MSGDUMP, "EAP-FAST: Crypto-Binding TLV",
pos, len);
if (tlv->crypto_binding) {
diff --git a/src/eap_server/eap_peap.c b/src/eap_server/eap_peap.c
index a5033d3..114032b 100644
--- a/src/eap_server/eap_peap.c
+++ b/src/eap_server/eap_peap.c
@@ -594,7 +594,7 @@ static void eap_peap_process_phase2(struct eap_sm *sm,
return;
}
tlv = wpabuf_mhead(in_decrypted);
- if ((be_to_host16(tlv->tlv_type) & 0x3fff) !=
+ if ((be_to_host16(tlv->tlv_type) & EAP_TLV_TYPE_MASK) !=
EAP_TLV_EAP_PAYLOAD_TLV) {
wpa_printf(MSG_INFO, "EAP-PEAPv2: Not an EAP TLV");
wpabuf_free(in_decrypted);