|
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 * %version: 34 % |
|
20 */ |
|
21 |
|
22 // This is enumeration of EAPOL source code. |
|
23 #if defined(USE_EAP_MINIMUM_RELEASE_TRACES) |
|
24 #undef EAP_FILE_NUMBER_ENUM |
|
25 #define EAP_FILE_NUMBER_ENUM 60 |
|
26 #undef EAP_FILE_NUMBER_DATE |
|
27 #define EAP_FILE_NUMBER_DATE 1127594498 |
|
28 #endif //#if defined(USE_EAP_MINIMUM_RELEASE_TRACES) |
|
29 |
|
30 |
|
31 |
|
32 #include "eap_am_memory.h" |
|
33 #include "eap_tools.h" |
|
34 #include "eap_core_client_message_if.h" |
|
35 #include "eap_state_notification.h" |
|
36 #include "eap_network_id_selector.h" |
|
37 #include "abs_eap_am_mutex.h" |
|
38 #include "eap_config.h" |
|
39 #include "eap_core.h" |
|
40 #include "eap_buffer.h" |
|
41 #include "eap_base_type.h" |
|
42 #include "eap_automatic_variable.h" |
|
43 #include "eap_process_tlv_message_data.h" |
|
44 #include "eap_master_session_key.h" |
|
45 #include "eapol_key_types.h" |
|
46 |
|
47 #if defined(USE_EAP_SIMPLE_CONFIG) |
|
48 #include "simple_config_types.h" |
|
49 #include "simple_config_credential.h" |
|
50 #include "simple_config_payloads.h" |
|
51 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
|
52 |
|
53 //-------------------------------------------------- |
|
54 |
|
55 // |
|
56 EAP_FUNC_EXPORT eap_core_client_message_if_c::~eap_core_client_message_if_c() |
|
57 { |
|
58 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
59 |
|
60 EAP_TRACE_DEBUG( |
|
61 m_am_tools, |
|
62 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
63 (EAPL("eap_core_client_message_if_c::~eap_core_client_message_if_c(): this = 0x%08x => 0x%08x.\n"), |
|
64 this, |
|
65 dynamic_cast<abs_eap_base_timer_c *>(this))); |
|
66 |
|
67 EAP_ASSERT(m_shutdown_was_called == true); |
|
68 |
|
69 delete m_server_if; |
|
70 m_server_if = 0; |
|
71 |
|
72 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
73 } |
|
74 |
|
75 //-------------------------------------------------- |
|
76 |
|
77 #if defined(_WIN32) && !defined(__GNUC__) |
|
78 #pragma warning( disable : 4355 ) // 'this' : used in base member initializer list |
|
79 #endif |
|
80 |
|
81 // |
|
82 EAP_FUNC_EXPORT eap_core_client_message_if_c::eap_core_client_message_if_c( |
|
83 abs_eap_am_tools_c * const tools, |
|
84 eap_am_message_if_c * const server, |
|
85 abs_eap_session_core_c * const partner, |
|
86 const bool is_client_when_true) |
|
87 : m_am_tools(tools) |
|
88 , m_server_if(server) |
|
89 , m_partner(partner) |
|
90 , m_error_code(eap_status_ok) |
|
91 , m_error_function(eap_tlv_message_type_function_none) |
|
92 , m_eap_header_offset(0ul) |
|
93 , m_MTU(0ul) |
|
94 , m_trailer_length(0ul) |
|
95 , m_is_client(is_client_when_true) |
|
96 , m_is_valid(false) |
|
97 , m_shutdown_was_called(false) |
|
98 { |
|
99 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
100 |
|
101 EAP_TRACE_DEBUG( |
|
102 m_am_tools, |
|
103 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
104 (EAPL("eap_core_client_message_if_c::eap_core_client_message_if_c(): this = 0x%08x => 0x%08x.\n"), |
|
105 this, |
|
106 dynamic_cast<abs_eap_base_timer_c *>(this))); |
|
107 |
|
108 set_is_valid(); |
|
109 |
|
110 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
111 } |
|
112 |
|
113 //-------------------------------------------------- |
|
114 |
|
115 EAP_FUNC_EXPORT eap_status_e eap_core_client_message_if_c::process_message(eap_process_tlv_message_data_c * const message) |
|
116 { |
|
117 // Sends message data composed of Attribute-Value Pairs. |
|
118 |
|
119 EAP_TRACE_DEBUG( |
|
120 m_am_tools, |
|
121 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
122 (EAPL("eap_core_client_message_if_c::process_message(): this = 0x%08x => 0x%08x.\n"), |
|
123 this, |
|
124 dynamic_cast<abs_eap_base_timer_c *>(this))); |
|
125 |
|
126 EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_core_client_message_if_c::send_message()"); |
|
127 |
|
128 EAP_TRACE_DATA_DEBUG( |
|
129 m_am_tools, |
|
130 EAP_TRACE_FLAGS_NEVER, |
|
131 (EAPL("eap_core_client_message_if_c::send_message()"), |
|
132 message->get_message_data(), |
|
133 message->get_message_data_length())); |
|
134 |
|
135 { |
|
136 eap_status_e send_status = m_server_if->process_data( |
|
137 message->get_message_data(), |
|
138 message->get_message_data_length()); |
|
139 if (send_status != eap_status_ok) |
|
140 { |
|
141 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
142 return EAP_STATUS_RETURN(m_am_tools, send_status); |
|
143 } |
|
144 |
|
145 |
|
146 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
147 return EAP_STATUS_RETURN(m_am_tools, send_status); |
|
148 } |
|
149 |
|
150 } |
|
151 |
|
152 //-------------------------------------------------- |
|
153 |
|
154 // |
|
155 EAP_FUNC_EXPORT void eap_core_client_message_if_c::set_is_valid() |
|
156 { |
|
157 m_is_valid = true; |
|
158 } |
|
159 |
|
160 //-------------------------------------------------- |
|
161 |
|
162 // |
|
163 EAP_FUNC_EXPORT bool eap_core_client_message_if_c::get_is_valid() |
|
164 { |
|
165 return m_is_valid; |
|
166 } |
|
167 |
|
168 //-------------------------------------------------- |
|
169 |
|
170 EAP_FUNC_EXPORT eap_status_e eap_core_client_message_if_c::reset() |
|
171 { |
|
172 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
173 |
|
174 EAP_TRACE_DEBUG( |
|
175 m_am_tools, |
|
176 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
177 (EAPL("eap_core_client_message_if_c::reset(): this = 0x%08x => 0x%08x.\n"), |
|
178 this, |
|
179 dynamic_cast<abs_eap_base_timer_c *>(this))); |
|
180 |
|
181 EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_core_client_message_if_c::reset()"); |
|
182 |
|
183 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
184 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
185 } |
|
186 |
|
187 //-------------------------------------------------- |
|
188 |
|
189 // |
|
190 EAP_FUNC_EXPORT eap_status_e eap_core_client_message_if_c::packet_process( |
|
191 const eap_am_network_id_c * const receive_network_id, |
|
192 eap_general_header_base_c * const packet_data, |
|
193 const u32_t packet_length) |
|
194 { |
|
195 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
196 |
|
197 EAP_TRACE_DEBUG( |
|
198 m_am_tools, |
|
199 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
200 (EAPL("eap_core_client_message_if_c::packet_process(): this = 0x%08x => 0x%08x.\n"), |
|
201 this, |
|
202 dynamic_cast<abs_eap_base_timer_c *>(this))); |
|
203 |
|
204 EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_core_client_message_if_c::packet_process()"); |
|
205 |
|
206 EAP_ASSERT(m_am_tools->get_global_mutex()->get_is_reserved() == true); |
|
207 |
|
208 eap_status_e status(eap_status_process_general_error); |
|
209 |
|
210 // Creates message data composed of Attribute-Value Pairs. |
|
211 eap_process_tlv_message_data_c message(m_am_tools); |
|
212 |
|
213 if (message.get_is_valid() == false) |
|
214 { |
|
215 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
216 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
217 } |
|
218 |
|
219 status = message.add_parameter_data(eap_tlv_message_type_function_packet_process); |
|
220 if (status != eap_status_ok) |
|
221 { |
|
222 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
223 return EAP_STATUS_RETURN(m_am_tools, status); |
|
224 } |
|
225 |
|
226 status = message.add_parameter_data( |
|
227 receive_network_id); |
|
228 if (status != eap_status_ok) |
|
229 { |
|
230 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
231 return EAP_STATUS_RETURN(m_am_tools, status); |
|
232 } |
|
233 |
|
234 if (packet_length != packet_data->get_header_buffer_length()) |
|
235 { |
|
236 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
237 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
238 } |
|
239 |
|
240 status = message.add_parameter_data( |
|
241 packet_data); |
|
242 if (status != eap_status_ok) |
|
243 { |
|
244 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
245 return EAP_STATUS_RETURN(m_am_tools, status); |
|
246 } |
|
247 |
|
248 status = process_message(&message); |
|
249 |
|
250 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
251 return EAP_STATUS_RETURN(m_am_tools, status); |
|
252 } |
|
253 |
|
254 //-------------------------------------------------- |
|
255 |
|
256 // |
|
257 EAP_FUNC_EXPORT eap_status_e eap_core_client_message_if_c::configure() |
|
258 { |
|
259 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
260 |
|
261 EAP_ASSERT(m_am_tools->get_global_mutex()->get_is_reserved() == true); |
|
262 |
|
263 m_eap_header_offset = m_partner->get_header_offset( |
|
264 &m_MTU, &m_trailer_length); |
|
265 |
|
266 eap_variable_data_c client_configuration(m_am_tools); |
|
267 |
|
268 eap_status_e status = m_partner->read_configure( |
|
269 cf_str_EAP_read_all_configurations.get_field(), |
|
270 &client_configuration); |
|
271 if (status != eap_status_ok) |
|
272 { |
|
273 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
274 return EAP_STATUS_RETURN(m_am_tools, status); |
|
275 } |
|
276 |
|
277 status = m_server_if->configure(&client_configuration); |
|
278 if (status != eap_status_ok) |
|
279 { |
|
280 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
281 return EAP_STATUS_RETURN(m_am_tools, status); |
|
282 } |
|
283 |
|
284 status = eap_mtu(m_MTU); |
|
285 if (status != eap_status_ok) |
|
286 { |
|
287 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
288 return EAP_STATUS_RETURN(m_am_tools, status); |
|
289 } |
|
290 |
|
291 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
292 return EAP_STATUS_RETURN(m_am_tools, status); |
|
293 } |
|
294 |
|
295 //-------------------------------------------------- |
|
296 |
|
297 // |
|
298 EAP_FUNC_EXPORT eap_status_e eap_core_client_message_if_c::shutdown() |
|
299 { |
|
300 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
301 |
|
302 EAP_ASSERT(m_am_tools->get_global_mutex()->get_is_reserved() == true); |
|
303 |
|
304 EAP_TRACE_DEBUG( |
|
305 m_am_tools, |
|
306 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
307 (EAPL("eap_core_client_message_if_c::shutdown(): this = 0x%08x => 0x%08x.\n"), |
|
308 this, |
|
309 dynamic_cast<abs_eap_base_timer_c *>(this))); |
|
310 |
|
311 if (m_shutdown_was_called == true) |
|
312 { |
|
313 // Shutdown function was called already. |
|
314 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
315 } |
|
316 m_shutdown_was_called = true; |
|
317 |
|
318 if (m_server_if != 0) |
|
319 { |
|
320 (void)m_server_if->shutdown(); |
|
321 } |
|
322 |
|
323 eap_status_e status = reset(); |
|
324 |
|
325 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
326 return EAP_STATUS_RETURN(m_am_tools, status); |
|
327 } |
|
328 |
|
329 //-------------------------------------------------- |
|
330 |
|
331 // |
|
332 eap_status_e eap_core_client_message_if_c::eap_mtu( |
|
333 const u32_t MTU) |
|
334 { |
|
335 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
336 |
|
337 EAP_TRACE_DEBUG( |
|
338 m_am_tools, |
|
339 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
340 (EAPL("eap_core_client_message_if_c::eap_mtu(): this = 0x%08x => 0x%08x.\n"), |
|
341 this, |
|
342 dynamic_cast<abs_eap_base_timer_c *>(this))); |
|
343 |
|
344 EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_core_client_message_if_c::eap_mtu()"); |
|
345 |
|
346 EAP_ASSERT(m_am_tools->get_global_mutex()->get_is_reserved() == true); |
|
347 |
|
348 eap_status_e status(eap_status_process_general_error); |
|
349 |
|
350 { |
|
351 // Creates message data composed of Attribute-Value Pairs. |
|
352 eap_process_tlv_message_data_c message(m_am_tools); |
|
353 |
|
354 if (message.get_is_valid() == false) |
|
355 { |
|
356 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
357 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
358 } |
|
359 |
|
360 status = message.add_parameter_data(eap_tlv_message_type_function_eap_mtu); |
|
361 if (status != eap_status_ok) |
|
362 { |
|
363 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
364 return EAP_STATUS_RETURN(m_am_tools, status); |
|
365 } |
|
366 |
|
367 status = message.add_parameter_data(MTU); |
|
368 if (status != eap_status_ok) |
|
369 { |
|
370 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
371 return EAP_STATUS_RETURN(m_am_tools, status); |
|
372 } |
|
373 |
|
374 status = process_message(&message); |
|
375 if (status != eap_status_ok) |
|
376 { |
|
377 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
378 return EAP_STATUS_RETURN(m_am_tools, status); |
|
379 } |
|
380 } |
|
381 |
|
382 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
383 return EAP_STATUS_RETURN(m_am_tools, status); |
|
384 } |
|
385 |
|
386 //-------------------------------------------------- |
|
387 |
|
388 // |
|
389 EAP_FUNC_EXPORT eap_status_e eap_core_client_message_if_c::eap_acknowledge( |
|
390 const eap_am_network_id_c * const receive_network_id) |
|
391 { |
|
392 // Any Network Protocol packet is accepted as a success indication. |
|
393 // This is described in RFC 2284 "PPP Extensible Authentication Protocol (EAP)". |
|
394 |
|
395 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
396 |
|
397 EAP_TRACE_DEBUG( |
|
398 m_am_tools, |
|
399 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
400 (EAPL("eap_core_client_message_if_c::eap_acknowledge(): this = 0x%08x => 0x%08x.\n"), |
|
401 this, |
|
402 dynamic_cast<abs_eap_base_timer_c *>(this))); |
|
403 |
|
404 EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_core_client_message_if_c::eap_acknowledge()"); |
|
405 |
|
406 EAP_ASSERT(m_am_tools->get_global_mutex()->get_is_reserved() == true); |
|
407 |
|
408 eap_status_e status(eap_status_process_general_error); |
|
409 |
|
410 if (receive_network_id == 0) |
|
411 { |
|
412 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
413 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
414 } |
|
415 |
|
416 { |
|
417 // Creates message data composed of Attribute-Value Pairs. |
|
418 eap_process_tlv_message_data_c message(m_am_tools); |
|
419 |
|
420 if (message.get_is_valid() == false) |
|
421 { |
|
422 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
423 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
424 } |
|
425 |
|
426 status = message.add_parameter_data(eap_tlv_message_type_function_eap_acknowledge); |
|
427 if (status != eap_status_ok) |
|
428 { |
|
429 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
430 return EAP_STATUS_RETURN(m_am_tools, status); |
|
431 } |
|
432 |
|
433 status = message.add_parameter_data(receive_network_id); |
|
434 if (status != eap_status_ok) |
|
435 { |
|
436 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
437 return EAP_STATUS_RETURN(m_am_tools, status); |
|
438 } |
|
439 |
|
440 status = process_message(&message); |
|
441 if (status != eap_status_ok) |
|
442 { |
|
443 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
444 return EAP_STATUS_RETURN(m_am_tools, status); |
|
445 } |
|
446 } |
|
447 |
|
448 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
449 return EAP_STATUS_RETURN(m_am_tools, status); |
|
450 } |
|
451 |
|
452 //-------------------------------------------------- |
|
453 |
|
454 #if defined(USE_EAP_CORE_SERVER) |
|
455 |
|
456 // |
|
457 EAP_FUNC_EXPORT eap_status_e eap_core_client_message_if_c::send_eap_identity_request( |
|
458 const eap_am_network_id_c * const receive_network_id) |
|
459 { |
|
460 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
461 |
|
462 EAP_ASSERT(m_am_tools->get_global_mutex()->get_is_reserved() == true); |
|
463 |
|
464 eap_status_e status(eap_status_process_general_error); |
|
465 |
|
466 EAP_TRACE_DEBUG( |
|
467 m_am_tools, |
|
468 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
469 (EAPL("eap_core_client_message_if_c::send_eap_identity_request(): this = 0x%08x => 0x%08x.\n"), |
|
470 this, |
|
471 dynamic_cast<abs_eap_base_timer_c *>(this))); |
|
472 |
|
473 EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_core_client_message_if_c::send_eap_identity_request()"); |
|
474 |
|
475 { |
|
476 // Creates message data composed of Attribute-Value Pairs. |
|
477 eap_process_tlv_message_data_c message(m_am_tools); |
|
478 |
|
479 if (message.get_is_valid() == false) |
|
480 { |
|
481 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
482 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
483 } |
|
484 |
|
485 status = message.add_parameter_data(eap_tlv_message_type_function_send_eap_identity_request); |
|
486 if (status != eap_status_ok) |
|
487 { |
|
488 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
489 return EAP_STATUS_RETURN(m_am_tools, status); |
|
490 } |
|
491 |
|
492 status = message.add_parameter_data(receive_network_id); |
|
493 if (status != eap_status_ok) |
|
494 { |
|
495 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
496 return EAP_STATUS_RETURN(m_am_tools, status); |
|
497 } |
|
498 |
|
499 status = process_message(&message); |
|
500 if (status != eap_status_ok) |
|
501 { |
|
502 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
503 return EAP_STATUS_RETURN(m_am_tools, status); |
|
504 } |
|
505 } |
|
506 |
|
507 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
508 return EAP_STATUS_RETURN(m_am_tools, status); |
|
509 } |
|
510 |
|
511 #endif //#if defined(USE_EAP_CORE_SERVER) |
|
512 |
|
513 //-------------------------------------------------- |
|
514 |
|
515 EAP_FUNC_EXPORT eap_status_e eap_core_client_message_if_c::set_eap_database_reference_values( |
|
516 const eap_variable_data_c * const reference) |
|
517 { |
|
518 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
519 |
|
520 EAP_ASSERT(m_am_tools->get_global_mutex()->get_is_reserved() == true); |
|
521 |
|
522 eap_status_e status(eap_status_process_general_error); |
|
523 |
|
524 EAP_TRACE_DEBUG( |
|
525 m_am_tools, |
|
526 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
527 (EAPL("eap_core_client_message_if_c::set_eap_database_reference_values(): this = 0x%08x => 0x%08x.\n"), |
|
528 this, |
|
529 dynamic_cast<abs_eap_base_timer_c *>(this))); |
|
530 |
|
531 EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_core_client_message_if_c::set_eap_database_reference_values()"); |
|
532 |
|
533 { |
|
534 // Creates message data composed of Attribute-Value Pairs. |
|
535 eap_process_tlv_message_data_c message(m_am_tools); |
|
536 |
|
537 if (message.get_is_valid() == false) |
|
538 { |
|
539 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
540 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
541 } |
|
542 |
|
543 status = message.add_parameter_data(eap_tlv_message_type_function_set_eap_database_reference_values); |
|
544 if (status != eap_status_ok) |
|
545 { |
|
546 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
547 return EAP_STATUS_RETURN(m_am_tools, status); |
|
548 } |
|
549 |
|
550 status = message.add_parameter_data(reference); |
|
551 if (status != eap_status_ok) |
|
552 { |
|
553 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
554 return EAP_STATUS_RETURN(m_am_tools, status); |
|
555 } |
|
556 |
|
557 status = process_message(&message); |
|
558 if (status != eap_status_ok) |
|
559 { |
|
560 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
561 return EAP_STATUS_RETURN(m_am_tools, status); |
|
562 } |
|
563 } |
|
564 |
|
565 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
566 return EAP_STATUS_RETURN(m_am_tools, status); |
|
567 } |
|
568 |
|
569 //-------------------------------------------------- |
|
570 |
|
571 // |
|
572 EAP_FUNC_EXPORT eap_status_e eap_core_client_message_if_c::timer_expired( |
|
573 const u32_t id, void *data) |
|
574 { |
|
575 EAP_UNREFERENCED_PARAMETER(id); |
|
576 EAP_UNREFERENCED_PARAMETER(data); |
|
577 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
578 |
|
579 EAP_TRACE_DEBUG( |
|
580 m_am_tools, |
|
581 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
582 (EAPL("TIMER: [0x%08x]->eap_core_client_message_if_c::") |
|
583 EAPL("timer_expired(id 0x%02x, data 0x%08x), %s.\n"), |
|
584 this, |
|
585 id, |
|
586 data, |
|
587 (m_is_client == true) ? "client": "server")); |
|
588 |
|
589 |
|
590 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
591 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
592 } |
|
593 |
|
594 //-------------------------------------------------- |
|
595 |
|
596 // |
|
597 EAP_FUNC_EXPORT eap_status_e eap_core_client_message_if_c::timer_delete_data( |
|
598 const u32_t id, void *data) |
|
599 { |
|
600 EAP_UNREFERENCED_PARAMETER(id); |
|
601 EAP_UNREFERENCED_PARAMETER(data); |
|
602 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
603 |
|
604 EAP_TRACE_DEBUG( |
|
605 m_am_tools, |
|
606 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
607 (EAPL("TIMER: [0x%08x]->eap_core_client_message_if_c::") |
|
608 EAPL("timer_delete_data(id 0x%02x, data 0x%08x).\n"), |
|
609 this, id, data)); |
|
610 |
|
611 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
612 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
613 } |
|
614 |
|
615 //-------------------------------------------------- |
|
616 |
|
617 EAP_FUNC_EXPORT eap_status_e eap_core_client_message_if_c::cancel_all_eap_sessions() |
|
618 { |
|
619 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
620 |
|
621 EAP_TRACE_DEBUG( |
|
622 m_am_tools, |
|
623 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
624 (EAPL("eap_core_client_message_if_c::cancel_all_eap_sessions(): this = 0x%08x => 0x%08x.\n"), |
|
625 this, |
|
626 dynamic_cast<abs_eap_base_timer_c *>(this))); |
|
627 |
|
628 eap_status_e status = reset(); |
|
629 |
|
630 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
631 return EAP_STATUS_RETURN(m_am_tools, status); |
|
632 } |
|
633 |
|
634 //-------------------------------------------------- |
|
635 |
|
636 EAP_FUNC_EXPORT eap_status_e eap_core_client_message_if_c::create_eap_session( |
|
637 const eap_am_network_id_c * const receive_network_id) |
|
638 { |
|
639 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
640 |
|
641 EAP_TRACE_DEBUG( |
|
642 m_am_tools, |
|
643 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
644 (EAPL("eap_core_client_message_if_c::create_eap_session(): this = 0x%08x => 0x%08x.\n"), |
|
645 this, |
|
646 dynamic_cast<abs_eap_base_timer_c *>(this))); |
|
647 |
|
648 EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_core_client_message_if_c::create_eap_session()"); |
|
649 |
|
650 eap_status_e status(eap_status_process_general_error); |
|
651 |
|
652 { |
|
653 // Creates message data composed of Attribute-Value Pairs. |
|
654 eap_process_tlv_message_data_c message(m_am_tools); |
|
655 |
|
656 if (message.get_is_valid() == false) |
|
657 { |
|
658 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
659 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
660 } |
|
661 |
|
662 status = message.add_parameter_data(eap_tlv_message_type_function_create_eap_session); |
|
663 if (status != eap_status_ok) |
|
664 { |
|
665 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
666 return EAP_STATUS_RETURN(m_am_tools, status); |
|
667 } |
|
668 |
|
669 status = message.add_parameter_data(receive_network_id); |
|
670 if (status != eap_status_ok) |
|
671 { |
|
672 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
673 return EAP_STATUS_RETURN(m_am_tools, status); |
|
674 } |
|
675 |
|
676 status = process_message(&message); |
|
677 if (status != eap_status_ok) |
|
678 { |
|
679 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
680 return EAP_STATUS_RETURN(m_am_tools, status); |
|
681 } |
|
682 } |
|
683 |
|
684 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
685 return EAP_STATUS_RETURN(m_am_tools, status); |
|
686 } |
|
687 |
|
688 //-------------------------------------------------- |
|
689 |
|
690 EAP_FUNC_EXPORT eap_status_e eap_core_client_message_if_c::remove_eap_session( |
|
691 const bool complete_to_lower_layer, |
|
692 const eap_am_network_id_c * const receive_network_id) |
|
693 { |
|
694 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
695 |
|
696 EAP_TRACE_DEBUG( |
|
697 m_am_tools, |
|
698 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
699 (EAPL("eap_core_client_message_if_c::remove_eap_session(): this = 0x%08x => 0x%08x.\n"), |
|
700 this, |
|
701 dynamic_cast<abs_eap_base_timer_c *>(this))); |
|
702 |
|
703 EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_core_client_message_if_c::remove_eap_session()"); |
|
704 |
|
705 eap_status_e status(eap_status_process_general_error); |
|
706 |
|
707 { |
|
708 // Creates message data composed of Attribute-Value Pairs. |
|
709 eap_process_tlv_message_data_c message(m_am_tools); |
|
710 |
|
711 if (message.get_is_valid() == false) |
|
712 { |
|
713 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
714 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
715 } |
|
716 |
|
717 status = message.add_parameter_data(eap_tlv_message_type_function_remove_eap_session); |
|
718 if (status != eap_status_ok) |
|
719 { |
|
720 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
721 return EAP_STATUS_RETURN(m_am_tools, status); |
|
722 } |
|
723 |
|
724 status = message.add_parameter_data(complete_to_lower_layer); |
|
725 if (status != eap_status_ok) |
|
726 { |
|
727 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
728 return EAP_STATUS_RETURN(m_am_tools, status); |
|
729 } |
|
730 |
|
731 status = message.add_parameter_data(receive_network_id); |
|
732 if (status != eap_status_ok) |
|
733 { |
|
734 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
735 return EAP_STATUS_RETURN(m_am_tools, status); |
|
736 } |
|
737 |
|
738 status = process_message(&message); |
|
739 if (status != eap_status_ok) |
|
740 { |
|
741 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
742 return EAP_STATUS_RETURN(m_am_tools, status); |
|
743 } |
|
744 } |
|
745 |
|
746 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
747 return EAP_STATUS_RETURN(m_am_tools, status); |
|
748 } |
|
749 |
|
750 //-------------------------------------------------- |
|
751 |
|
752 EAP_FUNC_EXPORT eap_status_e eap_core_client_message_if_c::get_802_11_authentication_mode( |
|
753 const eap_am_network_id_c * const receive_network_id, |
|
754 const eapol_key_authentication_type_e authentication_type, |
|
755 const eap_variable_data_c * const SSID, |
|
756 const eap_variable_data_c * const preshared_key) |
|
757 { |
|
758 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
759 |
|
760 EAP_TRACE_DEBUG( |
|
761 m_am_tools, |
|
762 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
763 (EAPL("eap_core_client_message_if_c::get_802_11_authentication_mode(): this = 0x%08x => 0x%08x.\n"), |
|
764 this, |
|
765 dynamic_cast<abs_eap_base_timer_c *>(this))); |
|
766 |
|
767 EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_core_client_message_if_c::get_802_11_authentication_mode()"); |
|
768 |
|
769 eap_status_e status(eap_status_process_general_error); |
|
770 |
|
771 { |
|
772 // Creates message data composed of Attribute-Value Pairs. |
|
773 eap_process_tlv_message_data_c message(m_am_tools); |
|
774 |
|
775 if (message.get_is_valid() == false) |
|
776 { |
|
777 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
778 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
779 } |
|
780 |
|
781 status = message.add_parameter_data(eap_tlv_message_type_function_get_802_11_authentication_mode); |
|
782 if (status != eap_status_ok) |
|
783 { |
|
784 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
785 return EAP_STATUS_RETURN(m_am_tools, status); |
|
786 } |
|
787 |
|
788 status = message.add_parameter_data(receive_network_id); |
|
789 if (status != eap_status_ok) |
|
790 { |
|
791 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
792 return EAP_STATUS_RETURN(m_am_tools, status); |
|
793 } |
|
794 |
|
795 status = message.add_parameter_data(authentication_type); |
|
796 if (status != eap_status_ok) |
|
797 { |
|
798 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
799 return EAP_STATUS_RETURN(m_am_tools, status); |
|
800 } |
|
801 |
|
802 status = message.add_parameter_data(SSID); |
|
803 if (status != eap_status_ok) |
|
804 { |
|
805 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
806 return EAP_STATUS_RETURN(m_am_tools, status); |
|
807 } |
|
808 |
|
809 status = message.add_parameter_data(preshared_key); |
|
810 if (status != eap_status_ok) |
|
811 { |
|
812 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
813 return EAP_STATUS_RETURN(m_am_tools, status); |
|
814 } |
|
815 |
|
816 status = process_message(&message); |
|
817 if (status != eap_status_ok) |
|
818 { |
|
819 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
820 return EAP_STATUS_RETURN(m_am_tools, status); |
|
821 } |
|
822 } |
|
823 |
|
824 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
825 return EAP_STATUS_RETURN(m_am_tools, status); |
|
826 } |
|
827 |
|
828 //-------------------------------------------------- |
|
829 |
|
830 eap_status_e eap_core_client_message_if_c::packet_send( |
|
831 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters) |
|
832 { |
|
833 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
834 |
|
835 EAP_TRACE_DEBUG( |
|
836 m_am_tools, |
|
837 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
838 (EAPL("eap_core_client_message_if_c::packet_send(): this = 0x%08x => 0x%08x.\n"), |
|
839 this, |
|
840 dynamic_cast<abs_eap_base_timer_c *>(this))); |
|
841 |
|
842 EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_core_client_message_if_c::packet_send()"); |
|
843 |
|
844 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
845 |
|
846 u32_t parameter_index(eap_message_payload_index_first_parameter); |
|
847 |
|
848 eap_process_tlv_message_data_c message_data(m_am_tools); |
|
849 |
|
850 if (message_data.get_is_valid() == false) |
|
851 { |
|
852 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
853 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
854 } |
|
855 |
|
856 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
857 |
|
858 eap_am_network_id_c send_network_id(m_am_tools); |
|
859 |
|
860 eap_status_e status = message_data.read_parameter_data(parameters, parameter_index, &send_network_id); |
|
861 if (status != eap_status_ok) |
|
862 { |
|
863 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
864 return EAP_STATUS_RETURN(m_am_tools, status); |
|
865 } |
|
866 |
|
867 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
868 |
|
869 ++parameter_index; |
|
870 |
|
871 eap_buf_chain_wr_c packet_buffer(eap_write_buffer, m_am_tools); |
|
872 |
|
873 if (packet_buffer.get_is_valid() == false) |
|
874 { |
|
875 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
876 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
877 } |
|
878 |
|
879 { |
|
880 eap_variable_data_c packet_data(m_am_tools); |
|
881 |
|
882 if (packet_data.get_is_valid() == false) |
|
883 { |
|
884 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
885 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
886 } |
|
887 |
|
888 status = message_data.read_parameter_data(parameters, parameter_index, &packet_data); |
|
889 if (status != eap_status_ok) |
|
890 { |
|
891 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
892 return EAP_STATUS_RETURN(m_am_tools, status); |
|
893 } |
|
894 |
|
895 status = packet_buffer.add_data_to_offset(m_eap_header_offset, &packet_data); |
|
896 if (status != eap_status_ok) |
|
897 { |
|
898 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
899 return EAP_STATUS_RETURN(m_am_tools, status); |
|
900 } |
|
901 } |
|
902 |
|
903 status = m_partner->packet_send( |
|
904 &send_network_id, |
|
905 &packet_buffer, |
|
906 m_eap_header_offset, |
|
907 packet_buffer.get_data_length()-m_eap_header_offset, |
|
908 packet_buffer.get_data_length()); |
|
909 |
|
910 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
911 return EAP_STATUS_RETURN(m_am_tools, status); |
|
912 } |
|
913 |
|
914 //-------------------------------------------------- |
|
915 |
|
916 eap_status_e eap_core_client_message_if_c::state_notification( |
|
917 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters) |
|
918 { |
|
919 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
920 |
|
921 EAP_TRACE_DEBUG( |
|
922 m_am_tools, |
|
923 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
924 (EAPL("eap_core_client_message_if_c::state_notification(): this = 0x%08x => 0x%08x.\n"), |
|
925 this, |
|
926 dynamic_cast<abs_eap_base_timer_c *>(this))); |
|
927 |
|
928 EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_core_client_message_if_c::state_notification()"); |
|
929 |
|
930 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
931 |
|
932 u32_t parameter_index(eap_message_payload_index_first_parameter); |
|
933 |
|
934 eap_process_tlv_message_data_c message_data(m_am_tools); |
|
935 |
|
936 if (message_data.get_is_valid() == false) |
|
937 { |
|
938 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
939 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
940 } |
|
941 |
|
942 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
943 |
|
944 eap_state_notification_c * state = 0; |
|
945 |
|
946 eap_status_e status = message_data.read_parameter_data(parameters, parameter_index, &state); |
|
947 if (status != eap_status_ok) |
|
948 { |
|
949 delete state; |
|
950 state = 0; |
|
951 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
952 return EAP_STATUS_RETURN(m_am_tools, status); |
|
953 } |
|
954 |
|
955 m_partner->state_notification( |
|
956 state); |
|
957 |
|
958 delete state; |
|
959 state = 0; |
|
960 |
|
961 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
962 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
963 } |
|
964 |
|
965 //-------------------------------------------------- |
|
966 |
|
967 eap_status_e eap_core_client_message_if_c::packet_data_crypto_keys( |
|
968 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters) |
|
969 { |
|
970 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
971 |
|
972 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
973 |
|
974 u32_t parameter_index(eap_message_payload_index_first_parameter); |
|
975 |
|
976 eap_process_tlv_message_data_c message_data(m_am_tools); |
|
977 |
|
978 if (message_data.get_is_valid() == false) |
|
979 { |
|
980 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
981 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
982 } |
|
983 |
|
984 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
985 |
|
986 eap_am_network_id_c send_network_id(m_am_tools); |
|
987 |
|
988 eap_status_e status = message_data.read_parameter_data(parameters, parameter_index, &send_network_id); |
|
989 if (status != eap_status_ok) |
|
990 { |
|
991 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
992 return EAP_STATUS_RETURN(m_am_tools, status); |
|
993 } |
|
994 |
|
995 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
996 |
|
997 ++parameter_index; |
|
998 |
|
999 eap_type_value_e eap_type(eap_type_none); |
|
1000 |
|
1001 status = message_data.read_parameter_data(parameters, parameter_index, &eap_type); |
|
1002 if (status != eap_status_ok) |
|
1003 { |
|
1004 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1005 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1006 } |
|
1007 |
|
1008 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
1009 |
|
1010 ++parameter_index; |
|
1011 |
|
1012 eap_master_session_key_c master_session_key(m_am_tools, eap_type); |
|
1013 |
|
1014 status = message_data.read_parameter_data(parameters, parameter_index, &master_session_key); |
|
1015 if (status != eap_status_ok) |
|
1016 { |
|
1017 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1018 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1019 } |
|
1020 |
|
1021 master_session_key.set_eap_type(eap_type); |
|
1022 |
|
1023 |
|
1024 status = m_partner->packet_data_crypto_keys( |
|
1025 &send_network_id, |
|
1026 &master_session_key); |
|
1027 |
|
1028 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1029 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1030 } |
|
1031 |
|
1032 //-------------------------------------------------- |
|
1033 |
|
1034 eap_status_e eap_core_client_message_if_c::restart_authentication( |
|
1035 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters) |
|
1036 { |
|
1037 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1038 |
|
1039 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
1040 |
|
1041 u32_t parameter_index(eap_message_payload_index_first_parameter); |
|
1042 |
|
1043 eap_process_tlv_message_data_c message_data(m_am_tools); |
|
1044 |
|
1045 if (message_data.get_is_valid() == false) |
|
1046 { |
|
1047 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1048 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
1049 } |
|
1050 |
|
1051 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
1052 |
|
1053 eap_am_network_id_c send_network_id(m_am_tools); |
|
1054 |
|
1055 eap_status_e status = message_data.read_parameter_data(parameters, parameter_index, &send_network_id); |
|
1056 if (status != eap_status_ok) |
|
1057 { |
|
1058 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1059 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1060 } |
|
1061 |
|
1062 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
1063 |
|
1064 ++parameter_index; |
|
1065 |
|
1066 bool is_client_when_true(false); |
|
1067 |
|
1068 status = message_data.read_parameter_data(parameters, parameter_index, &is_client_when_true); |
|
1069 if (status != eap_status_ok) |
|
1070 { |
|
1071 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1072 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1073 } |
|
1074 |
|
1075 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
1076 |
|
1077 ++parameter_index; |
|
1078 |
|
1079 bool force_clean_restart(false); |
|
1080 |
|
1081 status = message_data.read_parameter_data(parameters, parameter_index, &force_clean_restart); |
|
1082 if (status != eap_status_ok) |
|
1083 { |
|
1084 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1085 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1086 } |
|
1087 |
|
1088 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
1089 |
|
1090 ++parameter_index; |
|
1091 |
|
1092 bool from_timer(false); |
|
1093 |
|
1094 status = message_data.read_parameter_data(parameters, parameter_index, &from_timer); |
|
1095 if (status != eap_status_ok) |
|
1096 { |
|
1097 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1098 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1099 } |
|
1100 |
|
1101 |
|
1102 status = m_partner->restart_authentication( |
|
1103 &send_network_id, |
|
1104 is_client_when_true, |
|
1105 force_clean_restart, |
|
1106 from_timer); |
|
1107 |
|
1108 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1109 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1110 } |
|
1111 |
|
1112 //-------------------------------------------------- |
|
1113 |
|
1114 #if defined(USE_EAP_SIMPLE_CONFIG) |
|
1115 |
|
1116 eap_status_e eap_core_client_message_if_c::new_protected_setup_credentials( |
|
1117 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters) |
|
1118 { |
|
1119 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1120 |
|
1121 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
1122 |
|
1123 eap_status_e status(eap_status_process_general_error); |
|
1124 |
|
1125 #if defined(USE_EAP_SIMPLE_CONFIG) |
|
1126 |
|
1127 u32_t parameter_index(eap_message_payload_index_first_parameter); |
|
1128 |
|
1129 eap_process_tlv_message_data_c message_data(m_am_tools); |
|
1130 |
|
1131 if (message_data.get_is_valid() == false) |
|
1132 { |
|
1133 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1134 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
1135 } |
|
1136 |
|
1137 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
1138 |
|
1139 eap_array_c<simple_config_credential_c> credential_array(m_am_tools); |
|
1140 |
|
1141 status = message_data.read_parameter_data(parameters, parameter_index, &credential_array); |
|
1142 if (status != eap_status_ok) |
|
1143 { |
|
1144 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1145 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1146 } |
|
1147 |
|
1148 status = m_partner->save_simple_config_session( |
|
1149 simple_config_state_simple_config_success, |
|
1150 &credential_array, |
|
1151 0, |
|
1152 simple_config_Device_Password_ID_Default_PIN, |
|
1153 0); |
|
1154 |
|
1155 #endif //#if defined(USE_EAP_SIMPLE_CONFIG) |
|
1156 |
|
1157 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1158 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1159 } |
|
1160 |
|
1161 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
|
1162 |
|
1163 //-------------------------------------------------- |
|
1164 |
|
1165 eap_status_e eap_core_client_message_if_c::complete_get_802_11_authentication_mode( |
|
1166 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters) |
|
1167 { |
|
1168 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1169 |
|
1170 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
1171 |
|
1172 u32_t parameter_index(eap_message_payload_index_first_parameter); |
|
1173 |
|
1174 eap_process_tlv_message_data_c message_data(m_am_tools); |
|
1175 |
|
1176 if (message_data.get_is_valid() == false) |
|
1177 { |
|
1178 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1179 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
1180 } |
|
1181 |
|
1182 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
1183 |
|
1184 eap_status_e completion_status(eap_status_process_general_error); |
|
1185 |
|
1186 eap_status_e status = message_data.read_parameter_data(parameters, parameter_index, eap_tlv_message_type_eap_status, &completion_status); |
|
1187 if (status != eap_status_ok) |
|
1188 { |
|
1189 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1190 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1191 } |
|
1192 |
|
1193 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
1194 |
|
1195 ++parameter_index; |
|
1196 |
|
1197 eap_am_network_id_c receive_network_id(m_am_tools); |
|
1198 |
|
1199 status = message_data.read_parameter_data(parameters, parameter_index, &receive_network_id); |
|
1200 if (status != eap_status_ok) |
|
1201 { |
|
1202 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1203 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1204 } |
|
1205 |
|
1206 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
1207 |
|
1208 ++parameter_index; |
|
1209 |
|
1210 eapol_key_802_11_authentication_mode_e mode(eapol_key_802_11_authentication_mode_none); |
|
1211 |
|
1212 status = message_data.read_parameter_data(parameters, parameter_index, &mode); |
|
1213 if (status != eap_status_ok) |
|
1214 { |
|
1215 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1216 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1217 } |
|
1218 |
|
1219 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
1220 |
|
1221 status = m_partner->complete_get_802_11_authentication_mode( |
|
1222 completion_status, |
|
1223 &receive_network_id, |
|
1224 mode); |
|
1225 |
|
1226 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1227 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1228 } |
|
1229 |
|
1230 //-------------------------------------------------- |
|
1231 |
|
1232 eap_status_e eap_core_client_message_if_c::complete_remove_eap_session( |
|
1233 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters) |
|
1234 { |
|
1235 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1236 |
|
1237 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
1238 |
|
1239 u32_t parameter_index(eap_message_payload_index_first_parameter); |
|
1240 |
|
1241 eap_process_tlv_message_data_c message_data(m_am_tools); |
|
1242 |
|
1243 if (message_data.get_is_valid() == false) |
|
1244 { |
|
1245 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1246 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
1247 } |
|
1248 |
|
1249 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
1250 |
|
1251 bool complete_to_lower_layer(false); |
|
1252 |
|
1253 eap_status_e status = message_data.read_parameter_data(parameters, parameter_index, &complete_to_lower_layer); |
|
1254 if (status != eap_status_ok) |
|
1255 { |
|
1256 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1257 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1258 } |
|
1259 |
|
1260 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
1261 |
|
1262 ++parameter_index; |
|
1263 |
|
1264 eap_am_network_id_c receive_network_id(m_am_tools); |
|
1265 |
|
1266 status = message_data.read_parameter_data(parameters, parameter_index, &receive_network_id); |
|
1267 if (status != eap_status_ok) |
|
1268 { |
|
1269 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1270 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1271 } |
|
1272 |
|
1273 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
1274 |
|
1275 status = m_partner->complete_remove_eap_session( |
|
1276 complete_to_lower_layer, |
|
1277 &receive_network_id); |
|
1278 |
|
1279 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1280 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1281 } |
|
1282 |
|
1283 //-------------------------------------------------- |
|
1284 |
|
1285 eap_status_e eap_core_client_message_if_c::process_error_message( |
|
1286 const eap_status_e error_code, |
|
1287 const eap_tlv_message_type_function_e function) |
|
1288 { |
|
1289 eap_status_e status(eap_status_ok); |
|
1290 |
|
1291 { |
|
1292 // Creates message data composed of Attribute-Value Pairs. |
|
1293 eap_process_tlv_message_data_c message(m_am_tools); |
|
1294 |
|
1295 if (message.get_is_valid() == false) |
|
1296 { |
|
1297 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1298 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
1299 } |
|
1300 |
|
1301 status = message.add_parameter_data( |
|
1302 eap_tlv_message_type_error, |
|
1303 static_cast<u32_t>(error_code)); |
|
1304 if (status != eap_status_ok) |
|
1305 { |
|
1306 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1307 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1308 } |
|
1309 |
|
1310 status = message.add_parameter_data(function); |
|
1311 if (status != eap_status_ok) |
|
1312 { |
|
1313 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1314 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1315 } |
|
1316 |
|
1317 status = process_message(&message); |
|
1318 if (status != eap_status_ok) |
|
1319 { |
|
1320 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1321 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1322 } |
|
1323 } |
|
1324 |
|
1325 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1326 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
1327 } |
|
1328 |
|
1329 //-------------------------------------------------- |
|
1330 |
|
1331 eap_status_e eap_core_client_message_if_c::process_message_type_error( |
|
1332 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters) |
|
1333 { |
|
1334 eap_status_e status(eap_status_ok); |
|
1335 |
|
1336 eap_process_tlv_message_data_c message_data(m_am_tools); |
|
1337 |
|
1338 if (message_data.get_is_valid() == false) |
|
1339 { |
|
1340 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1341 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
1342 } |
|
1343 |
|
1344 // Error payload is the first in this case. |
|
1345 status = message_data.read_parameter_data(parameters, eap_message_payload_index_function, eap_tlv_message_type_error, &m_error_code); |
|
1346 if (status != eap_status_ok) |
|
1347 { |
|
1348 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1349 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1350 } |
|
1351 |
|
1352 // Fuction payload is the second in this case. |
|
1353 status = message_data.read_parameter_data(parameters, eap_message_payload_index_first_parameter, &m_error_function); |
|
1354 if (status != eap_status_ok) |
|
1355 { |
|
1356 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1357 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1358 } |
|
1359 |
|
1360 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1361 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1362 } |
|
1363 |
|
1364 //-------------------------------------------------- |
|
1365 |
|
1366 EAP_FUNC_EXPORT eap_status_e eap_core_client_message_if_c::send_data(const void * const data, const u32_t length) |
|
1367 { |
|
1368 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1369 |
|
1370 EAP_TRACE_DEBUG( |
|
1371 m_am_tools, |
|
1372 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1373 (EAPL("eap_core_client_message_if_c::send_data(): this = 0x%08x => 0x%08x.\n"), |
|
1374 this, |
|
1375 dynamic_cast<abs_eap_base_timer_c *>(this))); |
|
1376 |
|
1377 EAP_TRACE_RETURN_STRING_FLAGS(m_am_tools, EAP_TRACE_FLAGS_MESSAGE_DATA, "returns: eap_core_client_message_if_c::send_data()"); |
|
1378 |
|
1379 eap_status_e status(eap_status_process_general_error); |
|
1380 |
|
1381 // Parses message data composed of Attribute-Value Pairs. |
|
1382 eap_process_tlv_message_data_c message(m_am_tools); |
|
1383 |
|
1384 if (message.get_is_valid() == false) |
|
1385 { |
|
1386 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1387 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
1388 } |
|
1389 |
|
1390 status = message.set_message_data(length, data); |
|
1391 if (status != eap_status_ok) |
|
1392 { |
|
1393 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1394 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1395 } |
|
1396 |
|
1397 EAP_TRACE_DATA_DEBUG( |
|
1398 m_am_tools, |
|
1399 EAP_TRACE_FLAGS_NEVER, |
|
1400 (EAPL("eap_core_client_message_if_c::send_data()"), |
|
1401 message.get_message_data(), |
|
1402 message.get_message_data_length())); |
|
1403 |
|
1404 eap_array_c<eap_tlv_header_c> parameters(m_am_tools); |
|
1405 |
|
1406 status = message.parse_message_data(¶meters); |
|
1407 if (status != eap_status_ok) |
|
1408 { |
|
1409 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1410 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1411 } |
|
1412 |
|
1413 if (parameters.get_object_count() == 0) |
|
1414 { |
|
1415 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1416 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
1417 } |
|
1418 |
|
1419 const eap_tlv_header_c * const function_header = parameters.get_object(eap_message_payload_index_function); |
|
1420 if (function_header == 0 |
|
1421 || (function_header->get_type() != eap_tlv_message_type_error |
|
1422 && function_header->get_type() != eap_tlv_message_type_function)) |
|
1423 { |
|
1424 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1425 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
1426 } |
|
1427 |
|
1428 if (function_header->get_type() == eap_tlv_message_type_error) |
|
1429 { |
|
1430 status = process_message_type_error(¶meters); |
|
1431 } |
|
1432 else // function_header->get_type() == eap_tlv_message_type_function |
|
1433 { |
|
1434 eap_tlv_message_type_function_e function(eap_tlv_message_type_function_none); |
|
1435 |
|
1436 status = message.get_parameter_data(function_header, &function); |
|
1437 if (status != eap_status_ok) |
|
1438 { |
|
1439 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1440 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1441 } |
|
1442 |
|
1443 switch(function) |
|
1444 { |
|
1445 case eap_tlv_message_type_function_packet_send: |
|
1446 status = packet_send(¶meters); |
|
1447 break; |
|
1448 case eap_tlv_message_type_function_state_notification: |
|
1449 status = state_notification(¶meters); |
|
1450 break; |
|
1451 case eap_tlv_message_type_function_packet_data_crypto_keys: |
|
1452 status = packet_data_crypto_keys(¶meters); |
|
1453 break; |
|
1454 case eap_tlv_message_type_function_restart_authentication: |
|
1455 status = restart_authentication(¶meters); |
|
1456 break; |
|
1457 #if defined(USE_EAP_SIMPLE_CONFIG) |
|
1458 case eap_tlv_message_type_function_new_protected_setup_credentials: |
|
1459 status = new_protected_setup_credentials(¶meters); |
|
1460 break; |
|
1461 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
|
1462 case eap_tlv_message_type_function_complete_get_802_11_authentication_mode: |
|
1463 status = complete_get_802_11_authentication_mode(¶meters); |
|
1464 break; |
|
1465 case eap_tlv_message_type_function_complete_remove_eap_session: |
|
1466 status = complete_remove_eap_session(¶meters); |
|
1467 break; |
|
1468 default: |
|
1469 EAP_TRACE_ERROR( |
|
1470 m_am_tools, |
|
1471 TRACE_FLAGS_DEFAULT, |
|
1472 (EAPL("ERROR: send_data(): unknown function %d.\n"), |
|
1473 function)); |
|
1474 |
|
1475 EAP_ASSERT_ANYWAY_TOOLS(m_am_tools); |
|
1476 |
|
1477 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1478 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
1479 }; |
|
1480 |
|
1481 if (status != eap_status_ok) |
|
1482 { |
|
1483 (void) process_error_message( |
|
1484 status, |
|
1485 function); |
|
1486 } |
|
1487 } |
|
1488 |
|
1489 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1490 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1491 } |
|
1492 |
|
1493 //-------------------------------------------------- |
|
1494 // End. |