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