|
1 /* |
|
2 * Copyright (c) 2001-2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: EAP and WLAN authentication protocols. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #if !defined(_EAP_TYPE_SIMPLE_CONFIG_TYPES_H_) |
|
22 #define _EAP_TYPE_SIMPLE_CONFIG_TYPES_H_ |
|
23 |
|
24 #include "eap_buffer.h" |
|
25 #include "eap_type_all_types.h" |
|
26 #include "simple_config_types.h" |
|
27 #include "eap_configuration_field.h" |
|
28 |
|
29 /** @file eap_type_simple_config_types.h |
|
30 * @brief This file defines the constants of the SIMPLE_CONFIG EAP type. |
|
31 */ |
|
32 |
|
33 /** |
|
34 * This is the internal state of the SIMPLE_CONFIG EAP type. |
|
35 */ |
|
36 enum eap_type_simple_config_state_variable_e |
|
37 { |
|
38 eap_type_simple_config_state_waiting_for_identity_request , ///< Client state waiting_for_identity_request |
|
39 eap_type_simple_config_state_pending_identity_query , ///< Client state pending_identity_query |
|
40 eap_type_simple_config_state_waiting_for_simple_config_start , ///< Client state waiting_for_eap_start |
|
41 eap_type_simple_config_state_process_simple_config_start , ///< Client state process_simple_config_start |
|
42 eap_type_simple_config_state_waiting_for_request , ///< Client state waiting_for_request |
|
43 |
|
44 eap_type_simple_config_state_waiting_for_identity_response , ///< Server state waiting_for_identity_response |
|
45 eap_type_simple_config_state_waiting_for_response , ///< Server state waiting_for_response |
|
46 |
|
47 eap_type_simple_config_state_process_simple_config_message , ///< Client or server state process_simple_config_message |
|
48 |
|
49 eap_type_simple_config_state_success , ///< State state_success |
|
50 eap_type_simple_config_state_failure , ///< State state_failure |
|
51 |
|
52 eap_type_simple_config_state_last_value , ///< Keep this enum the last one. |
|
53 }; |
|
54 |
|
55 |
|
56 enum eap_type_simple_config_reassembly_state_e |
|
57 { |
|
58 eap_type_simple_config_reassembly_state_none, |
|
59 eap_type_simple_config_reassembly_state_wait_first_message, |
|
60 eap_type_simple_config_reassembly_state_wait_last_fragment, |
|
61 eap_type_simple_config_reassembly_state_message_reassembled, |
|
62 }; |
|
63 |
|
64 |
|
65 /** |
|
66 * This is the type of the SIMPLE_CONFIG authentication. |
|
67 */ |
|
68 enum eap_simple_config_authentication_type_e |
|
69 { |
|
70 SIMPLE_CONFIG_AUTHENTICATION_TYPE_NONE, |
|
71 SIMPLE_CONFIG_AUTHENTICATION_TYPE_SIMPLE_CONFIG, |
|
72 }; |
|
73 |
|
74 enum eap_type_simple_config_stored_e |
|
75 { |
|
76 eap_type_simple_config_stored_none, |
|
77 eap_type_simple_config_stored_session_id, |
|
78 eap_type_simple_config_stored_master_secret, |
|
79 eap_type_simple_config_stored_used_cipher_suite, |
|
80 eap_type_simple_config_stored_count_of_session_resumes, |
|
81 eap_type_simple_config_stored_test_every_cipher_suite_counter, |
|
82 }; |
|
83 |
|
84 /** |
|
85 * This is the size of the local send buffer. |
|
86 */ |
|
87 const u32_t EAP_SIMPLE_CONFIG_LOCAL_PACKET_BUFFER_LENGTH = EAP_MAX_LOCAL_PACKET_BUFFER_LENGTH; |
|
88 |
|
89 /** |
|
90 * This is the at character used in NAI. |
|
91 */ |
|
92 const u8_t EAP_SIMPLE_CONFIG_AT_CHARACTER = '@'; |
|
93 |
|
94 |
|
95 /** |
|
96 * This is the identity of Enrollee. |
|
97 */ |
|
98 const u8_t EAP_SIMPLE_CONFIG_ENROLLEE_IDENTITY[] = "WFA-SimpleConfig-Enrollee-1-0"; |
|
99 |
|
100 /** |
|
101 * This is the length of identity of Enrollee. |
|
102 */ |
|
103 const u32_t EAP_SIMPLE_CONFIG_ENROLLEE_IDENTITY_LENGTH = sizeof(EAP_SIMPLE_CONFIG_ENROLLEE_IDENTITY)-1; |
|
104 |
|
105 |
|
106 /** |
|
107 * This is the maximum size of the EAP-SIMPLE_CONFIG message. |
|
108 * This value limits the maximum size of the received EAP-SIMPLE_CONFIG message. |
|
109 */ |
|
110 const u32_t EAP_SIMPLE_CONFIG_MAX_MESSAGE_LENGTH = 65536ul; |
|
111 |
|
112 |
|
113 /** |
|
114 * @defgroup EAP_SIMPLE_CONFIG_config_options Configuration options of EAP-SIMPLE_CONFIG. |
|
115 * The following configuration options are read through abs_eap_base_type_c::read_configure() function. |
|
116 * @{ |
|
117 */ |
|
118 |
|
119 EAP_CONFIGURATION_FIELD( |
|
120 cf_str_EAP_SIMPLE_CONFIG_use_manual_username, |
|
121 "EAP_SIMPLE_CONFIG_use_manual_username", |
|
122 eap_configure_type_boolean, |
|
123 false); |
|
124 |
|
125 EAP_CONFIGURATION_FIELD( |
|
126 cf_str_EAP_SIMPLE_CONFIG_manual_username, |
|
127 "EAP_SIMPLE_CONFIG_manual_username", |
|
128 eap_configure_type_string, |
|
129 false); |
|
130 |
|
131 EAP_CONFIGURATION_FIELD( |
|
132 cf_str_EAP_SIMPLE_CONFIG_use_manual_realm, |
|
133 "EAP_SIMPLE_CONFIG_use_manual_realm", |
|
134 eap_configure_type_boolean, |
|
135 false); |
|
136 |
|
137 EAP_CONFIGURATION_FIELD( |
|
138 cf_str_EAP_SIMPLE_CONFIG_manual_realm, |
|
139 "EAP_SIMPLE_CONFIG_manual_realm", |
|
140 eap_configure_type_string, |
|
141 false); |
|
142 |
|
143 /** |
|
144 * This is boolean configuration option. |
|
145 * True value means on EAP-type SIMPLE_CONFIG must check identifier of EAP-Response/Identity message. |
|
146 * False value means on EAP-type SIMPLE_CONFIG does not check identifier of EAP-Response/Identity message. |
|
147 * This is not possible in cases where identifier of the EAP-Request/Identity is generated by other network entities. |
|
148 * Default value is false. |
|
149 */ |
|
150 EAP_CONFIGURATION_FIELD( |
|
151 cf_str_EAP_SIMPLE_CONFIG_check_identifier_of_eap_identity_response, |
|
152 "EAP_SIMPLE_CONFIG_check_identifier_of_eap_identity_response", |
|
153 eap_configure_type_boolean, |
|
154 false); |
|
155 |
|
156 /** |
|
157 * This is boolean configuration option. |
|
158 * This flag activates NAI realm check. Default value is false. |
|
159 * When active NAI realm muts be the same as realm given by EAP_SIMPLE_CONFIG_manual_realm option. |
|
160 * Default value is false. |
|
161 */ |
|
162 EAP_CONFIGURATION_FIELD( |
|
163 cf_str_EAP_SIMPLE_CONFIG_check_nai_realm, |
|
164 "EAP_SIMPLE_CONFIG_check_nai_realm", |
|
165 eap_configure_type_boolean, |
|
166 false); |
|
167 |
|
168 /** |
|
169 * This is boolean configuration option. |
|
170 * This is for testing. |
|
171 * True value means on test version of EAP-type SIMPLE_CONFIG is used. |
|
172 * Test version tries to make as many authentications as it is possible. |
|
173 * False value means on real version of EAP-type SIMPLE_CONFIG is used. |
|
174 * Default value is false. |
|
175 */ |
|
176 EAP_CONFIGURATION_FIELD( |
|
177 cf_str_EAP_SIMPLE_CONFIG_test_version, |
|
178 "EAP_SIMPLE_CONFIG_test_version", |
|
179 eap_configure_type_boolean, |
|
180 false); |
|
181 |
|
182 |
|
183 /** |
|
184 * This u32_t configuration option is the timeout in milli seconds after |
|
185 * the erroneus message is processed. |
|
186 * Default value is 15000 ms = 15 seconds. |
|
187 */ |
|
188 EAP_CONFIGURATION_FIELD( |
|
189 cf_str_SIMPLE_CONFIG_error_message_received_timeout, |
|
190 "SIMPLE_CONFIG_error_message_received_timeout", |
|
191 eap_configure_type_u32_t, |
|
192 false); |
|
193 |
|
194 /** |
|
195 * This hex data configuration option is the device password. |
|
196 * Default value is empty. This must be configured in adaptation module. |
|
197 */ |
|
198 EAP_CONFIGURATION_FIELD( |
|
199 cf_str_EAP_SIMPLE_CONFIG_device_password, |
|
200 "EAP_SIMPLE_CONFIG_device_password", |
|
201 eap_configure_type_hex_data, |
|
202 true); |
|
203 |
|
204 |
|
205 /** |
|
206 * This hex data configuration option is the server device password. |
|
207 * Default value is empty. This is optional value for testing purposes. |
|
208 */ |
|
209 EAP_CONFIGURATION_FIELD( |
|
210 cf_str_EAP_SIMPLE_CONFIG_server_device_password, |
|
211 "EAP_SIMPLE_CONFIG_server_device_password", |
|
212 eap_configure_type_hex_data, |
|
213 true); |
|
214 |
|
215 |
|
216 /** |
|
217 * This hex data configuration option is the new password on the Enrollee. |
|
218 * Default value is empty. This is optional. |
|
219 */ |
|
220 EAP_CONFIGURATION_FIELD( |
|
221 cf_str_SIMPLE_CONFIG_new_password, |
|
222 "SIMPLE_CONFIG_new_password", |
|
223 eap_configure_type_hex_data, |
|
224 true); |
|
225 |
|
226 |
|
227 /** |
|
228 * This is boolean configuration option. |
|
229 * True value of this flag causes client return random |
|
230 * identity on EAP-Response/Identity. |
|
231 * False value causes client return real identity |
|
232 * (IMSI, pseudonym or re-authentication identity) |
|
233 * in EAP-Response/Identity. |
|
234 * Default value is false. |
|
235 */ |
|
236 EAP_CONFIGURATION_FIELD( |
|
237 cf_str_EAP_SIMPLE_CONFIG_use_random_identity_on_eap_identity_response, |
|
238 "EAP_SIMPLE_CONFIG_use_random_identity_on_eap_identity_response", |
|
239 eap_configure_type_boolean, |
|
240 false); |
|
241 |
|
242 /** |
|
243 * This is boolean configuration option. |
|
244 * This is used in simulator testing. |
|
245 * True value means queries to AM are completed asyncronous. |
|
246 * False value means queries to AM are completed syncronous. |
|
247 */ |
|
248 EAP_CONFIGURATION_FIELD( |
|
249 cf_str_EAP_SIMPLE_CONFIG_do_asyncronous_completions, |
|
250 "EAP_SIMPLE_CONFIG_do_asyncronous_completions", |
|
251 eap_configure_type_boolean, |
|
252 false); |
|
253 |
|
254 /** |
|
255 * This is boolean configuration option. |
|
256 * This is used in simulator testing. |
|
257 * True value means queries to AM are randomly completed asyncronous. |
|
258 * False value means queries to AM are randomly completed syncronous. |
|
259 */ |
|
260 EAP_CONFIGURATION_FIELD( |
|
261 cf_str_EAP_SIMPLE_CONFIG_do_asyncronous_completions_randomly, |
|
262 "EAP_SIMPLE_CONFIG_do_asyncronous_completions_randomly", |
|
263 eap_configure_type_boolean, |
|
264 false); |
|
265 |
|
266 /** |
|
267 * This is boolean configuration option. |
|
268 * This is used in simulator testing. |
|
269 * True value means queries to AM are randomly failed. |
|
270 * False value means queries to AM are randomly failed. |
|
271 */ |
|
272 EAP_CONFIGURATION_FIELD( |
|
273 cf_str_EAP_SIMPLE_CONFIG_fail_registration_randomly, |
|
274 "EAP_SIMPLE_CONFIG_fail_registration_randomly", |
|
275 eap_configure_type_boolean, |
|
276 false); |
|
277 |
|
278 /** |
|
279 * This is u32_t configuration option. |
|
280 * This is used in simulator testing. |
|
281 * Value is the maximum completion time (ms) when completitions are |
|
282 * completed randomly. |
|
283 */ |
|
284 EAP_CONFIGURATION_FIELD( |
|
285 cf_str_EAP_SIMPLE_CONFIG_max_simple_config_completion_time, |
|
286 "EAP_SIMPLE_CONFIG_max_simple_config_completion_time", |
|
287 eap_configure_type_u32_t, |
|
288 false); |
|
289 |
|
290 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
291 |
|
292 /** |
|
293 * This hex data configuration option is the Network Key on the Enrollee. |
|
294 * Default value is empty. This is optional. |
|
295 */ |
|
296 EAP_CONFIGURATION_FIELD( |
|
297 cf_str_SIMPLE_CONFIG_network_key, |
|
298 "SIMPLE_CONFIG_network_key", |
|
299 eap_configure_type_hex_data, |
|
300 true); |
|
301 |
|
302 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
303 |
|
304 /** |
|
305 * This hex data configuration option is the Authentication Type on the Enrollee. |
|
306 * Default value is empty. This is optional. |
|
307 */ |
|
308 EAP_CONFIGURATION_FIELD( |
|
309 cf_str_SIMPLE_CONFIG_authentication_type, |
|
310 "SIMPLE_CONFIG_authentication_type", |
|
311 eap_configure_type_string, |
|
312 true); |
|
313 |
|
314 EAP_CONFIGURATION_FIELD( |
|
315 cf_str_SIMPLE_CONFIG_authentication_type_None, |
|
316 "None", |
|
317 eap_configure_type_string, |
|
318 false); |
|
319 |
|
320 EAP_CONFIGURATION_FIELD( |
|
321 cf_str_SIMPLE_CONFIG_authentication_type_Open, |
|
322 "Open", |
|
323 eap_configure_type_string, |
|
324 false); |
|
325 |
|
326 EAP_CONFIGURATION_FIELD( |
|
327 cf_str_SIMPLE_CONFIG_authentication_type_WPAPSK, |
|
328 "WPAPSK", |
|
329 eap_configure_type_string, |
|
330 false); |
|
331 |
|
332 EAP_CONFIGURATION_FIELD( |
|
333 cf_str_SIMPLE_CONFIG_authentication_type_Shared, |
|
334 "Shared", |
|
335 eap_configure_type_string, |
|
336 false); |
|
337 |
|
338 EAP_CONFIGURATION_FIELD( |
|
339 cf_str_SIMPLE_CONFIG_authentication_type_WPA, |
|
340 "WPA", |
|
341 eap_configure_type_string, |
|
342 false); |
|
343 |
|
344 EAP_CONFIGURATION_FIELD( |
|
345 cf_str_SIMPLE_CONFIG_authentication_type_WPA2, |
|
346 "WPA2", |
|
347 eap_configure_type_string, |
|
348 false); |
|
349 |
|
350 EAP_CONFIGURATION_FIELD( |
|
351 cf_str_SIMPLE_CONFIG_authentication_type_WPA2PSK, |
|
352 "WPA2PSK", |
|
353 eap_configure_type_string, |
|
354 false); |
|
355 |
|
356 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
357 |
|
358 /** @} */ // End of group EAP_SIMPLE_CONFIG_config_options. |
|
359 |
|
360 //-------------------------------------------------- |
|
361 |
|
362 |
|
363 #endif //#if !defined(_EAP_TYPE_SIMPLE_CONFIG_TYPES_H_) |
|
364 |
|
365 //-------------------------------------------------- |
|
366 |
|
367 |
|
368 |
|
369 // End. |