xref: /freebsd/contrib/wpa/src/eap_common/eap_defs.h (revision a90b9d0159070121c221b966469c3e36d912bf82)
139beb93cSSam Leffler /*
239beb93cSSam Leffler  * EAP server/peer: Shared EAP definitions
35b9c547cSRui Paulo  * Copyright (c) 2004-2014, Jouni Malinen <j@w1.fi>
439beb93cSSam Leffler  *
5f05cddf9SRui Paulo  * This software may be distributed under the terms of the BSD license.
6f05cddf9SRui 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,
305b9c547cSRui Paulo        EAP_CODE_FAILURE = 4, EAP_CODE_INITIATE = 5, EAP_CODE_FINISH = 6 };
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 
355b9c547cSRui Paulo /* Type field in EAP-Initiate and EAP-Finish messages */
365b9c547cSRui Paulo enum eap_erp_type {
375b9c547cSRui Paulo 	EAP_ERP_TYPE_REAUTH_START = 1,
385b9c547cSRui Paulo 	EAP_ERP_TYPE_REAUTH = 2,
395b9c547cSRui Paulo };
405b9c547cSRui Paulo 
415b9c547cSRui Paulo /* ERP TV/TLV types */
425b9c547cSRui Paulo enum eap_erp_tlv_type {
435b9c547cSRui Paulo 	EAP_ERP_TLV_KEYNAME_NAI = 1,
445b9c547cSRui Paulo 	EAP_ERP_TV_RRK_LIFETIME = 2,
455b9c547cSRui Paulo 	EAP_ERP_TV_RMSK_LIFETIME = 3,
465b9c547cSRui Paulo 	EAP_ERP_TLV_DOMAIN_NAME = 4,
475b9c547cSRui Paulo 	EAP_ERP_TLV_CRYPTOSUITES = 5,
485b9c547cSRui Paulo 	EAP_ERP_TLV_AUTHORIZATION_INDICATION = 6,
495b9c547cSRui Paulo 	EAP_ERP_TLV_CALLED_STATION_ID = 128,
505b9c547cSRui Paulo 	EAP_ERP_TLV_CALLING_STATION_ID = 129,
515b9c547cSRui Paulo 	EAP_ERP_TLV_NAS_IDENTIFIER = 130,
525b9c547cSRui Paulo 	EAP_ERP_TLV_NAS_IP_ADDRESS = 131,
535b9c547cSRui Paulo 	EAP_ERP_TLV_NAS_IPV6_ADDRESS = 132,
545b9c547cSRui Paulo };
555b9c547cSRui Paulo 
565b9c547cSRui Paulo /* ERP Cryptosuite */
575b9c547cSRui Paulo enum eap_erp_cryptosuite {
585b9c547cSRui Paulo 	EAP_ERP_CS_HMAC_SHA256_64 = 1,
595b9c547cSRui Paulo 	EAP_ERP_CS_HMAC_SHA256_128 = 2,
605b9c547cSRui Paulo 	EAP_ERP_CS_HMAC_SHA256_256 = 3,
615b9c547cSRui Paulo };
625b9c547cSRui Paulo 
6339beb93cSSam Leffler /*
6439beb93cSSam Leffler  * EAP Method Types as allocated by IANA:
6539beb93cSSam Leffler  * http://www.iana.org/assignments/eap-numbers
6639beb93cSSam Leffler  */
67c1d255d3SCy Schubert enum eap_type {
6839beb93cSSam Leffler 	EAP_TYPE_NONE = 0,
6939beb93cSSam Leffler 	EAP_TYPE_IDENTITY = 1 /* RFC 3748 */,
7039beb93cSSam Leffler 	EAP_TYPE_NOTIFICATION = 2 /* RFC 3748 */,
7139beb93cSSam Leffler 	EAP_TYPE_NAK = 3 /* Response only, RFC 3748 */,
7239beb93cSSam Leffler 	EAP_TYPE_MD5 = 4, /* RFC 3748 */
7339beb93cSSam Leffler 	EAP_TYPE_OTP = 5 /* RFC 3748 */,
7439beb93cSSam Leffler 	EAP_TYPE_GTC = 6, /* RFC 3748 */
75*a90b9d01SCy Schubert 	EAP_TYPE_TLS = 13 /* RFC 5216 */,
7639beb93cSSam Leffler 	EAP_TYPE_LEAP = 17 /* Cisco proprietary */,
7739beb93cSSam Leffler 	EAP_TYPE_SIM = 18 /* RFC 4186 */,
7839beb93cSSam Leffler 	EAP_TYPE_TTLS = 21 /* RFC 5281 */,
7939beb93cSSam Leffler 	EAP_TYPE_AKA = 23 /* RFC 4187 */,
8039beb93cSSam Leffler 	EAP_TYPE_PEAP = 25 /* draft-josefsson-pppext-eap-tls-eap-06.txt */,
8139beb93cSSam Leffler 	EAP_TYPE_MSCHAPV2 = 26 /* draft-kamath-pppext-eap-mschapv2-00.txt */,
8239beb93cSSam Leffler 	EAP_TYPE_TLV = 33 /* draft-josefsson-pppext-eap-tls-eap-07.txt */,
8339beb93cSSam Leffler 	EAP_TYPE_TNC = 38 /* TNC IF-T v1.0-r3; note: tentative assignment;
8439beb93cSSam Leffler 			   * type 38 has previously been allocated for
8539beb93cSSam Leffler 			   * EAP-HTTP Digest, (funk.com) */,
8639beb93cSSam Leffler 	EAP_TYPE_FAST = 43 /* RFC 4851 */,
8739beb93cSSam Leffler 	EAP_TYPE_PAX = 46 /* RFC 4746 */,
8839beb93cSSam Leffler 	EAP_TYPE_PSK = 47 /* RFC 4764 */,
8939beb93cSSam Leffler 	EAP_TYPE_SAKE = 48 /* RFC 4763 */,
9039beb93cSSam Leffler 	EAP_TYPE_IKEV2 = 49 /* RFC 5106 */,
91f05cddf9SRui Paulo 	EAP_TYPE_AKA_PRIME = 50 /* RFC 5448 */,
923157ba21SRui Paulo 	EAP_TYPE_GPSK = 51 /* RFC 5433 */,
93f05cddf9SRui Paulo 	EAP_TYPE_PWD = 52 /* RFC 5931 */,
945b9c547cSRui Paulo 	EAP_TYPE_EKE = 53 /* RFC 6124 */,
95206b73d0SCy Schubert 	EAP_TYPE_TEAP = 55 /* RFC 7170 */,
9639beb93cSSam Leffler 	EAP_TYPE_EXPANDED = 254 /* RFC 3748 */
97c1d255d3SCy Schubert };
9839beb93cSSam Leffler 
9939beb93cSSam Leffler 
10039beb93cSSam Leffler /* SMI Network Management Private Enterprise Code for vendor specific types */
10139beb93cSSam Leffler enum {
10239beb93cSSam Leffler 	EAP_VENDOR_IETF = 0,
10339beb93cSSam Leffler 	EAP_VENDOR_MICROSOFT = 0x000137 /* Microsoft */,
1045b9c547cSRui Paulo 	EAP_VENDOR_WFA = 0x00372A /* Wi-Fi Alliance (moved to WBA) */,
1055b9c547cSRui Paulo 	EAP_VENDOR_HOSTAP = 39068 /* hostapd/wpa_supplicant project */,
1065b9c547cSRui Paulo 	EAP_VENDOR_WFA_NEW = 40808 /* Wi-Fi Alliance */
10739beb93cSSam Leffler };
10839beb93cSSam Leffler 
109f05cddf9SRui Paulo #define EAP_VENDOR_UNAUTH_TLS EAP_VENDOR_HOSTAP
110f05cddf9SRui Paulo #define EAP_VENDOR_TYPE_UNAUTH_TLS 1
111f05cddf9SRui Paulo 
1125b9c547cSRui Paulo #define EAP_VENDOR_WFA_UNAUTH_TLS 13
1135b9c547cSRui Paulo 
11439beb93cSSam Leffler #define EAP_MSK_LEN 64
11539beb93cSSam Leffler #define EAP_EMSK_LEN 64
1165b9c547cSRui Paulo #define EAP_EMSK_NAME_LEN 8
1175b9c547cSRui Paulo #define ERP_MAX_KEY_LEN 64
11839beb93cSSam Leffler 
11939beb93cSSam Leffler #endif /* EAP_DEFS_H */
120