xref: /freebsd/contrib/wpa/src/eap_common/eap_defs.h (revision f05cddf940dbfc5b657f5e9beb9de2c31e509e5b)
139beb93cSSam Leffler /*
239beb93cSSam Leffler  * EAP server/peer: Shared EAP definitions
339beb93cSSam Leffler  * Copyright (c) 2004-2007, Jouni Malinen <j@w1.fi>
439beb93cSSam Leffler  *
5*f05cddf9SRui Paulo  * This software may be distributed under the terms of the BSD license.
6*f05cddf9SRui Paulo  * See README for more details.
739beb93cSSam Leffler  */
839beb93cSSam Leffler 
939beb93cSSam Leffler #ifndef EAP_DEFS_H
1039beb93cSSam Leffler #define EAP_DEFS_H
1139beb93cSSam Leffler 
1239beb93cSSam Leffler /* RFC 3748 - Extensible Authentication Protocol (EAP) */
1339beb93cSSam Leffler 
1439beb93cSSam Leffler #ifdef _MSC_VER
1539beb93cSSam Leffler #pragma pack(push, 1)
1639beb93cSSam Leffler #endif /* _MSC_VER */
1739beb93cSSam Leffler 
1839beb93cSSam Leffler struct eap_hdr {
1939beb93cSSam Leffler 	u8 code;
2039beb93cSSam Leffler 	u8 identifier;
2139beb93cSSam Leffler 	be16 length; /* including code and identifier; network byte order */
2239beb93cSSam Leffler 	/* followed by length-4 octets of data */
2339beb93cSSam Leffler } STRUCT_PACKED;
2439beb93cSSam Leffler 
2539beb93cSSam Leffler #ifdef _MSC_VER
2639beb93cSSam Leffler #pragma pack(pop)
2739beb93cSSam Leffler #endif /* _MSC_VER */
2839beb93cSSam Leffler 
2939beb93cSSam Leffler enum { EAP_CODE_REQUEST = 1, EAP_CODE_RESPONSE = 2, EAP_CODE_SUCCESS = 3,
3039beb93cSSam Leffler        EAP_CODE_FAILURE = 4 };
3139beb93cSSam Leffler 
3239beb93cSSam Leffler /* EAP Request and Response data begins with one octet Type. Success and
3339beb93cSSam Leffler  * Failure do not have additional data. */
3439beb93cSSam Leffler 
3539beb93cSSam Leffler /*
3639beb93cSSam Leffler  * EAP Method Types as allocated by IANA:
3739beb93cSSam Leffler  * http://www.iana.org/assignments/eap-numbers
3839beb93cSSam Leffler  */
3939beb93cSSam Leffler typedef enum {
4039beb93cSSam Leffler 	EAP_TYPE_NONE = 0,
4139beb93cSSam Leffler 	EAP_TYPE_IDENTITY = 1 /* RFC 3748 */,
4239beb93cSSam Leffler 	EAP_TYPE_NOTIFICATION = 2 /* RFC 3748 */,
4339beb93cSSam Leffler 	EAP_TYPE_NAK = 3 /* Response only, RFC 3748 */,
4439beb93cSSam Leffler 	EAP_TYPE_MD5 = 4, /* RFC 3748 */
4539beb93cSSam Leffler 	EAP_TYPE_OTP = 5 /* RFC 3748 */,
4639beb93cSSam Leffler 	EAP_TYPE_GTC = 6, /* RFC 3748 */
4739beb93cSSam Leffler 	EAP_TYPE_TLS = 13 /* RFC 2716 */,
4839beb93cSSam Leffler 	EAP_TYPE_LEAP = 17 /* Cisco proprietary */,
4939beb93cSSam Leffler 	EAP_TYPE_SIM = 18 /* RFC 4186 */,
5039beb93cSSam Leffler 	EAP_TYPE_TTLS = 21 /* RFC 5281 */,
5139beb93cSSam Leffler 	EAP_TYPE_AKA = 23 /* RFC 4187 */,
5239beb93cSSam Leffler 	EAP_TYPE_PEAP = 25 /* draft-josefsson-pppext-eap-tls-eap-06.txt */,
5339beb93cSSam Leffler 	EAP_TYPE_MSCHAPV2 = 26 /* draft-kamath-pppext-eap-mschapv2-00.txt */,
5439beb93cSSam Leffler 	EAP_TYPE_TLV = 33 /* draft-josefsson-pppext-eap-tls-eap-07.txt */,
5539beb93cSSam Leffler 	EAP_TYPE_TNC = 38 /* TNC IF-T v1.0-r3; note: tentative assignment;
5639beb93cSSam Leffler 			   * type 38 has previously been allocated for
5739beb93cSSam Leffler 			   * EAP-HTTP Digest, (funk.com) */,
5839beb93cSSam Leffler 	EAP_TYPE_FAST = 43 /* RFC 4851 */,
5939beb93cSSam Leffler 	EAP_TYPE_PAX = 46 /* RFC 4746 */,
6039beb93cSSam Leffler 	EAP_TYPE_PSK = 47 /* RFC 4764 */,
6139beb93cSSam Leffler 	EAP_TYPE_SAKE = 48 /* RFC 4763 */,
6239beb93cSSam Leffler 	EAP_TYPE_IKEV2 = 49 /* RFC 5106 */,
63*f05cddf9SRui Paulo 	EAP_TYPE_AKA_PRIME = 50 /* RFC 5448 */,
643157ba21SRui Paulo 	EAP_TYPE_GPSK = 51 /* RFC 5433 */,
65*f05cddf9SRui Paulo 	EAP_TYPE_PWD = 52 /* RFC 5931 */,
6639beb93cSSam Leffler 	EAP_TYPE_EXPANDED = 254 /* RFC 3748 */
6739beb93cSSam Leffler } EapType;
6839beb93cSSam Leffler 
6939beb93cSSam Leffler 
7039beb93cSSam Leffler /* SMI Network Management Private Enterprise Code for vendor specific types */
7139beb93cSSam Leffler enum {
7239beb93cSSam Leffler 	EAP_VENDOR_IETF = 0,
7339beb93cSSam Leffler 	EAP_VENDOR_MICROSOFT = 0x000137 /* Microsoft */,
74*f05cddf9SRui Paulo 	EAP_VENDOR_WFA = 0x00372A /* Wi-Fi Alliance */,
75*f05cddf9SRui Paulo 	EAP_VENDOR_HOSTAP = 39068 /* hostapd/wpa_supplicant project */
7639beb93cSSam Leffler };
7739beb93cSSam Leffler 
78*f05cddf9SRui Paulo #define EAP_VENDOR_UNAUTH_TLS EAP_VENDOR_HOSTAP
79*f05cddf9SRui Paulo #define EAP_VENDOR_TYPE_UNAUTH_TLS 1
80*f05cddf9SRui Paulo 
8139beb93cSSam Leffler #define EAP_MSK_LEN 64
8239beb93cSSam Leffler #define EAP_EMSK_LEN 64
8339beb93cSSam Leffler 
8439beb93cSSam Leffler #endif /* EAP_DEFS_H */
85