xref: /freebsd/contrib/wpa/src/eap_common/eap_defs.h (revision 580744621f33383027108364dcadad718df46ffe)
1 /*
2  * EAP server/peer: Shared EAP definitions
3  * Copyright (c) 2004-2014, Jouni Malinen <j@w1.fi>
4  *
5  * This software may be distributed under the terms of the BSD license.
6  * See README for more details.
7  */
8 
9 #ifndef EAP_DEFS_H
10 #define EAP_DEFS_H
11 
12 /* RFC 3748 - Extensible Authentication Protocol (EAP) */
13 
14 #ifdef _MSC_VER
15 #pragma pack(push, 1)
16 #endif /* _MSC_VER */
17 
18 struct eap_hdr {
19 	u8 code;
20 	u8 identifier;
21 	be16 length; /* including code and identifier; network byte order */
22 	/* followed by length-4 octets of data */
23 } STRUCT_PACKED;
24 
25 #ifdef _MSC_VER
26 #pragma pack(pop)
27 #endif /* _MSC_VER */
28 
29 enum { EAP_CODE_REQUEST = 1, EAP_CODE_RESPONSE = 2, EAP_CODE_SUCCESS = 3,
30        EAP_CODE_FAILURE = 4, EAP_CODE_INITIATE = 5, EAP_CODE_FINISH = 6 };
31 
32 /* EAP Request and Response data begins with one octet Type. Success and
33  * Failure do not have additional data. */
34 
35 /* Type field in EAP-Initiate and EAP-Finish messages */
36 enum eap_erp_type {
37 	EAP_ERP_TYPE_REAUTH_START = 1,
38 	EAP_ERP_TYPE_REAUTH = 2,
39 };
40 
41 /* ERP TV/TLV types */
42 enum eap_erp_tlv_type {
43 	EAP_ERP_TLV_KEYNAME_NAI = 1,
44 	EAP_ERP_TV_RRK_LIFETIME = 2,
45 	EAP_ERP_TV_RMSK_LIFETIME = 3,
46 	EAP_ERP_TLV_DOMAIN_NAME = 4,
47 	EAP_ERP_TLV_CRYPTOSUITES = 5,
48 	EAP_ERP_TLV_AUTHORIZATION_INDICATION = 6,
49 	EAP_ERP_TLV_CALLED_STATION_ID = 128,
50 	EAP_ERP_TLV_CALLING_STATION_ID = 129,
51 	EAP_ERP_TLV_NAS_IDENTIFIER = 130,
52 	EAP_ERP_TLV_NAS_IP_ADDRESS = 131,
53 	EAP_ERP_TLV_NAS_IPV6_ADDRESS = 132,
54 };
55 
56 /* ERP Cryptosuite */
57 enum eap_erp_cryptosuite {
58 	EAP_ERP_CS_HMAC_SHA256_64 = 1,
59 	EAP_ERP_CS_HMAC_SHA256_128 = 2,
60 	EAP_ERP_CS_HMAC_SHA256_256 = 3,
61 };
62 
63 /*
64  * EAP Method Types as allocated by IANA:
65  * http://www.iana.org/assignments/eap-numbers
66  */
67 typedef enum {
68 	EAP_TYPE_NONE = 0,
69 	EAP_TYPE_IDENTITY = 1 /* RFC 3748 */,
70 	EAP_TYPE_NOTIFICATION = 2 /* RFC 3748 */,
71 	EAP_TYPE_NAK = 3 /* Response only, RFC 3748 */,
72 	EAP_TYPE_MD5 = 4, /* RFC 3748 */
73 	EAP_TYPE_OTP = 5 /* RFC 3748 */,
74 	EAP_TYPE_GTC = 6, /* RFC 3748 */
75 	EAP_TYPE_TLS = 13 /* RFC 2716 */,
76 	EAP_TYPE_LEAP = 17 /* Cisco proprietary */,
77 	EAP_TYPE_SIM = 18 /* RFC 4186 */,
78 	EAP_TYPE_TTLS = 21 /* RFC 5281 */,
79 	EAP_TYPE_AKA = 23 /* RFC 4187 */,
80 	EAP_TYPE_PEAP = 25 /* draft-josefsson-pppext-eap-tls-eap-06.txt */,
81 	EAP_TYPE_MSCHAPV2 = 26 /* draft-kamath-pppext-eap-mschapv2-00.txt */,
82 	EAP_TYPE_TLV = 33 /* draft-josefsson-pppext-eap-tls-eap-07.txt */,
83 	EAP_TYPE_TNC = 38 /* TNC IF-T v1.0-r3; note: tentative assignment;
84 			   * type 38 has previously been allocated for
85 			   * EAP-HTTP Digest, (funk.com) */,
86 	EAP_TYPE_FAST = 43 /* RFC 4851 */,
87 	EAP_TYPE_PAX = 46 /* RFC 4746 */,
88 	EAP_TYPE_PSK = 47 /* RFC 4764 */,
89 	EAP_TYPE_SAKE = 48 /* RFC 4763 */,
90 	EAP_TYPE_IKEV2 = 49 /* RFC 5106 */,
91 	EAP_TYPE_AKA_PRIME = 50 /* RFC 5448 */,
92 	EAP_TYPE_GPSK = 51 /* RFC 5433 */,
93 	EAP_TYPE_PWD = 52 /* RFC 5931 */,
94 	EAP_TYPE_EKE = 53 /* RFC 6124 */,
95 	EAP_TYPE_TEAP = 55 /* RFC 7170 */,
96 	EAP_TYPE_EXPANDED = 254 /* RFC 3748 */
97 } EapType;
98 
99 
100 /* SMI Network Management Private Enterprise Code for vendor specific types */
101 enum {
102 	EAP_VENDOR_IETF = 0,
103 	EAP_VENDOR_MICROSOFT = 0x000137 /* Microsoft */,
104 	EAP_VENDOR_WFA = 0x00372A /* Wi-Fi Alliance (moved to WBA) */,
105 	EAP_VENDOR_HOSTAP = 39068 /* hostapd/wpa_supplicant project */,
106 	EAP_VENDOR_WFA_NEW = 40808 /* Wi-Fi Alliance */
107 };
108 
109 #define EAP_VENDOR_UNAUTH_TLS EAP_VENDOR_HOSTAP
110 #define EAP_VENDOR_TYPE_UNAUTH_TLS 1
111 
112 #define EAP_VENDOR_WFA_UNAUTH_TLS 13
113 
114 #define EAP_MSK_LEN 64
115 #define EAP_EMSK_LEN 64
116 #define EAP_EMSK_NAME_LEN 8
117 #define ERP_MAX_KEY_LEN 64
118 
119 #endif /* EAP_DEFS_H */
120