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: 42 % |
|
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 40 |
|
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 #include "eap_am_memory.h" |
|
32 #include "eap_automatic_variable.h" |
|
33 #include "eap_process_tlv_message_data.h" |
|
34 #include "eap_variable_data.h" |
|
35 #include "eap_am_network_id.h" |
|
36 #include "eap_buffer.h" |
|
37 #include "eapol_session_key.h" |
|
38 #include "abs_eap_state_notification.h" |
|
39 #include "eap_state_notification.h" |
|
40 |
|
41 |
|
42 /** @file */ |
|
43 |
|
44 |
|
45 //-------------------------------------------------- |
|
46 |
|
47 EAP_FUNC_EXPORT eap_process_tlv_message_data_c::~eap_process_tlv_message_data_c() |
|
48 { |
|
49 } |
|
50 |
|
51 //-------------------------------------------------- |
|
52 |
|
53 EAP_FUNC_EXPORT eap_process_tlv_message_data_c::eap_process_tlv_message_data_c( |
|
54 abs_eap_am_tools_c * const tools) |
|
55 : eap_tlv_message_data_c(tools) |
|
56 , m_am_tools(tools) |
|
57 , m_is_valid(true) |
|
58 { |
|
59 } |
|
60 |
|
61 //------------------------------------------------------------------- |
|
62 |
|
63 /** |
|
64 * This function should increase reference count. |
|
65 */ |
|
66 EAP_FUNC_EXPORT void eap_process_tlv_message_data_c::object_increase_reference_count() |
|
67 { |
|
68 } |
|
69 |
|
70 //------------------------------------------------------------------- |
|
71 |
|
72 /** |
|
73 * This function should first decrease reference count |
|
74 * and second return the remaining reference count. |
|
75 * Reference count must not be decreased when it is zero. |
|
76 */ |
|
77 EAP_FUNC_EXPORT u32_t eap_process_tlv_message_data_c::object_decrease_reference_count() |
|
78 { |
|
79 return 0; |
|
80 } |
|
81 |
|
82 //-------------------------------------------------- |
|
83 |
|
84 EAP_FUNC_EXPORT bool eap_process_tlv_message_data_c::get_is_valid() |
|
85 { |
|
86 return m_is_valid && eap_tlv_message_data_c::get_is_valid(); |
|
87 } |
|
88 |
|
89 //-------------------------------------------------- |
|
90 |
|
91 EAP_FUNC_EXPORT u32_t eap_process_tlv_message_data_c::get_payload_size( |
|
92 const eap_variable_data_c * const data) const |
|
93 { |
|
94 return |
|
95 (eap_tlv_header_c::get_header_length() // Each attribute have their own header. |
|
96 + data->get_data_length()); |
|
97 } |
|
98 |
|
99 //-------------------------------------------------- |
|
100 |
|
101 EAP_FUNC_EXPORT u32_t eap_process_tlv_message_data_c::get_payload_size( |
|
102 const eap_am_network_id_c * const network_id) const |
|
103 { |
|
104 if (network_id == 0 |
|
105 || network_id->get_is_valid_data() == false) |
|
106 { |
|
107 return 0ul; |
|
108 } |
|
109 |
|
110 return |
|
111 (3ul * eap_tlv_header_c::get_header_length() // Each attribute have their own header. |
|
112 + network_id->get_source_id()->get_data_length() |
|
113 + network_id->get_destination_id()->get_data_length() |
|
114 + sizeof(network_id->get_type())); |
|
115 } |
|
116 |
|
117 //-------------------------------------------------- |
|
118 |
|
119 EAP_FUNC_EXPORT u32_t eap_process_tlv_message_data_c::get_payload_size( |
|
120 const abs_eap_state_notification_c * const state) const |
|
121 { |
|
122 return |
|
123 (7ul * eap_tlv_header_c::get_header_length()) // Each attribute have their own header. |
|
124 + (get_payload_size(state->get_send_network_id()) |
|
125 + sizeof(u32_t) // eap_protocol_layer_e |
|
126 + sizeof(state->get_protocol()) |
|
127 + eap_expanded_type_c::get_eap_expanded_type_size() |
|
128 + sizeof(state->get_current_state()) |
|
129 + sizeof(u32_t) // bool is_client |
|
130 + sizeof(u32_t) // eap_status_e authentication error |
|
131 ); |
|
132 } |
|
133 |
|
134 //-------------------------------------------------- |
|
135 |
|
136 EAP_FUNC_EXPORT u32_t eap_process_tlv_message_data_c::get_payload_size( |
|
137 const eapol_session_key_c * const session_key) const |
|
138 { |
|
139 return |
|
140 ((5ul * eap_tlv_header_c::get_header_length()) // Each attribute have their own header. |
|
141 + session_key->get_key()->get_data_length() |
|
142 + session_key->get_sequence_number()->get_data_length() |
|
143 + sizeof(u32_t) // const eapol_key_type_e m_key_type |
|
144 + sizeof(session_key->get_key_index()) |
|
145 + sizeof(u32_t) // const bool m_key_tx_bit |
|
146 ); |
|
147 } |
|
148 |
|
149 //-------------------------------------------------- |
|
150 |
|
151 EAP_FUNC_EXPORT u32_t eap_process_tlv_message_data_c::get_payload_size( |
|
152 EAP_TEMPLATE_CONST eap_array_c<u16_t> * const ushort_array) const |
|
153 { |
|
154 u32_t size(0ul); |
|
155 |
|
156 for (u32_t ind = 0ul; ind < ushort_array->get_object_count(); ind++) |
|
157 { |
|
158 u16_t * const value = ushort_array->get_object(ind); |
|
159 if (value != 0) |
|
160 { |
|
161 size += eap_tlv_header_c::get_header_length() // TLV-header of u16_t. |
|
162 + sizeof(u16_t); // Size of u16_t |
|
163 } |
|
164 } // for () |
|
165 |
|
166 return (size); |
|
167 } |
|
168 |
|
169 //-------------------------------------------------- |
|
170 |
|
171 EAP_FUNC_EXPORT u32_t eap_process_tlv_message_data_c::get_payload_size( |
|
172 const eap_certificate_entry_c * const cert) const |
|
173 { |
|
174 u32_t size = |
|
175 (10ul * eap_tlv_header_c::get_header_length() // Each attribute have their own header. |
|
176 + sizeof(u32_t) // eap_certificate_type_e m_CertType |
|
177 + sizeof(u32_t) // bool m_SubjectNamePresent |
|
178 + sizeof(u32_t) // bool m_IssuerNamePresent |
|
179 + sizeof(u32_t) // bool m_SerialNumberPresent |
|
180 + sizeof(u32_t) // bool m_SubjectKeyIDPresent |
|
181 + sizeof(u32_t) // bool m_ThumbprintPresent |
|
182 + sizeof(u32_t) // bool m_LabelPresent |
|
183 + sizeof(u32_t) // bool m_PrimaryNamePresent |
|
184 + sizeof(u32_t) // bool m_SecondaryNamePresent |
|
185 + sizeof(u32_t) // bool m_iIsEnabledPresent |
|
186 ); |
|
187 |
|
188 if (cert->m_SubjectNamePresent == true) |
|
189 { |
|
190 size += get_payload_size(&(cert->m_SubjectName)); |
|
191 } |
|
192 |
|
193 if (cert->m_IssuerNamePresent == true) |
|
194 { |
|
195 size += get_payload_size(&(cert->m_IssuerName)); |
|
196 } |
|
197 |
|
198 if (cert->m_SerialNumberPresent == true) |
|
199 { |
|
200 size += get_payload_size(&(cert->m_SerialNumber)); |
|
201 } |
|
202 |
|
203 if (cert->m_SubjectKeyIDPresent == true) |
|
204 { |
|
205 size += get_payload_size(&(cert->m_SubjectKeyID)); |
|
206 } |
|
207 |
|
208 if (cert->m_ThumbprintPresent == true) |
|
209 { |
|
210 size += get_payload_size(&(cert->m_Thumbprint)); |
|
211 } |
|
212 |
|
213 if (cert->m_LabelPresent == true) |
|
214 { |
|
215 size += get_payload_size(&(cert->m_Label)); |
|
216 } |
|
217 |
|
218 if (cert->m_PrimaryNamePresent == true) |
|
219 { |
|
220 size += get_payload_size(&(cert->m_PrimaryName)); |
|
221 } |
|
222 |
|
223 if (cert->m_SecondaryNamePresent == true) |
|
224 { |
|
225 size += get_payload_size(&(cert->m_SecondaryName)); |
|
226 } |
|
227 |
|
228 if (cert->m_iIsEnabledPresent == true) |
|
229 { |
|
230 size += eap_tlv_header_c::get_header_length(); |
|
231 size += sizeof(u32_t); // bool m_iIsEnabled |
|
232 } |
|
233 |
|
234 return size; |
|
235 } |
|
236 |
|
237 //-------------------------------------------------- |
|
238 |
|
239 EAP_FUNC_EXPORT u32_t eap_process_tlv_message_data_c::get_payload_size( |
|
240 const eap_method_settings_c * const internal_settings) const |
|
241 { |
|
242 u32_t size = |
|
243 (4ul * eap_tlv_header_c::get_header_length() // Each attribute have their own header. |
|
244 + sizeof(u32_t) // eap_status_e m_completion_status |
|
245 + eap_expanded_type_c::get_eap_expanded_type_size() // eap_type_value_e m_EAPType |
|
246 + sizeof(u32_t) // u32_t m_IndexType |
|
247 + sizeof(u32_t) // u32_t m_Index |
|
248 ); |
|
249 |
|
250 size += eap_tlv_header_c::get_header_length(); |
|
251 size += sizeof(u32_t); // bool m_UseAutomaticCACertificatePresent |
|
252 if (internal_settings->m_UseAutomaticCACertificatePresent == true) |
|
253 { |
|
254 size += eap_tlv_header_c::get_header_length(); |
|
255 size += sizeof(u32_t); // bool m_UseAutomaticCACertificate |
|
256 } |
|
257 |
|
258 size += eap_tlv_header_c::get_header_length(); |
|
259 size += sizeof(u32_t); // bool m_UseAutomaticUsernamePresent |
|
260 if (internal_settings->m_UseAutomaticUsernamePresent == true) |
|
261 { |
|
262 size += eap_tlv_header_c::get_header_length(); |
|
263 size += sizeof(u32_t); // bool m_UseAutomaticUsername |
|
264 } |
|
265 |
|
266 size += eap_tlv_header_c::get_header_length(); |
|
267 size += sizeof(u32_t); // bool m_UseAutomaticRealmPresent |
|
268 if (internal_settings->m_UseAutomaticRealmPresent == true) |
|
269 { |
|
270 size += eap_tlv_header_c::get_header_length(); |
|
271 size += sizeof(u32_t); // bool m_UseAutomaticRealm |
|
272 } |
|
273 |
|
274 size += eap_tlv_header_c::get_header_length(); |
|
275 size += sizeof(u32_t); // bool m_UsernamePresent |
|
276 if (internal_settings->m_UsernamePresent == true) |
|
277 { |
|
278 size += get_payload_size(&(internal_settings->m_Username_fix)); |
|
279 } |
|
280 |
|
281 size += eap_tlv_header_c::get_header_length(); |
|
282 size += sizeof(u32_t); // bool m_PasswordExistPresent |
|
283 if (internal_settings->m_PasswordExistPresent == true) |
|
284 { |
|
285 size += eap_tlv_header_c::get_header_length(); |
|
286 size += sizeof(u32_t); // bool m_PasswordExist |
|
287 } |
|
288 |
|
289 size += eap_tlv_header_c::get_header_length(); |
|
290 size += sizeof(u32_t); // bool m_PasswordPresent |
|
291 if (internal_settings->m_PasswordPresent == true) |
|
292 { |
|
293 size += get_payload_size(&(internal_settings->m_Password)); |
|
294 } |
|
295 |
|
296 size += eap_tlv_header_c::get_header_length(); |
|
297 size += sizeof(u32_t); // bool m_RealmPresent |
|
298 if (internal_settings->m_RealmPresent == true) |
|
299 { |
|
300 size += get_payload_size(&(internal_settings->m_Realm)); |
|
301 } |
|
302 |
|
303 size += eap_tlv_header_c::get_header_length(); |
|
304 size += sizeof(u32_t); // bool m_UsePseudonymsPresent |
|
305 if (internal_settings->m_UsePseudonymsPresent == true) |
|
306 { |
|
307 size += eap_tlv_header_c::get_header_length(); |
|
308 size += sizeof(u32_t); // bool m_UsePseudonyms |
|
309 } |
|
310 |
|
311 size += eap_tlv_header_c::get_header_length(); |
|
312 size += sizeof(u32_t); // bool m_VerifyServerRealmPresent |
|
313 if (internal_settings->m_VerifyServerRealmPresent == true) |
|
314 { |
|
315 size += eap_tlv_header_c::get_header_length(); |
|
316 size += sizeof(u32_t); // bool m_VerifyServerRealm |
|
317 } |
|
318 |
|
319 size += eap_tlv_header_c::get_header_length(); |
|
320 size += sizeof(u32_t); // bool m_RequireClientAuthenticationPresent |
|
321 if (internal_settings->m_RequireClientAuthenticationPresent == true) |
|
322 { |
|
323 size += eap_tlv_header_c::get_header_length(); |
|
324 size += sizeof(u32_t); // bool m_RequireClientAuthentication |
|
325 } |
|
326 |
|
327 size += eap_tlv_header_c::get_header_length(); |
|
328 size += sizeof(u32_t); // bool m_SessionValidityTimePresent |
|
329 if (internal_settings->m_SessionValidityTimePresent == true) |
|
330 { |
|
331 size += eap_tlv_header_c::get_header_length(); |
|
332 size += sizeof(u32_t); // u32_t m_SessionValidityTime |
|
333 } |
|
334 |
|
335 size += eap_tlv_header_c::get_header_length(); |
|
336 size += sizeof(u32_t); // bool m_CipherSuitesPresent |
|
337 if (internal_settings->m_CipherSuitesPresent == true) |
|
338 { |
|
339 // Array header. |
|
340 size += eap_tlv_header_c::get_header_length(); |
|
341 size += get_payload_size(&(internal_settings->m_CipherSuites)); |
|
342 } |
|
343 |
|
344 size += eap_tlv_header_c::get_header_length(); |
|
345 size += sizeof(u32_t); // bool m_PEAPVersionsPresent |
|
346 if (internal_settings->m_PEAPVersionsPresent == true) |
|
347 { |
|
348 size += (3ul * eap_tlv_header_c::get_header_length()); |
|
349 size += sizeof(u32_t); // bool m_PEAPv0Allowed |
|
350 size += sizeof(u32_t); // bool m_PEAPv1Allowed |
|
351 size += sizeof(u32_t); // bool m_PEAPv2Allowed |
|
352 } |
|
353 |
|
354 size += eap_tlv_header_c::get_header_length(); |
|
355 size += sizeof(u32_t); // bool m_CertificatesPresent |
|
356 if (internal_settings->m_CertificatesPresent == true) |
|
357 { |
|
358 // Array header. |
|
359 size += eap_tlv_header_c::get_header_length(); |
|
360 size += get_payload_size(&(internal_settings->m_Certificates)); |
|
361 } |
|
362 |
|
363 size += eap_tlv_header_c::get_header_length(); |
|
364 size += sizeof(u32_t); // bool m_EnabledEncapsulatedEAPTypesPresent |
|
365 if (internal_settings->m_EnabledEncapsulatedEAPTypesPresent == true) |
|
366 { |
|
367 // Array header. |
|
368 size += eap_tlv_header_c::get_header_length(); |
|
369 size += get_payload_size(&(internal_settings->m_EnabledEncapsulatedEAPTypes)); |
|
370 } |
|
371 |
|
372 size += eap_tlv_header_c::get_header_length(); |
|
373 size += sizeof(u32_t); // bool m_DisabledEncapsulatedEAPTypesPresent |
|
374 if (internal_settings->m_DisabledEncapsulatedEAPTypesPresent == true) |
|
375 { |
|
376 // Array header. |
|
377 size += eap_tlv_header_c::get_header_length(); |
|
378 size += get_payload_size(&(internal_settings->m_DisabledEncapsulatedEAPTypes)); |
|
379 } |
|
380 |
|
381 size += eap_tlv_header_c::get_header_length(); |
|
382 size += sizeof(u32_t); // bool m_AuthProvModeAllowedPresent |
|
383 if (internal_settings->m_AuthProvModeAllowedPresent == true) |
|
384 { |
|
385 size += eap_tlv_header_c::get_header_length(); |
|
386 size += sizeof(u32_t); // bool m_AuthProvModeAllowed |
|
387 } |
|
388 |
|
389 size += eap_tlv_header_c::get_header_length(); |
|
390 size += sizeof(u32_t); // bool m_UnauthProvModeAllowedPresent |
|
391 if (internal_settings->m_UnauthProvModeAllowedPresent == true) |
|
392 { |
|
393 size += eap_tlv_header_c::get_header_length(); |
|
394 size += sizeof(u32_t); // bool m_UnauthProvModeAllowed |
|
395 } |
|
396 |
|
397 size += eap_tlv_header_c::get_header_length(); |
|
398 size += sizeof(u32_t); // bool m_PACGroupReferencePresent |
|
399 if (internal_settings->m_PACGroupReferencePresent == true) |
|
400 { |
|
401 size += get_payload_size(&(internal_settings->m_PACGroupReference)); |
|
402 } |
|
403 |
|
404 size += eap_tlv_header_c::get_header_length(); |
|
405 size += sizeof(u32_t); // bool m_WarnADHPNoPACPresent |
|
406 if (internal_settings->m_WarnADHPNoPACPresent == true) |
|
407 { |
|
408 size += eap_tlv_header_c::get_header_length(); |
|
409 size += sizeof(u32_t); // bool m_WarnADHPNoPAC |
|
410 } |
|
411 |
|
412 size += eap_tlv_header_c::get_header_length(); |
|
413 size += sizeof(u32_t); // bool m_WarnADHPNoMatchingPACPresent |
|
414 if (internal_settings->m_WarnADHPNoMatchingPACPresent == true) |
|
415 { |
|
416 size += eap_tlv_header_c::get_header_length(); |
|
417 size += sizeof(u32_t); // bool m_WarnADHPNoMatchingPAC |
|
418 } |
|
419 |
|
420 size += eap_tlv_header_c::get_header_length(); |
|
421 size += sizeof(u32_t); // bool m_WarnNotDefaultServerPresent |
|
422 if (internal_settings->m_WarnNotDefaultServerPresent == true) |
|
423 { |
|
424 size += eap_tlv_header_c::get_header_length(); |
|
425 size += sizeof(u32_t); // bool m_WarnNotDefaultServer |
|
426 } |
|
427 |
|
428 size += eap_tlv_header_c::get_header_length(); |
|
429 size += sizeof(u32_t); // bool m_SelectedEAPTypesPresent |
|
430 if (internal_settings->m_SelectedEAPTypesPresent == true) |
|
431 { |
|
432 // Array header. |
|
433 size += eap_tlv_header_c::get_header_length(); |
|
434 size += get_payload_size(&(internal_settings->m_active_eap_methods)); |
|
435 |
|
436 // Array header. |
|
437 size += eap_tlv_header_c::get_header_length(); |
|
438 size += get_payload_size(&(internal_settings->m_disabled_eap_methods)); |
|
439 } |
|
440 |
|
441 size += eap_tlv_header_c::get_header_length(); |
|
442 size += sizeof(u32_t); // bool m_TunnelingTypePresent |
|
443 if (internal_settings->m_TunnelingTypePresent == true) |
|
444 { |
|
445 size += eap_tlv_header_c::get_header_length(); |
|
446 size += eap_expanded_type_c::get_eap_expanded_type_size(); // eap_type_value_e m_TunnelingType |
|
447 } |
|
448 |
|
449 size += eap_tlv_header_c::get_header_length(); |
|
450 size += sizeof(u32_t); // bool m_DestinationIndexAndTypePresent |
|
451 if (internal_settings->m_DestinationIndexAndTypePresent == true) |
|
452 { |
|
453 size += (2ul * eap_tlv_header_c::get_header_length()); |
|
454 size += sizeof(u32_t); // u32_t m_DestinationIndexType |
|
455 size += sizeof(u32_t); // u32_t m_DestinationIndex |
|
456 } |
|
457 |
|
458 size += eap_tlv_header_c::get_header_length(); |
|
459 size += sizeof(u32_t); // bool m_MethodInfoPresent |
|
460 if (internal_settings->m_MethodInfoPresent == true) |
|
461 { |
|
462 size += get_payload_size(&(internal_settings->m_KReleaseDate)); |
|
463 size += get_payload_size(&(internal_settings->m_KEapTypeVersion)); |
|
464 size += get_payload_size(&(internal_settings->m_KManufacturer)); |
|
465 } |
|
466 |
|
467 size += eap_tlv_header_c::get_header_length(); |
|
468 size += sizeof(u32_t); // bool m_ButtonIdPresent |
|
469 if (internal_settings->m_ButtonIdPresent == true) |
|
470 { |
|
471 size += eap_tlv_header_c::get_header_length(); |
|
472 size += sizeof(u32_t); // i32_t m_ButtonId |
|
473 } |
|
474 |
|
475 size += eap_tlv_header_c::get_header_length(); |
|
476 size += sizeof(u32_t); // bool m_ShowPassWordPromptPresent |
|
477 if (internal_settings->m_ShowPassWordPromptPresent == true) |
|
478 { |
|
479 size += eap_tlv_header_c::get_header_length(); |
|
480 size += sizeof(u32_t); // bool m_ShowPassWordPrompt)); |
|
481 } |
|
482 |
|
483 size += eap_tlv_header_c::get_header_length(); |
|
484 size += sizeof(u32_t); // bool m_UseIdentityPrivacyPresent |
|
485 if (internal_settings->m_UseIdentityPrivacyPresent == true) |
|
486 { |
|
487 size += eap_tlv_header_c::get_header_length(); |
|
488 size += sizeof(u32_t); // bool m_UseIdentityPrivacy)); |
|
489 } |
|
490 |
|
491 return size; |
|
492 } |
|
493 |
|
494 //-------------------------------------------------- |
|
495 |
|
496 EAP_FUNC_EXPORT u32_t eap_process_tlv_message_data_c::get_payload_size( |
|
497 EAP_TEMPLATE_CONST eap_array_c<eap_certificate_entry_c> * const cert_array) const |
|
498 { |
|
499 u32_t size(0ul); |
|
500 |
|
501 for (u32_t ind = 0ul; ind < cert_array->get_object_count(); ind++) |
|
502 { |
|
503 eap_certificate_entry_c * const value = cert_array->get_object(ind); |
|
504 if (value != 0) |
|
505 { |
|
506 // Structure header. |
|
507 size += eap_tlv_header_c::get_header_length(); |
|
508 |
|
509 size += get_payload_size(value); |
|
510 } |
|
511 } // for () |
|
512 |
|
513 return (size); |
|
514 } |
|
515 |
|
516 //-------------------------------------------------- |
|
517 |
|
518 #if defined(USE_EAP_SIMPLE_CONFIG) |
|
519 |
|
520 EAP_FUNC_EXPORT u32_t eap_process_tlv_message_data_c::get_payload_size( |
|
521 const network_key_and_index_c * const key) const |
|
522 { |
|
523 u32_t size(0ul); |
|
524 |
|
525 if (key != 0) |
|
526 { |
|
527 size += eap_tlv_header_c::get_header_length() |
|
528 + sizeof(key->get_network_key_index()) // Size of Network Key Index |
|
529 + eap_tlv_header_c::get_header_length() |
|
530 + key->get_network_key_const()->get_data_length() // Size of Network Key |
|
531 ; |
|
532 } |
|
533 |
|
534 return (size); |
|
535 } |
|
536 |
|
537 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
|
538 |
|
539 //-------------------------------------------------- |
|
540 |
|
541 #if defined(USE_EAP_SIMPLE_CONFIG) |
|
542 |
|
543 EAP_FUNC_EXPORT u32_t eap_process_tlv_message_data_c::get_payload_size( |
|
544 const eap_array_c<network_key_and_index_c> * const network_keys) const |
|
545 { |
|
546 u32_t size(0ul); |
|
547 |
|
548 for (u32_t ind_network_key = 0ul; ind_network_key < network_keys->get_object_count(); ind_network_key++) |
|
549 { |
|
550 network_key_and_index_c * const key = network_keys->get_object(ind_network_key); |
|
551 if (key != 0) |
|
552 { |
|
553 size += eap_tlv_header_c::get_header_length() // Size of structure header |
|
554 + get_payload_size(key); // Size of Network Key |
|
555 } |
|
556 } // for () |
|
557 |
|
558 return (size); |
|
559 } |
|
560 |
|
561 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
|
562 |
|
563 //-------------------------------------------------- |
|
564 |
|
565 #if defined(USE_EAP_SIMPLE_CONFIG) |
|
566 |
|
567 EAP_FUNC_EXPORT u32_t eap_process_tlv_message_data_c::get_payload_size( |
|
568 const simple_config_credential_c * const credential) const |
|
569 { |
|
570 u32_t size(0ul); |
|
571 |
|
572 if (credential != 0) |
|
573 { |
|
574 size += eap_tlv_header_c::get_header_length() |
|
575 + sizeof(credential->get_network_index()) // Size of Network Index |
|
576 + eap_tlv_header_c::get_header_length() |
|
577 + credential->get_SSID_const()->get_data_length() // Size of SSID |
|
578 + eap_tlv_header_c::get_header_length() |
|
579 + sizeof(u16_t) // Size of Authentiction type |
|
580 + eap_tlv_header_c::get_header_length() |
|
581 + sizeof(u16_t) // Size of Encryption type |
|
582 ; |
|
583 |
|
584 size += eap_tlv_header_c::get_header_length() // Size of header of Array |
|
585 + get_payload_size(credential->get_network_keys_const()); |
|
586 |
|
587 size += eap_tlv_header_c::get_header_length() |
|
588 + credential->get_MAC_address_const()->get_data_length() // Size of MAC Address |
|
589 ; |
|
590 } |
|
591 |
|
592 return (size); |
|
593 } |
|
594 |
|
595 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
|
596 |
|
597 //-------------------------------------------------- |
|
598 |
|
599 #if defined(USE_EAP_SIMPLE_CONFIG) |
|
600 |
|
601 EAP_FUNC_EXPORT u32_t eap_process_tlv_message_data_c::get_payload_size( |
|
602 EAP_TEMPLATE_CONST eap_array_c<simple_config_credential_c> * const credential_array) const |
|
603 { |
|
604 u32_t size(0ul); |
|
605 |
|
606 for (u32_t ind_credential = 0ul; ind_credential < credential_array->get_object_count(); ind_credential++) |
|
607 { |
|
608 simple_config_credential_c * const credential = credential_array->get_object(ind_credential); |
|
609 if (credential != 0) |
|
610 { |
|
611 size += eap_tlv_header_c::get_header_length() // Size of structure header |
|
612 + get_payload_size(credential); |
|
613 } |
|
614 } // for () |
|
615 |
|
616 return (size); |
|
617 } |
|
618 |
|
619 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
|
620 |
|
621 //-------------------------------------------------- |
|
622 |
|
623 EAP_FUNC_EXPORT u32_t eap_process_tlv_message_data_c::get_payload_size( |
|
624 const eap_variable_data_c * const selector, |
|
625 const eap_config_value_c * const configuration_option) const |
|
626 { |
|
627 u32_t size_of_data(0ul); |
|
628 |
|
629 EAP_TRACE_DEBUG( |
|
630 m_am_tools, |
|
631 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
632 (EAPL("eap_process_tlv_message_data_c::get_payload_size(): type=%d=%s\n"), |
|
633 configuration_option->get_const_type(), |
|
634 eap_configuration_field_c::get_configure_type_string(configuration_option->get_const_type()))); |
|
635 |
|
636 switch(configuration_option->get_const_type()) |
|
637 { |
|
638 case eap_configure_type_string: |
|
639 case eap_configure_type_hex_data: |
|
640 size_of_data += 3ul * eap_tlv_header_c::get_header_length() |
|
641 + sizeof(u32_t) // Length of the type. |
|
642 + selector->get_data_length() // Length of the option name. |
|
643 + configuration_option->get_const_data()->get_data_length(); // Length of the option data. |
|
644 break; |
|
645 case eap_configure_type_u32_t: |
|
646 case eap_configure_type_boolean: |
|
647 size_of_data += 3ul * eap_tlv_header_c::get_header_length() |
|
648 + sizeof(u32_t) // Length of the type. |
|
649 + selector->get_data_length() // Length of the option name. |
|
650 + sizeof(u32_t); // Length of the option data. |
|
651 break; |
|
652 case eap_configure_type_u32array: |
|
653 { |
|
654 const u32_t count_of_values = configuration_option->get_const_data()->get_data_length() / sizeof(u32_t); |
|
655 size_of_data += 3ul * eap_tlv_header_c::get_header_length() |
|
656 + sizeof(u32_t) // Length of the type. |
|
657 + selector->get_data_length() // Length of the option name. |
|
658 + count_of_values*(eap_tlv_header_c::get_header_length()+sizeof(u32_t)); // Length of the option data. |
|
659 } |
|
660 break; |
|
661 case eap_configure_type_subsection: |
|
662 // No size. |
|
663 break; |
|
664 default: |
|
665 EAP_TRACE_DEBUG( |
|
666 m_am_tools, |
|
667 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
668 (EAPL("ERROR: eap_process_tlv_message_data_c::get_payload_size(): Unknown type=%d=%s\n"), |
|
669 configuration_option->get_const_type(), |
|
670 eap_configuration_field_c::get_configure_type_string(configuration_option->get_const_type()))); |
|
671 break; |
|
672 }; |
|
673 |
|
674 return (size_of_data); |
|
675 } |
|
676 |
|
677 //-------------------------------------------------- |
|
678 |
|
679 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::add_structured_parameter_header( |
|
680 const eap_tlv_message_type_e type, |
|
681 const u32_t length) |
|
682 { |
|
683 EAP_TRACE_DEBUG( |
|
684 m_am_tools, |
|
685 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
686 (EAPL("eap_process_tlv_message_data_c::add_structured_parameter_header(): type=%d=%s\n"), |
|
687 type, |
|
688 get_type_string(type))); |
|
689 |
|
690 return add_message_header( |
|
691 type, |
|
692 length); |
|
693 } |
|
694 |
|
695 //-------------------------------------------------- |
|
696 |
|
697 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::add_parameter_data( |
|
698 const eap_tlv_message_type_e type, |
|
699 const u32_t integer) |
|
700 { |
|
701 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
702 |
|
703 EAP_TRACE_DEBUG( |
|
704 m_am_tools, |
|
705 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
706 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s\n"), |
|
707 type, |
|
708 get_type_string(type))); |
|
709 |
|
710 const u32_t network_order_integer(eap_htonl(integer)); |
|
711 |
|
712 eap_status_e status = add_message_data( |
|
713 type, |
|
714 sizeof(network_order_integer), |
|
715 &network_order_integer); |
|
716 |
|
717 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
718 return EAP_STATUS_RETURN(m_am_tools, status); |
|
719 } |
|
720 |
|
721 //-------------------------------------------------- |
|
722 |
|
723 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::add_parameter_data( |
|
724 const u64_t long_integer) |
|
725 { |
|
726 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
727 |
|
728 EAP_TRACE_DEBUG( |
|
729 m_am_tools, |
|
730 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
731 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s\n"), |
|
732 eap_tlv_message_type_u64_t, |
|
733 get_type_string(eap_tlv_message_type_u64_t))); |
|
734 |
|
735 const u64_t network_order_long_integer(eap_htonll(long_integer)); |
|
736 |
|
737 eap_status_e status = add_message_data( |
|
738 eap_tlv_message_type_u64_t, |
|
739 sizeof(network_order_long_integer), |
|
740 &network_order_long_integer); |
|
741 |
|
742 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
743 return EAP_STATUS_RETURN(m_am_tools, status); |
|
744 } |
|
745 |
|
746 //-------------------------------------------------- |
|
747 |
|
748 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::add_parameter_data( |
|
749 const u32_t integer) |
|
750 { |
|
751 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
752 |
|
753 EAP_TRACE_DEBUG( |
|
754 m_am_tools, |
|
755 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
756 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s\n"), |
|
757 eap_tlv_message_type_u32_t, |
|
758 get_type_string(eap_tlv_message_type_u32_t))); |
|
759 |
|
760 const u32_t network_order_integer(eap_htonl(integer)); |
|
761 |
|
762 eap_status_e status = add_message_data( |
|
763 eap_tlv_message_type_u32_t, |
|
764 sizeof(network_order_integer), |
|
765 &network_order_integer); |
|
766 |
|
767 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
768 return EAP_STATUS_RETURN(m_am_tools, status); |
|
769 } |
|
770 |
|
771 //-------------------------------------------------- |
|
772 |
|
773 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::add_parameter_data( |
|
774 const u16_t short_integer) |
|
775 { |
|
776 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
777 |
|
778 EAP_TRACE_DEBUG( |
|
779 m_am_tools, |
|
780 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
781 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s\n"), |
|
782 eap_tlv_message_type_u16_t, |
|
783 get_type_string(eap_tlv_message_type_u16_t))); |
|
784 |
|
785 const u16_t network_order_short_integer(eap_htons(short_integer)); |
|
786 |
|
787 eap_status_e status = add_message_data( |
|
788 eap_tlv_message_type_u16_t, |
|
789 sizeof(network_order_short_integer), |
|
790 &network_order_short_integer); |
|
791 |
|
792 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
793 return EAP_STATUS_RETURN(m_am_tools, status); |
|
794 } |
|
795 |
|
796 //-------------------------------------------------- |
|
797 |
|
798 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::add_parameter_data( |
|
799 const u8_t byte_integer) |
|
800 { |
|
801 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
802 |
|
803 EAP_TRACE_DEBUG( |
|
804 m_am_tools, |
|
805 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
806 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s\n"), |
|
807 eap_tlv_message_type_u8_t, |
|
808 get_type_string(eap_tlv_message_type_u8_t))); |
|
809 |
|
810 eap_status_e status = add_message_data( |
|
811 eap_tlv_message_type_u8_t, |
|
812 sizeof(byte_integer), |
|
813 &byte_integer); |
|
814 |
|
815 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
816 return EAP_STATUS_RETURN(m_am_tools, status); |
|
817 } |
|
818 |
|
819 //-------------------------------------------------- |
|
820 |
|
821 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::add_parameter_data( |
|
822 const i32_t integer) |
|
823 { |
|
824 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
825 |
|
826 EAP_TRACE_DEBUG( |
|
827 m_am_tools, |
|
828 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
829 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s\n"), |
|
830 eap_tlv_message_type_i32_t, |
|
831 get_type_string(eap_tlv_message_type_i32_t))); |
|
832 |
|
833 const i32_t network_order_integer(eap_htonl(integer)); |
|
834 |
|
835 eap_status_e status = add_message_data( |
|
836 eap_tlv_message_type_i32_t, |
|
837 sizeof(network_order_integer), |
|
838 &network_order_integer); |
|
839 |
|
840 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
841 return EAP_STATUS_RETURN(m_am_tools, status); |
|
842 } |
|
843 |
|
844 //-------------------------------------------------- |
|
845 |
|
846 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::add_parameter_data( |
|
847 const i16_t integer) |
|
848 { |
|
849 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
850 |
|
851 EAP_TRACE_DEBUG( |
|
852 m_am_tools, |
|
853 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
854 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s\n"), |
|
855 eap_tlv_message_type_i16_t, |
|
856 get_type_string(eap_tlv_message_type_i16_t))); |
|
857 |
|
858 const i16_t network_order_short_integer(eap_htons(integer)); |
|
859 |
|
860 eap_status_e status = add_message_data( |
|
861 eap_tlv_message_type_i16_t, |
|
862 sizeof(network_order_short_integer), |
|
863 &network_order_short_integer); |
|
864 |
|
865 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
866 return EAP_STATUS_RETURN(m_am_tools, status); |
|
867 } |
|
868 |
|
869 //-------------------------------------------------- |
|
870 |
|
871 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::add_parameter_data( |
|
872 const i8_t byte_integer) |
|
873 { |
|
874 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
875 |
|
876 EAP_TRACE_DEBUG( |
|
877 m_am_tools, |
|
878 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
879 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s\n"), |
|
880 eap_tlv_message_type_i8_t, |
|
881 get_type_string(eap_tlv_message_type_i8_t))); |
|
882 |
|
883 eap_status_e status = add_message_data( |
|
884 eap_tlv_message_type_i8_t, |
|
885 sizeof(byte_integer), |
|
886 &byte_integer); |
|
887 |
|
888 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
889 return EAP_STATUS_RETURN(m_am_tools, status); |
|
890 } |
|
891 |
|
892 //-------------------------------------------------- |
|
893 |
|
894 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::add_parameter_data( |
|
895 const bool boolean) |
|
896 { |
|
897 const u32_t value((boolean == false) ? 0u: 1u); |
|
898 |
|
899 return add_parameter_data( |
|
900 eap_tlv_message_type_boolean, |
|
901 value); |
|
902 } |
|
903 |
|
904 //-------------------------------------------------- |
|
905 |
|
906 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::add_parameter_data( |
|
907 const eap_status_e status) |
|
908 { |
|
909 const u32_t value(static_cast<u32_t>(status)); |
|
910 |
|
911 return add_parameter_data( |
|
912 eap_tlv_message_type_eap_status, |
|
913 value); |
|
914 } |
|
915 |
|
916 //-------------------------------------------------- |
|
917 |
|
918 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::add_parameter_data( |
|
919 const eapol_key_authentication_type_e authentication_type) |
|
920 { |
|
921 const u32_t value(static_cast<u32_t>(authentication_type)); |
|
922 |
|
923 return add_parameter_data( |
|
924 eap_tlv_message_type_eapol_key_authentication_type, |
|
925 value); |
|
926 } |
|
927 |
|
928 //-------------------------------------------------- |
|
929 |
|
930 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::add_parameter_data( |
|
931 const eapol_key_802_11_authentication_mode_e mode) |
|
932 { |
|
933 const u32_t value(static_cast<u32_t>(mode)); |
|
934 |
|
935 return add_parameter_data( |
|
936 eap_tlv_message_type_eapol_key_802_11_authentication_mode, |
|
937 value); |
|
938 } |
|
939 |
|
940 //-------------------------------------------------- |
|
941 |
|
942 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::add_parameter_data( |
|
943 const eap_tlv_message_type_function_e function) |
|
944 { |
|
945 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
946 |
|
947 EAP_TRACE_DEBUG( |
|
948 m_am_tools, |
|
949 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
950 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, function=%s\n"), |
|
951 eap_tlv_message_type_function, |
|
952 get_type_string(eap_tlv_message_type_function), |
|
953 get_function_string(function))); |
|
954 |
|
955 if (function < eap_tlv_message_type_function_none |
|
956 || function >= eap_tlv_message_type_function_illegal_value) |
|
957 { |
|
958 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
959 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
960 } |
|
961 |
|
962 const u32_t network_order_function(eap_htonl(function)); |
|
963 |
|
964 eap_status_e status = add_message_data( |
|
965 eap_tlv_message_type_function, |
|
966 sizeof(network_order_function), |
|
967 &network_order_function); |
|
968 |
|
969 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
970 return EAP_STATUS_RETURN(m_am_tools, status); |
|
971 } |
|
972 |
|
973 //-------------------------------------------------- |
|
974 |
|
975 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::add_parameter_data( |
|
976 const eap_variable_data_c * const variable_data) |
|
977 { |
|
978 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
979 |
|
980 EAP_TRACE_DEBUG( |
|
981 m_am_tools, |
|
982 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
983 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s\n"), |
|
984 eap_tlv_message_type_variable_data, |
|
985 get_type_string(eap_tlv_message_type_variable_data))); |
|
986 |
|
987 if (variable_data == 0) |
|
988 { |
|
989 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
990 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
991 } |
|
992 |
|
993 eap_status_e status(eap_status_process_general_error); |
|
994 |
|
995 if (variable_data->get_is_valid_data() == false) |
|
996 { |
|
997 // Empty variable data. Add just the header. |
|
998 status = add_structured_parameter_header( |
|
999 eap_tlv_message_type_variable_data, |
|
1000 0ul); |
|
1001 } |
|
1002 else |
|
1003 { |
|
1004 status = add_message_data( |
|
1005 eap_tlv_message_type_variable_data, |
|
1006 variable_data->get_data_length(), |
|
1007 variable_data->get_data()); |
|
1008 } |
|
1009 |
|
1010 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1011 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1012 } |
|
1013 |
|
1014 //-------------------------------------------------- |
|
1015 |
|
1016 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::add_parameter_data( |
|
1017 const eap_am_network_id_c * const network_id) |
|
1018 { |
|
1019 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1020 |
|
1021 EAP_TRACE_DEBUG( |
|
1022 m_am_tools, |
|
1023 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1024 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s\n"), |
|
1025 eap_tlv_message_type_network_id, |
|
1026 get_type_string(eap_tlv_message_type_network_id))); |
|
1027 |
|
1028 if (network_id == 0 |
|
1029 || network_id->get_is_valid() == false) |
|
1030 { |
|
1031 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1032 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
1033 } |
|
1034 |
|
1035 const u32_t size_of_network_id = get_payload_size(network_id); |
|
1036 |
|
1037 eap_status_e status = add_structured_parameter_header( |
|
1038 eap_tlv_message_type_network_id, |
|
1039 size_of_network_id); |
|
1040 if (status != eap_status_ok) |
|
1041 { |
|
1042 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1043 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1044 } |
|
1045 |
|
1046 status = add_parameter_data( |
|
1047 network_id->get_source_id()); |
|
1048 if (status != eap_status_ok) |
|
1049 { |
|
1050 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1051 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1052 } |
|
1053 |
|
1054 status = add_parameter_data( |
|
1055 network_id->get_destination_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 status = add_parameter_data( |
|
1063 network_id->get_type()); |
|
1064 if (status != eap_status_ok) |
|
1065 { |
|
1066 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1067 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1068 } |
|
1069 |
|
1070 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1071 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
1072 } |
|
1073 |
|
1074 //-------------------------------------------------- |
|
1075 |
|
1076 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::add_parameter_data( |
|
1077 const eap_buf_chain_wr_c * const packet_buffer) |
|
1078 { |
|
1079 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1080 |
|
1081 EAP_TRACE_DEBUG( |
|
1082 m_am_tools, |
|
1083 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1084 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s\n"), |
|
1085 eap_tlv_message_type_variable_data, |
|
1086 get_type_string(eap_tlv_message_type_variable_data))); |
|
1087 |
|
1088 if (packet_buffer == 0 |
|
1089 || packet_buffer->get_is_valid() == false) |
|
1090 { |
|
1091 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1092 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
1093 } |
|
1094 |
|
1095 eap_status_e status = add_message_data( |
|
1096 eap_tlv_message_type_variable_data, |
|
1097 packet_buffer->get_data_length(), |
|
1098 packet_buffer->get_data(packet_buffer->get_data_length())); |
|
1099 |
|
1100 |
|
1101 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1102 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1103 } |
|
1104 |
|
1105 //-------------------------------------------------- |
|
1106 |
|
1107 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::add_parameter_data( |
|
1108 const eapol_session_key_c * const session_key) |
|
1109 { |
|
1110 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1111 |
|
1112 EAP_TRACE_DEBUG( |
|
1113 m_am_tools, |
|
1114 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1115 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s\n"), |
|
1116 eap_tlv_message_type_session_key, |
|
1117 get_type_string(eap_tlv_message_type_session_key))); |
|
1118 |
|
1119 if (session_key == 0 |
|
1120 || session_key->get_is_valid() == false) |
|
1121 { |
|
1122 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1123 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
1124 } |
|
1125 |
|
1126 const u32_t size_of_session_key(get_payload_size(session_key)); |
|
1127 |
|
1128 eap_status_e status = add_structured_parameter_header( |
|
1129 eap_tlv_message_type_session_key, |
|
1130 size_of_session_key); |
|
1131 if (status != eap_status_ok) |
|
1132 { |
|
1133 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1134 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1135 } |
|
1136 |
|
1137 status = add_parameter_data( |
|
1138 session_key->get_key()); |
|
1139 if (status != eap_status_ok) |
|
1140 { |
|
1141 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1142 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1143 } |
|
1144 |
|
1145 status = add_parameter_data( |
|
1146 session_key->get_sequence_number()); |
|
1147 if (status != eap_status_ok) |
|
1148 { |
|
1149 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1150 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1151 } |
|
1152 |
|
1153 status = add_parameter_data( |
|
1154 eap_tlv_message_type_eapol_key_type, |
|
1155 static_cast<u32_t>(session_key->get_key_type())); |
|
1156 if (status != eap_status_ok) |
|
1157 { |
|
1158 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1159 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1160 } |
|
1161 |
|
1162 status = add_parameter_data(session_key->get_key_index()); |
|
1163 if (status != eap_status_ok) |
|
1164 { |
|
1165 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1166 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1167 } |
|
1168 |
|
1169 status = add_parameter_data(session_key->get_key_tx_bit()); |
|
1170 if (status != eap_status_ok) |
|
1171 { |
|
1172 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1173 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1174 } |
|
1175 |
|
1176 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1177 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
1178 } |
|
1179 |
|
1180 //-------------------------------------------------- |
|
1181 |
|
1182 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::add_parameter_data( |
|
1183 const abs_eap_state_notification_c * const state) |
|
1184 { |
|
1185 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1186 |
|
1187 EAP_TRACE_DEBUG( |
|
1188 m_am_tools, |
|
1189 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1190 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s\n"), |
|
1191 eap_tlv_message_type_eap_state_notification, |
|
1192 get_type_string(eap_tlv_message_type_eap_state_notification))); |
|
1193 |
|
1194 if (state == 0) |
|
1195 { |
|
1196 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1197 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
1198 } |
|
1199 |
|
1200 const u32_t size_of_state(get_payload_size(state)); |
|
1201 |
|
1202 eap_status_e status = add_structured_parameter_header( |
|
1203 eap_tlv_message_type_eap_state_notification, |
|
1204 size_of_state); |
|
1205 if (status != eap_status_ok) |
|
1206 { |
|
1207 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1208 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1209 } |
|
1210 |
|
1211 status = add_parameter_data(state->get_send_network_id()); |
|
1212 if (status != eap_status_ok) |
|
1213 { |
|
1214 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1215 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1216 } |
|
1217 |
|
1218 status = add_parameter_data( |
|
1219 eap_tlv_message_type_eap_protocol_layer, |
|
1220 static_cast<u32_t>(state->get_protocol_layer())); |
|
1221 if (status != eap_status_ok) |
|
1222 { |
|
1223 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1224 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1225 } |
|
1226 |
|
1227 status = add_parameter_data(state->get_protocol()); |
|
1228 if (status != eap_status_ok) |
|
1229 { |
|
1230 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1231 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1232 } |
|
1233 |
|
1234 status = add_parameter_data(state->get_eap_type()); |
|
1235 if (status != eap_status_ok) |
|
1236 { |
|
1237 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1238 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1239 } |
|
1240 |
|
1241 status = add_parameter_data(state->get_current_state()); |
|
1242 if (status != eap_status_ok) |
|
1243 { |
|
1244 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1245 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1246 } |
|
1247 |
|
1248 status = add_parameter_data(state->get_is_client()); |
|
1249 if (status != eap_status_ok) |
|
1250 { |
|
1251 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1252 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1253 } |
|
1254 |
|
1255 status = add_parameter_data(state->get_authentication_error()); |
|
1256 if (status != eap_status_ok) |
|
1257 { |
|
1258 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1259 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1260 } |
|
1261 |
|
1262 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1263 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
1264 } |
|
1265 |
|
1266 //-------------------------------------------------- |
|
1267 |
|
1268 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::add_parameter_data( |
|
1269 const eap_type_value_e eap_type) |
|
1270 { |
|
1271 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1272 |
|
1273 EAP_TRACE_DEBUG( |
|
1274 m_am_tools, |
|
1275 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1276 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s\n"), |
|
1277 eap_tlv_message_type_eap_type, |
|
1278 get_type_string(eap_tlv_message_type_eap_type))); |
|
1279 |
|
1280 EAP_TRACE_DATA_DEBUG( |
|
1281 m_am_tools, |
|
1282 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1283 (EAPL("add_parameter_data(eap_type_value_e)"), |
|
1284 &eap_type, |
|
1285 sizeof(eap_type))); |
|
1286 |
|
1287 void * type_buffer = 0; |
|
1288 |
|
1289 eap_status_e status = allocate_message_buffer( |
|
1290 eap_tlv_message_type_eap_type, |
|
1291 eap_expanded_type_c::get_eap_expanded_type_size(), |
|
1292 &type_buffer); |
|
1293 if (status != eap_status_ok) |
|
1294 { |
|
1295 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1296 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1297 } |
|
1298 |
|
1299 status = eap_expanded_type_c::write_type( |
|
1300 m_am_tools, |
|
1301 0ul, ///< Index is from 0 to n. Index 0 is the first EAP type field after base EAP header. |
|
1302 type_buffer, |
|
1303 eap_expanded_type_c::get_eap_expanded_type_size(), |
|
1304 true, ///< True value writes always Extented Type. |
|
1305 eap_type ///< The EAP type to be written. |
|
1306 ); |
|
1307 |
|
1308 EAP_TRACE_DEBUG( |
|
1309 m_am_tools, |
|
1310 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1311 (EAPL("eap_tlv_message_data_c::add_message_data(): type %2d=0x%08x, length %3d=0x%08x\n"), |
|
1312 eap_tlv_message_type_eap_type, |
|
1313 eap_tlv_message_type_eap_type, |
|
1314 eap_expanded_type_c::get_eap_expanded_type_size(), |
|
1315 eap_expanded_type_c::get_eap_expanded_type_size())); |
|
1316 |
|
1317 EAP_TRACE_DATA_DEBUG( |
|
1318 m_am_tools, |
|
1319 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1320 (EAPL("add_message_data()"), |
|
1321 type_buffer, |
|
1322 eap_expanded_type_c::get_eap_expanded_type_size())); |
|
1323 |
|
1324 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1325 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
1326 } |
|
1327 |
|
1328 //-------------------------------------------------- |
|
1329 |
|
1330 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::add_parameter_data( |
|
1331 const eap_general_header_base_c * const packet_data) |
|
1332 { |
|
1333 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1334 |
|
1335 EAP_TRACE_DEBUG( |
|
1336 m_am_tools, |
|
1337 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1338 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s\n"), |
|
1339 eap_tlv_message_type_variable_data, |
|
1340 get_type_string(eap_tlv_message_type_variable_data))); |
|
1341 |
|
1342 if (packet_data == 0 |
|
1343 || packet_data->get_is_valid() == false) |
|
1344 { |
|
1345 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1346 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
1347 } |
|
1348 |
|
1349 eap_status_e status = add_message_data( |
|
1350 eap_tlv_message_type_variable_data, |
|
1351 packet_data->get_header_buffer_length(), |
|
1352 packet_data->get_header_buffer(packet_data->get_header_buffer_length())); |
|
1353 |
|
1354 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1355 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1356 } |
|
1357 |
|
1358 //-------------------------------------------------- |
|
1359 |
|
1360 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::add_parameter_data( |
|
1361 const eap_certificate_entry_c * const certificate_entry) |
|
1362 { |
|
1363 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1364 |
|
1365 EAP_TRACE_DEBUG( |
|
1366 m_am_tools, |
|
1367 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1368 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s\n"), |
|
1369 eap_tlv_message_type_eap_certificate_entry, |
|
1370 get_type_string(eap_tlv_message_type_eap_certificate_entry))); |
|
1371 |
|
1372 eap_status_e status(eap_status_not_supported); |
|
1373 |
|
1374 |
|
1375 const u32_t size_of_certificate(get_payload_size(certificate_entry)); |
|
1376 |
|
1377 status = add_structured_parameter_header( |
|
1378 eap_tlv_message_type_eap_certificate_entry, |
|
1379 size_of_certificate); |
|
1380 if (status != eap_status_ok) |
|
1381 { |
|
1382 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1383 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1384 } |
|
1385 |
|
1386 |
|
1387 { |
|
1388 // Specifies whether this entry describes user or CA certificate (mandatory) |
|
1389 status = add_parameter_data(static_cast<u32_t>(certificate_entry->m_CertType)); |
|
1390 if (status != eap_status_ok) |
|
1391 { |
|
1392 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1393 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1394 } |
|
1395 } |
|
1396 |
|
1397 { |
|
1398 // Subject name in distinguished name ASCII form. This is optional. |
|
1399 // For example "/C=US/O=Some organization/CN=Some common name". |
|
1400 status = add_parameter_data(certificate_entry->m_SubjectNamePresent); |
|
1401 if (status != eap_status_ok) |
|
1402 { |
|
1403 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1404 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1405 } |
|
1406 |
|
1407 if (certificate_entry->m_SubjectNamePresent == true) |
|
1408 { |
|
1409 status = add_parameter_data(&(certificate_entry->m_SubjectName)); |
|
1410 if (status != eap_status_ok) |
|
1411 { |
|
1412 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1413 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1414 } |
|
1415 } |
|
1416 } |
|
1417 |
|
1418 { |
|
1419 // Issuer name in distinguished name ASCII form. This is optional. |
|
1420 // For example "/C=US/O=Some organization/CN=Some common name". |
|
1421 status = add_parameter_data(certificate_entry->m_IssuerNamePresent); |
|
1422 if (status != eap_status_ok) |
|
1423 { |
|
1424 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1425 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1426 } |
|
1427 |
|
1428 if (certificate_entry->m_IssuerNamePresent == true) |
|
1429 { |
|
1430 status = add_parameter_data(&(certificate_entry->m_IssuerName)); |
|
1431 if (status != eap_status_ok) |
|
1432 { |
|
1433 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1434 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1435 } |
|
1436 } |
|
1437 } |
|
1438 |
|
1439 { |
|
1440 // Serial number in ASCII form. This is optional. |
|
1441 status = add_parameter_data(certificate_entry->m_SerialNumberPresent); |
|
1442 if (status != eap_status_ok) |
|
1443 { |
|
1444 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1445 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1446 } |
|
1447 |
|
1448 if (certificate_entry->m_SerialNumberPresent == true) |
|
1449 { |
|
1450 status = add_parameter_data(&(certificate_entry->m_SerialNumber)); |
|
1451 if (status != eap_status_ok) |
|
1452 { |
|
1453 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1454 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1455 } |
|
1456 } |
|
1457 } |
|
1458 |
|
1459 { |
|
1460 // Subject key in binary form. This is mandatory. |
|
1461 status = add_parameter_data(certificate_entry->m_SubjectKeyIDPresent); |
|
1462 if (status != eap_status_ok) |
|
1463 { |
|
1464 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1465 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1466 } |
|
1467 |
|
1468 if (certificate_entry->m_SubjectKeyIDPresent == true) |
|
1469 { |
|
1470 status = add_parameter_data(&(certificate_entry->m_SubjectKeyID)); |
|
1471 if (status != eap_status_ok) |
|
1472 { |
|
1473 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1474 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1475 } |
|
1476 } |
|
1477 } |
|
1478 |
|
1479 { |
|
1480 // Thumbprint in binary form. This is optional. |
|
1481 status = add_parameter_data(certificate_entry->m_ThumbprintPresent); |
|
1482 if (status != eap_status_ok) |
|
1483 { |
|
1484 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1485 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1486 } |
|
1487 |
|
1488 if (certificate_entry->m_ThumbprintPresent == true) |
|
1489 { |
|
1490 status = add_parameter_data(&(certificate_entry->m_Thumbprint)); |
|
1491 if (status != eap_status_ok) |
|
1492 { |
|
1493 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1494 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1495 } |
|
1496 } |
|
1497 } |
|
1498 |
|
1499 |
|
1500 { |
|
1501 // This holds only the certificate label. This is the text UI will show. |
|
1502 status = add_parameter_data(certificate_entry->m_LabelPresent); |
|
1503 if (status != eap_status_ok) |
|
1504 { |
|
1505 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1506 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1507 } |
|
1508 |
|
1509 if (certificate_entry->m_LabelPresent == true) |
|
1510 { |
|
1511 status = add_parameter_data(&(certificate_entry->m_Label)); |
|
1512 if (status != eap_status_ok) |
|
1513 { |
|
1514 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1515 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1516 } |
|
1517 } |
|
1518 } |
|
1519 |
|
1520 { |
|
1521 // Primary name of the certificate if any, UI uses this. |
|
1522 status = add_parameter_data(certificate_entry->m_PrimaryNamePresent); |
|
1523 if (status != eap_status_ok) |
|
1524 { |
|
1525 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1526 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1527 } |
|
1528 |
|
1529 if (certificate_entry->m_PrimaryNamePresent == true) |
|
1530 { |
|
1531 status = add_parameter_data(&(certificate_entry->m_PrimaryName)); |
|
1532 if (status != eap_status_ok) |
|
1533 { |
|
1534 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1535 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1536 } |
|
1537 } |
|
1538 } |
|
1539 |
|
1540 { |
|
1541 // Secondary name of the certificate if any, UI uses this. |
|
1542 status = add_parameter_data(certificate_entry->m_SecondaryNamePresent); |
|
1543 if (status != eap_status_ok) |
|
1544 { |
|
1545 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1546 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1547 } |
|
1548 |
|
1549 if (certificate_entry->m_SecondaryNamePresent == true) |
|
1550 { |
|
1551 status = add_parameter_data(&(certificate_entry->m_SecondaryName)); |
|
1552 if (status != eap_status_ok) |
|
1553 { |
|
1554 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1555 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1556 } |
|
1557 } |
|
1558 } |
|
1559 |
|
1560 { |
|
1561 // UI uses this to indicate enabled certificate. |
|
1562 status = add_parameter_data(certificate_entry->m_iIsEnabledPresent); |
|
1563 if (status != eap_status_ok) |
|
1564 { |
|
1565 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1566 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1567 } |
|
1568 |
|
1569 if (certificate_entry->m_iIsEnabledPresent == true) |
|
1570 { |
|
1571 status = add_parameter_data((certificate_entry->m_iIsEnabled)); |
|
1572 if (status != eap_status_ok) |
|
1573 { |
|
1574 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1575 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1576 } |
|
1577 } |
|
1578 } |
|
1579 |
|
1580 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1581 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1582 } |
|
1583 |
|
1584 //-------------------------------------------------- |
|
1585 |
|
1586 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::add_parameter_data( |
|
1587 const eap_method_settings_c * const internal_settings) |
|
1588 { |
|
1589 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1590 |
|
1591 EAP_TRACE_DEBUG( |
|
1592 m_am_tools, |
|
1593 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1594 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s\n"), |
|
1595 eap_tlv_message_type_eap_method_settings, |
|
1596 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
1597 |
|
1598 eap_status_e status(eap_status_not_supported); |
|
1599 |
|
1600 const u32_t size_of_settings(get_payload_size(internal_settings)); |
|
1601 |
|
1602 status = add_structured_parameter_header( |
|
1603 eap_tlv_message_type_eap_method_settings, |
|
1604 size_of_settings); |
|
1605 if (status != eap_status_ok) |
|
1606 { |
|
1607 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1608 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1609 } |
|
1610 |
|
1611 |
|
1612 EAP_TRACE_DEBUG( |
|
1613 m_am_tools, |
|
1614 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1615 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_completion_status\n"), |
|
1616 eap_tlv_message_type_eap_method_settings, |
|
1617 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
1618 |
|
1619 status = add_parameter_data((internal_settings->m_completion_status)); |
|
1620 if (status != eap_status_ok) |
|
1621 { |
|
1622 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1623 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1624 } |
|
1625 |
|
1626 EAP_TRACE_DEBUG( |
|
1627 m_am_tools, |
|
1628 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1629 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_EAPType\n"), |
|
1630 eap_tlv_message_type_eap_method_settings, |
|
1631 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
1632 |
|
1633 // Specifies the EAP-method these settings are for. |
|
1634 status = add_parameter_data(internal_settings->m_EAPType); |
|
1635 if (status != eap_status_ok) |
|
1636 { |
|
1637 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1638 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1639 } |
|
1640 |
|
1641 EAP_TRACE_DEBUG( |
|
1642 m_am_tools, |
|
1643 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1644 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_IndexType\n"), |
|
1645 eap_tlv_message_type_eap_method_settings, |
|
1646 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
1647 |
|
1648 status = add_parameter_data((internal_settings->m_IndexType)); |
|
1649 if (status != eap_status_ok) |
|
1650 { |
|
1651 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1652 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1653 } |
|
1654 |
|
1655 EAP_TRACE_DEBUG( |
|
1656 m_am_tools, |
|
1657 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1658 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_Index\n"), |
|
1659 eap_tlv_message_type_eap_method_settings, |
|
1660 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
1661 |
|
1662 status = add_parameter_data((internal_settings->m_Index)); |
|
1663 if (status != eap_status_ok) |
|
1664 { |
|
1665 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1666 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1667 } |
|
1668 |
|
1669 { |
|
1670 EAP_TRACE_DEBUG( |
|
1671 m_am_tools, |
|
1672 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1673 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_UseAutomaticCACertificatePresent\n"), |
|
1674 eap_tlv_message_type_eap_method_settings, |
|
1675 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
1676 |
|
1677 // Use automatic CA certificate. |
|
1678 status = add_parameter_data(internal_settings->m_UseAutomaticCACertificatePresent); |
|
1679 if (status != eap_status_ok) |
|
1680 { |
|
1681 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1682 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1683 } |
|
1684 |
|
1685 if (internal_settings->m_UseAutomaticCACertificatePresent == true) |
|
1686 { |
|
1687 EAP_TRACE_DEBUG( |
|
1688 m_am_tools, |
|
1689 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1690 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_UseAutomaticCACertificate\n"), |
|
1691 eap_tlv_message_type_eap_method_settings, |
|
1692 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
1693 |
|
1694 status = add_parameter_data((internal_settings->m_UseAutomaticCACertificate)); |
|
1695 if (status != eap_status_ok) |
|
1696 { |
|
1697 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1698 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1699 } |
|
1700 } |
|
1701 } |
|
1702 |
|
1703 { |
|
1704 EAP_TRACE_DEBUG( |
|
1705 m_am_tools, |
|
1706 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1707 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_UseAutomaticUsernamePresent\n"), |
|
1708 eap_tlv_message_type_eap_method_settings, |
|
1709 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
1710 |
|
1711 // Use automatic username. |
|
1712 status = add_parameter_data(internal_settings->m_UseAutomaticUsernamePresent); |
|
1713 if (status != eap_status_ok) |
|
1714 { |
|
1715 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1716 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1717 } |
|
1718 |
|
1719 if (internal_settings->m_UseAutomaticUsernamePresent == true) |
|
1720 { |
|
1721 EAP_TRACE_DEBUG( |
|
1722 m_am_tools, |
|
1723 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1724 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_UseAutomaticUsername\n"), |
|
1725 eap_tlv_message_type_eap_method_settings, |
|
1726 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
1727 |
|
1728 status = add_parameter_data((internal_settings->m_UseAutomaticUsername)); |
|
1729 if (status != eap_status_ok) |
|
1730 { |
|
1731 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1732 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1733 } |
|
1734 } |
|
1735 } |
|
1736 |
|
1737 { |
|
1738 EAP_TRACE_DEBUG( |
|
1739 m_am_tools, |
|
1740 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1741 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_UseAutomaticRealmPresent\n"), |
|
1742 eap_tlv_message_type_eap_method_settings, |
|
1743 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
1744 |
|
1745 // Use automatic username. |
|
1746 status = add_parameter_data(internal_settings->m_UseAutomaticRealmPresent); |
|
1747 if (status != eap_status_ok) |
|
1748 { |
|
1749 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1750 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1751 } |
|
1752 |
|
1753 if (internal_settings->m_UseAutomaticRealmPresent == true) |
|
1754 { |
|
1755 EAP_TRACE_DEBUG( |
|
1756 m_am_tools, |
|
1757 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1758 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_UseAutomaticRealm\n"), |
|
1759 eap_tlv_message_type_eap_method_settings, |
|
1760 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
1761 |
|
1762 status = add_parameter_data((internal_settings->m_UseAutomaticRealm)); |
|
1763 if (status != eap_status_ok) |
|
1764 { |
|
1765 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1766 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1767 } |
|
1768 } |
|
1769 } |
|
1770 |
|
1771 { |
|
1772 EAP_TRACE_DEBUG( |
|
1773 m_am_tools, |
|
1774 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1775 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_UsernamePresent\n"), |
|
1776 eap_tlv_message_type_eap_method_settings, |
|
1777 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
1778 |
|
1779 // Username in ASCII format |
|
1780 status = add_parameter_data(internal_settings->m_UsernamePresent); |
|
1781 if (status != eap_status_ok) |
|
1782 { |
|
1783 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1784 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1785 } |
|
1786 |
|
1787 if (internal_settings->m_UsernamePresent == true) |
|
1788 { |
|
1789 EAP_TRACE_DEBUG( |
|
1790 m_am_tools, |
|
1791 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1792 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_Username_fix\n"), |
|
1793 eap_tlv_message_type_eap_method_settings, |
|
1794 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
1795 |
|
1796 status = add_parameter_data(&(internal_settings->m_Username_fix)); |
|
1797 if (status != eap_status_ok) |
|
1798 { |
|
1799 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1800 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1801 } |
|
1802 } |
|
1803 } |
|
1804 |
|
1805 { |
|
1806 EAP_TRACE_DEBUG( |
|
1807 m_am_tools, |
|
1808 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1809 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_PasswordExistPresent\n"), |
|
1810 eap_tlv_message_type_eap_method_settings, |
|
1811 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
1812 |
|
1813 // Password existence |
|
1814 status = add_parameter_data(internal_settings->m_PasswordExistPresent); |
|
1815 if (status != eap_status_ok) |
|
1816 { |
|
1817 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1818 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1819 } |
|
1820 |
|
1821 if (internal_settings->m_PasswordExistPresent == true) |
|
1822 { |
|
1823 EAP_TRACE_DEBUG( |
|
1824 m_am_tools, |
|
1825 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1826 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_PasswordExist\n"), |
|
1827 eap_tlv_message_type_eap_method_settings, |
|
1828 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
1829 |
|
1830 status = add_parameter_data(internal_settings->m_PasswordExist); |
|
1831 if (status != eap_status_ok) |
|
1832 { |
|
1833 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1834 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1835 } |
|
1836 } |
|
1837 } |
|
1838 |
|
1839 { |
|
1840 EAP_TRACE_DEBUG( |
|
1841 m_am_tools, |
|
1842 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1843 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_PasswordPresent\n"), |
|
1844 eap_tlv_message_type_eap_method_settings, |
|
1845 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
1846 |
|
1847 // Password in ASCII format |
|
1848 status = add_parameter_data(internal_settings->m_PasswordPresent); |
|
1849 if (status != eap_status_ok) |
|
1850 { |
|
1851 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1852 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1853 } |
|
1854 |
|
1855 if (internal_settings->m_PasswordPresent == true) |
|
1856 { |
|
1857 EAP_TRACE_DEBUG( |
|
1858 m_am_tools, |
|
1859 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1860 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_Password\n"), |
|
1861 eap_tlv_message_type_eap_method_settings, |
|
1862 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
1863 |
|
1864 status = add_parameter_data(&(internal_settings->m_Password)); |
|
1865 if (status != eap_status_ok) |
|
1866 { |
|
1867 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1868 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1869 } |
|
1870 } |
|
1871 } |
|
1872 |
|
1873 { |
|
1874 EAP_TRACE_DEBUG( |
|
1875 m_am_tools, |
|
1876 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1877 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_RealmPresent\n"), |
|
1878 eap_tlv_message_type_eap_method_settings, |
|
1879 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
1880 |
|
1881 // Realm in ASCII format |
|
1882 status = add_parameter_data(internal_settings->m_RealmPresent); |
|
1883 if (status != eap_status_ok) |
|
1884 { |
|
1885 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1886 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1887 } |
|
1888 |
|
1889 if (internal_settings->m_RealmPresent == true) |
|
1890 { |
|
1891 EAP_TRACE_DEBUG( |
|
1892 m_am_tools, |
|
1893 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1894 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_Realm\n"), |
|
1895 eap_tlv_message_type_eap_method_settings, |
|
1896 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
1897 |
|
1898 status = add_parameter_data(&(internal_settings->m_Realm)); |
|
1899 if (status != eap_status_ok) |
|
1900 { |
|
1901 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1902 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1903 } |
|
1904 } |
|
1905 } |
|
1906 |
|
1907 { |
|
1908 EAP_TRACE_DEBUG( |
|
1909 m_am_tools, |
|
1910 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1911 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_UsePseudonymsPresent\n"), |
|
1912 eap_tlv_message_type_eap_method_settings, |
|
1913 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
1914 |
|
1915 // Use pseudonym identities in EAP-SIM/AKA |
|
1916 status = add_parameter_data(internal_settings->m_UsePseudonymsPresent); |
|
1917 if (status != eap_status_ok) |
|
1918 { |
|
1919 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1920 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1921 } |
|
1922 |
|
1923 if (internal_settings->m_UsePseudonymsPresent == true) |
|
1924 { |
|
1925 EAP_TRACE_DEBUG( |
|
1926 m_am_tools, |
|
1927 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1928 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_UsePseudonyms\n"), |
|
1929 eap_tlv_message_type_eap_method_settings, |
|
1930 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
1931 |
|
1932 status = add_parameter_data((internal_settings->m_UsePseudonyms)); |
|
1933 if (status != eap_status_ok) |
|
1934 { |
|
1935 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1936 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1937 } |
|
1938 } |
|
1939 } |
|
1940 |
|
1941 { |
|
1942 EAP_TRACE_DEBUG( |
|
1943 m_am_tools, |
|
1944 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1945 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_VerifyServerRealmPresent\n"), |
|
1946 eap_tlv_message_type_eap_method_settings, |
|
1947 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
1948 |
|
1949 // Whether EAP-TLS/TTLS/PEAP should verify server realm |
|
1950 status = add_parameter_data(internal_settings->m_VerifyServerRealmPresent); |
|
1951 if (status != eap_status_ok) |
|
1952 { |
|
1953 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1954 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1955 } |
|
1956 |
|
1957 if (internal_settings->m_VerifyServerRealmPresent == true) |
|
1958 { |
|
1959 EAP_TRACE_DEBUG( |
|
1960 m_am_tools, |
|
1961 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1962 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_VerifyServerRealm\n"), |
|
1963 eap_tlv_message_type_eap_method_settings, |
|
1964 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
1965 |
|
1966 status = add_parameter_data((internal_settings->m_VerifyServerRealm)); |
|
1967 if (status != eap_status_ok) |
|
1968 { |
|
1969 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1970 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1971 } |
|
1972 } |
|
1973 } |
|
1974 |
|
1975 { |
|
1976 EAP_TRACE_DEBUG( |
|
1977 m_am_tools, |
|
1978 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1979 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_RequireClientAuthenticationPresent\n"), |
|
1980 eap_tlv_message_type_eap_method_settings, |
|
1981 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
1982 |
|
1983 // Whether EAP-TLS/TTLS/PEAP should require client authentication |
|
1984 status = add_parameter_data(internal_settings->m_RequireClientAuthenticationPresent); |
|
1985 if (status != eap_status_ok) |
|
1986 { |
|
1987 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1988 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1989 } |
|
1990 |
|
1991 if (internal_settings->m_RequireClientAuthenticationPresent == true) |
|
1992 { |
|
1993 EAP_TRACE_DEBUG( |
|
1994 m_am_tools, |
|
1995 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1996 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_RequireClientAuthentication\n"), |
|
1997 eap_tlv_message_type_eap_method_settings, |
|
1998 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
1999 |
|
2000 status = add_parameter_data((internal_settings->m_RequireClientAuthentication)); |
|
2001 if (status != eap_status_ok) |
|
2002 { |
|
2003 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2004 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2005 } |
|
2006 } |
|
2007 } |
|
2008 |
|
2009 { |
|
2010 EAP_TRACE_DEBUG( |
|
2011 m_am_tools, |
|
2012 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2013 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_SessionValidityTimePresent\n"), |
|
2014 eap_tlv_message_type_eap_method_settings, |
|
2015 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2016 |
|
2017 // General session validity time (in minutes) |
|
2018 status = add_parameter_data(internal_settings->m_SessionValidityTimePresent); |
|
2019 if (status != eap_status_ok) |
|
2020 { |
|
2021 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2022 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2023 } |
|
2024 |
|
2025 if (internal_settings->m_SessionValidityTimePresent == true) |
|
2026 { |
|
2027 EAP_TRACE_DEBUG( |
|
2028 m_am_tools, |
|
2029 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2030 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_SessionValidityTime\n"), |
|
2031 eap_tlv_message_type_eap_method_settings, |
|
2032 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2033 |
|
2034 status = add_parameter_data((internal_settings->m_SessionValidityTime)); |
|
2035 if (status != eap_status_ok) |
|
2036 { |
|
2037 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2038 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2039 } |
|
2040 } |
|
2041 } |
|
2042 |
|
2043 { |
|
2044 EAP_TRACE_DEBUG( |
|
2045 m_am_tools, |
|
2046 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2047 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_CipherSuitesPresent\n"), |
|
2048 eap_tlv_message_type_eap_method_settings, |
|
2049 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2050 |
|
2051 // An array of allowed cipher suites for EAP-TLS/TTLS/PEAP. |
|
2052 // Refer to RFC2246 chapter A.5 for the values. |
|
2053 status = add_parameter_data(internal_settings->m_CipherSuitesPresent); |
|
2054 if (status != eap_status_ok) |
|
2055 { |
|
2056 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2057 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2058 } |
|
2059 |
|
2060 if (internal_settings->m_CipherSuitesPresent == true) |
|
2061 { |
|
2062 EAP_TRACE_DEBUG( |
|
2063 m_am_tools, |
|
2064 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2065 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_CipherSuites\n"), |
|
2066 eap_tlv_message_type_eap_method_settings, |
|
2067 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2068 |
|
2069 status = add_parameter_data(&(internal_settings->m_CipherSuites)); |
|
2070 if (status != eap_status_ok) |
|
2071 { |
|
2072 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2073 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2074 } |
|
2075 } |
|
2076 } |
|
2077 |
|
2078 { |
|
2079 EAP_TRACE_DEBUG( |
|
2080 m_am_tools, |
|
2081 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2082 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_PEAPVersionsPresent\n"), |
|
2083 eap_tlv_message_type_eap_method_settings, |
|
2084 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2085 |
|
2086 // Which EAP-PEAP versions are allowed |
|
2087 status = add_parameter_data(internal_settings->m_PEAPVersionsPresent); |
|
2088 if (status != eap_status_ok) |
|
2089 { |
|
2090 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2091 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2092 } |
|
2093 |
|
2094 if (internal_settings->m_PEAPVersionsPresent == true) |
|
2095 { |
|
2096 EAP_TRACE_DEBUG( |
|
2097 m_am_tools, |
|
2098 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2099 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_PEAPv0Allowed\n"), |
|
2100 eap_tlv_message_type_eap_method_settings, |
|
2101 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2102 |
|
2103 status = add_parameter_data((internal_settings->m_PEAPv0Allowed)); |
|
2104 if (status != eap_status_ok) |
|
2105 { |
|
2106 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2107 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2108 } |
|
2109 |
|
2110 EAP_TRACE_DEBUG( |
|
2111 m_am_tools, |
|
2112 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2113 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_PEAPv1Allowed\n"), |
|
2114 eap_tlv_message_type_eap_method_settings, |
|
2115 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2116 |
|
2117 status = add_parameter_data((internal_settings->m_PEAPv1Allowed)); |
|
2118 if (status != eap_status_ok) |
|
2119 { |
|
2120 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2121 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2122 } |
|
2123 |
|
2124 EAP_TRACE_DEBUG( |
|
2125 m_am_tools, |
|
2126 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2127 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_PEAPv2Allowed\n"), |
|
2128 eap_tlv_message_type_eap_method_settings, |
|
2129 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2130 |
|
2131 status = add_parameter_data((internal_settings->m_PEAPv2Allowed)); |
|
2132 if (status != eap_status_ok) |
|
2133 { |
|
2134 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2135 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2136 } |
|
2137 } |
|
2138 } |
|
2139 |
|
2140 { |
|
2141 EAP_TRACE_DEBUG( |
|
2142 m_am_tools, |
|
2143 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2144 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_CertificatesPresent\n"), |
|
2145 eap_tlv_message_type_eap_method_settings, |
|
2146 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2147 |
|
2148 // Array listing the allowed certificates for EAP-TLS/TTLS/PEAP. |
|
2149 // Subject key ID and Certificate type are the only mandatory certificate |
|
2150 // details needed at the moment. |
|
2151 status = add_parameter_data(internal_settings->m_CertificatesPresent); |
|
2152 if (status != eap_status_ok) |
|
2153 { |
|
2154 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2155 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2156 } |
|
2157 |
|
2158 if (internal_settings->m_CertificatesPresent == true) |
|
2159 { |
|
2160 EAP_TRACE_DEBUG( |
|
2161 m_am_tools, |
|
2162 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2163 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_Certificates\n"), |
|
2164 eap_tlv_message_type_eap_method_settings, |
|
2165 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2166 |
|
2167 status = add_parameter_data(&(internal_settings->m_Certificates)); |
|
2168 if (status != eap_status_ok) |
|
2169 { |
|
2170 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2171 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2172 } |
|
2173 } |
|
2174 } |
|
2175 |
|
2176 { |
|
2177 EAP_TRACE_DEBUG( |
|
2178 m_am_tools, |
|
2179 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2180 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_EnabledEncapsulatedEAPTypesPresent\n"), |
|
2181 eap_tlv_message_type_eap_method_settings, |
|
2182 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2183 |
|
2184 // Array listing the enabled encapsulated EAP types (in priority order). |
|
2185 // Use EAP type values from eap_type_value_e. |
|
2186 status = add_parameter_data(internal_settings->m_EnabledEncapsulatedEAPTypesPresent); |
|
2187 if (status != eap_status_ok) |
|
2188 { |
|
2189 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2190 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2191 } |
|
2192 |
|
2193 if (internal_settings->m_EnabledEncapsulatedEAPTypesPresent == true) |
|
2194 { |
|
2195 EAP_TRACE_DEBUG( |
|
2196 m_am_tools, |
|
2197 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2198 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_EnabledEncapsulatedEAPTypes\n"), |
|
2199 eap_tlv_message_type_eap_method_settings, |
|
2200 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2201 |
|
2202 status = add_parameter_data(&(internal_settings->m_EnabledEncapsulatedEAPTypes)); |
|
2203 if (status != eap_status_ok) |
|
2204 { |
|
2205 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2206 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2207 } |
|
2208 } |
|
2209 } |
|
2210 |
|
2211 { |
|
2212 EAP_TRACE_DEBUG( |
|
2213 m_am_tools, |
|
2214 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2215 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_DisabledEncapsulatedEAPTypesPresent\n"), |
|
2216 eap_tlv_message_type_eap_method_settings, |
|
2217 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2218 |
|
2219 // Array listing the disabled encapsulated EAP types (in priority order). |
|
2220 // Use EAP type values from eap_type_value_e. |
|
2221 status = add_parameter_data(internal_settings->m_DisabledEncapsulatedEAPTypesPresent); |
|
2222 if (status != eap_status_ok) |
|
2223 { |
|
2224 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2225 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2226 } |
|
2227 |
|
2228 if (internal_settings->m_DisabledEncapsulatedEAPTypesPresent == true) |
|
2229 { |
|
2230 EAP_TRACE_DEBUG( |
|
2231 m_am_tools, |
|
2232 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2233 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_DisabledEncapsulatedEAPTypes\n"), |
|
2234 eap_tlv_message_type_eap_method_settings, |
|
2235 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2236 |
|
2237 status = add_parameter_data(&(internal_settings->m_DisabledEncapsulatedEAPTypes)); |
|
2238 if (status != eap_status_ok) |
|
2239 { |
|
2240 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2241 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2242 } |
|
2243 } |
|
2244 } |
|
2245 |
|
2246 { |
|
2247 EAP_TRACE_DEBUG( |
|
2248 m_am_tools, |
|
2249 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2250 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_AuthProvModeAllowedPresent\n"), |
|
2251 eap_tlv_message_type_eap_method_settings, |
|
2252 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2253 |
|
2254 // Whether Authenticated provisioning mode allowed or not in EAP-FAST. |
|
2255 status = add_parameter_data(internal_settings->m_AuthProvModeAllowedPresent); |
|
2256 if (status != eap_status_ok) |
|
2257 { |
|
2258 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2259 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2260 } |
|
2261 |
|
2262 if (internal_settings->m_AuthProvModeAllowedPresent == true) |
|
2263 { |
|
2264 EAP_TRACE_DEBUG( |
|
2265 m_am_tools, |
|
2266 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2267 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_AuthProvModeAllowed\n"), |
|
2268 eap_tlv_message_type_eap_method_settings, |
|
2269 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2270 |
|
2271 status = add_parameter_data((internal_settings->m_AuthProvModeAllowed)); |
|
2272 if (status != eap_status_ok) |
|
2273 { |
|
2274 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2275 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2276 } |
|
2277 } |
|
2278 } |
|
2279 |
|
2280 { |
|
2281 EAP_TRACE_DEBUG( |
|
2282 m_am_tools, |
|
2283 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2284 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_UnauthProvModeAllowedPresent\n"), |
|
2285 eap_tlv_message_type_eap_method_settings, |
|
2286 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2287 |
|
2288 // Whether Unauthenticated provisioning mode allowed or not in EAP-FAST. |
|
2289 status = add_parameter_data(internal_settings->m_UnauthProvModeAllowedPresent); |
|
2290 if (status != eap_status_ok) |
|
2291 { |
|
2292 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2293 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2294 } |
|
2295 |
|
2296 if (internal_settings->m_UnauthProvModeAllowedPresent == true) |
|
2297 { |
|
2298 EAP_TRACE_DEBUG( |
|
2299 m_am_tools, |
|
2300 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2301 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_UnauthProvModeAllowed\n"), |
|
2302 eap_tlv_message_type_eap_method_settings, |
|
2303 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2304 |
|
2305 status = add_parameter_data((internal_settings->m_UnauthProvModeAllowed)); |
|
2306 if (status != eap_status_ok) |
|
2307 { |
|
2308 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2309 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2310 } |
|
2311 } |
|
2312 } |
|
2313 |
|
2314 { |
|
2315 EAP_TRACE_DEBUG( |
|
2316 m_am_tools, |
|
2317 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2318 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_PACGroupReferencePresent\n"), |
|
2319 eap_tlv_message_type_eap_method_settings, |
|
2320 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2321 |
|
2322 // PAC group reference in ASCII format for EAP-FAST. |
|
2323 status = add_parameter_data(internal_settings->m_PACGroupReferencePresent); |
|
2324 if (status != eap_status_ok) |
|
2325 { |
|
2326 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2327 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2328 } |
|
2329 |
|
2330 if (internal_settings->m_PACGroupReferencePresent == true) |
|
2331 { |
|
2332 EAP_TRACE_DEBUG( |
|
2333 m_am_tools, |
|
2334 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2335 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_PACGroupReference\n"), |
|
2336 eap_tlv_message_type_eap_method_settings, |
|
2337 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2338 |
|
2339 status = add_parameter_data(&(internal_settings->m_PACGroupReference)); |
|
2340 if (status != eap_status_ok) |
|
2341 { |
|
2342 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2343 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2344 } |
|
2345 } |
|
2346 } |
|
2347 |
|
2348 { |
|
2349 EAP_TRACE_DEBUG( |
|
2350 m_am_tools, |
|
2351 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2352 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_WarnADHPNoPACPresent\n"), |
|
2353 eap_tlv_message_type_eap_method_settings, |
|
2354 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2355 |
|
2356 // Whether to Warn (or Prompt) for ADHP (Authenticated Diffie-Hellman Protocol) |
|
2357 // auto-provisioning when there is no PAC at all. EAP-FAST specific. |
|
2358 status = add_parameter_data(internal_settings->m_WarnADHPNoPACPresent); |
|
2359 if (status != eap_status_ok) |
|
2360 { |
|
2361 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2362 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2363 } |
|
2364 |
|
2365 if (internal_settings->m_WarnADHPNoPACPresent == true) |
|
2366 { |
|
2367 EAP_TRACE_DEBUG( |
|
2368 m_am_tools, |
|
2369 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2370 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_WarnADHPNoPAC\n"), |
|
2371 eap_tlv_message_type_eap_method_settings, |
|
2372 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2373 |
|
2374 status = add_parameter_data((internal_settings->m_WarnADHPNoPAC)); |
|
2375 if (status != eap_status_ok) |
|
2376 { |
|
2377 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2378 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2379 } |
|
2380 } |
|
2381 } |
|
2382 |
|
2383 { |
|
2384 EAP_TRACE_DEBUG( |
|
2385 m_am_tools, |
|
2386 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2387 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_WarnADHPNoMatchingPACPresent\n"), |
|
2388 eap_tlv_message_type_eap_method_settings, |
|
2389 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2390 |
|
2391 // Whether to Warn (or Prompt) for ADHP auto-provisioning when |
|
2392 // there is no PAC that matches the A-ID sent by server. EAP-FAST specific. |
|
2393 status = add_parameter_data(internal_settings->m_WarnADHPNoMatchingPACPresent); |
|
2394 if (status != eap_status_ok) |
|
2395 { |
|
2396 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2397 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2398 } |
|
2399 |
|
2400 if (internal_settings->m_WarnADHPNoMatchingPACPresent == true) |
|
2401 { |
|
2402 EAP_TRACE_DEBUG( |
|
2403 m_am_tools, |
|
2404 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2405 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_WarnADHPNoMatchingPAC\n"), |
|
2406 eap_tlv_message_type_eap_method_settings, |
|
2407 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2408 |
|
2409 status = add_parameter_data((internal_settings->m_WarnADHPNoMatchingPAC)); |
|
2410 if (status != eap_status_ok) |
|
2411 { |
|
2412 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2413 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2414 } |
|
2415 } |
|
2416 } |
|
2417 |
|
2418 { |
|
2419 EAP_TRACE_DEBUG( |
|
2420 m_am_tools, |
|
2421 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2422 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_WarnNotDefaultServerPresent\n"), |
|
2423 eap_tlv_message_type_eap_method_settings, |
|
2424 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2425 |
|
2426 // Whether to Warn (or Prompt) when client encouters a server that has provisioned |
|
2427 // the client with a PAC before but is not currently selected as the default server. |
|
2428 // EAP-FAST specific. |
|
2429 status = add_parameter_data(internal_settings->m_WarnNotDefaultServerPresent); |
|
2430 if (status != eap_status_ok) |
|
2431 { |
|
2432 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2433 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2434 } |
|
2435 |
|
2436 if (internal_settings->m_WarnNotDefaultServerPresent == true) |
|
2437 { |
|
2438 EAP_TRACE_DEBUG( |
|
2439 m_am_tools, |
|
2440 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2441 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_WarnNotDefaultServer\n"), |
|
2442 eap_tlv_message_type_eap_method_settings, |
|
2443 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2444 |
|
2445 status = add_parameter_data((internal_settings->m_WarnNotDefaultServer)); |
|
2446 if (status != eap_status_ok) |
|
2447 { |
|
2448 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2449 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2450 } |
|
2451 } |
|
2452 } |
|
2453 |
|
2454 { |
|
2455 EAP_TRACE_DEBUG( |
|
2456 m_am_tools, |
|
2457 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2458 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_SelectedEAPTypesPresent\n"), |
|
2459 eap_tlv_message_type_eap_method_settings, |
|
2460 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2461 |
|
2462 // Array listing the active and disabled EAP types (in priority order). |
|
2463 // Use EAP type values from eap_type_value_e. |
|
2464 status = add_parameter_data(internal_settings->m_SelectedEAPTypesPresent); |
|
2465 if (status != eap_status_ok) |
|
2466 { |
|
2467 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2468 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2469 } |
|
2470 |
|
2471 if (internal_settings->m_SelectedEAPTypesPresent == true) |
|
2472 { |
|
2473 EAP_TRACE_DEBUG( |
|
2474 m_am_tools, |
|
2475 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2476 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_active_eap_methods\n"), |
|
2477 eap_tlv_message_type_eap_method_settings, |
|
2478 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2479 |
|
2480 status = add_parameter_data(&(internal_settings->m_active_eap_methods)); |
|
2481 if (status != eap_status_ok) |
|
2482 { |
|
2483 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2484 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2485 } |
|
2486 |
|
2487 EAP_TRACE_DEBUG( |
|
2488 m_am_tools, |
|
2489 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2490 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_disabled_eap_methods\n"), |
|
2491 eap_tlv_message_type_eap_method_settings, |
|
2492 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2493 |
|
2494 status = add_parameter_data(&(internal_settings->m_disabled_eap_methods)); |
|
2495 if (status != eap_status_ok) |
|
2496 { |
|
2497 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2498 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2499 } |
|
2500 } |
|
2501 } |
|
2502 |
|
2503 { |
|
2504 EAP_TRACE_DEBUG( |
|
2505 m_am_tools, |
|
2506 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2507 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_TunnelingTypePresent\n"), |
|
2508 eap_tlv_message_type_eap_method_settings, |
|
2509 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2510 |
|
2511 status = add_parameter_data(internal_settings->m_TunnelingTypePresent); |
|
2512 if (status != eap_status_ok) |
|
2513 { |
|
2514 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2515 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2516 } |
|
2517 |
|
2518 if (internal_settings->m_TunnelingTypePresent == true) |
|
2519 { |
|
2520 EAP_TRACE_DEBUG( |
|
2521 m_am_tools, |
|
2522 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2523 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_TunnelingType\n"), |
|
2524 eap_tlv_message_type_eap_method_settings, |
|
2525 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2526 |
|
2527 status = add_parameter_data((internal_settings->m_TunnelingType)); |
|
2528 if (status != eap_status_ok) |
|
2529 { |
|
2530 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2531 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2532 } |
|
2533 } |
|
2534 } |
|
2535 |
|
2536 { |
|
2537 EAP_TRACE_DEBUG( |
|
2538 m_am_tools, |
|
2539 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2540 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_DestinationIndexAndTypePresent\n"), |
|
2541 eap_tlv_message_type_eap_method_settings, |
|
2542 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2543 |
|
2544 status = add_parameter_data(internal_settings->m_DestinationIndexAndTypePresent); |
|
2545 if (status != eap_status_ok) |
|
2546 { |
|
2547 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2548 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2549 } |
|
2550 |
|
2551 if (internal_settings->m_DestinationIndexAndTypePresent == true) |
|
2552 { |
|
2553 EAP_TRACE_DEBUG( |
|
2554 m_am_tools, |
|
2555 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2556 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_DestinationIndexType\n"), |
|
2557 eap_tlv_message_type_eap_method_settings, |
|
2558 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2559 |
|
2560 status = add_parameter_data((internal_settings->m_DestinationIndexType)); |
|
2561 if (status != eap_status_ok) |
|
2562 { |
|
2563 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2564 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2565 } |
|
2566 |
|
2567 EAP_TRACE_DEBUG( |
|
2568 m_am_tools, |
|
2569 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2570 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_DestinationIndex\n"), |
|
2571 eap_tlv_message_type_eap_method_settings, |
|
2572 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2573 |
|
2574 status = add_parameter_data((internal_settings->m_DestinationIndex)); |
|
2575 if (status != eap_status_ok) |
|
2576 { |
|
2577 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2578 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2579 } |
|
2580 } |
|
2581 } |
|
2582 |
|
2583 { |
|
2584 EAP_TRACE_DEBUG( |
|
2585 m_am_tools, |
|
2586 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2587 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_MethodInfoPresent\n"), |
|
2588 eap_tlv_message_type_eap_method_settings, |
|
2589 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2590 |
|
2591 status = add_parameter_data(internal_settings->m_MethodInfoPresent); |
|
2592 if (status != eap_status_ok) |
|
2593 { |
|
2594 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2595 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2596 } |
|
2597 |
|
2598 if (internal_settings->m_MethodInfoPresent == true) |
|
2599 { |
|
2600 EAP_TRACE_DEBUG( |
|
2601 m_am_tools, |
|
2602 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2603 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_KReleaseDate\n"), |
|
2604 eap_tlv_message_type_eap_method_settings, |
|
2605 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2606 |
|
2607 status = add_parameter_data(&(internal_settings->m_KReleaseDate)); |
|
2608 if (status != eap_status_ok) |
|
2609 { |
|
2610 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2611 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2612 } |
|
2613 |
|
2614 EAP_TRACE_DEBUG( |
|
2615 m_am_tools, |
|
2616 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2617 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_KEapTypeVersion\n"), |
|
2618 eap_tlv_message_type_eap_method_settings, |
|
2619 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2620 |
|
2621 status = add_parameter_data(&(internal_settings->m_KEapTypeVersion)); |
|
2622 if (status != eap_status_ok) |
|
2623 { |
|
2624 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2625 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2626 } |
|
2627 |
|
2628 EAP_TRACE_DEBUG( |
|
2629 m_am_tools, |
|
2630 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2631 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_KManufacturer\n"), |
|
2632 eap_tlv_message_type_eap_method_settings, |
|
2633 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2634 |
|
2635 status = add_parameter_data(&(internal_settings->m_KManufacturer)); |
|
2636 if (status != eap_status_ok) |
|
2637 { |
|
2638 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2639 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2640 } |
|
2641 } |
|
2642 } |
|
2643 |
|
2644 { |
|
2645 EAP_TRACE_DEBUG( |
|
2646 m_am_tools, |
|
2647 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2648 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_ButtonIdPresent\n"), |
|
2649 eap_tlv_message_type_eap_method_settings, |
|
2650 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2651 |
|
2652 status = add_parameter_data(internal_settings->m_ButtonIdPresent); |
|
2653 if (status != eap_status_ok) |
|
2654 { |
|
2655 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2656 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2657 } |
|
2658 |
|
2659 if (internal_settings->m_ButtonIdPresent == true) |
|
2660 { |
|
2661 EAP_TRACE_DEBUG( |
|
2662 m_am_tools, |
|
2663 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2664 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_ButtonId\n"), |
|
2665 eap_tlv_message_type_eap_method_settings, |
|
2666 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2667 |
|
2668 status = add_parameter_data((internal_settings->m_ButtonId)); |
|
2669 if (status != eap_status_ok) |
|
2670 { |
|
2671 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2672 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2673 } |
|
2674 } |
|
2675 } |
|
2676 |
|
2677 |
|
2678 { |
|
2679 EAP_TRACE_DEBUG( |
|
2680 m_am_tools, |
|
2681 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2682 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_ShowPassWordPromptPresent\n"), |
|
2683 eap_tlv_message_type_eap_method_settings, |
|
2684 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2685 |
|
2686 // Whether to show (or Prompt) password. |
|
2687 status = add_parameter_data(internal_settings->m_ShowPassWordPromptPresent); |
|
2688 if (status != eap_status_ok) |
|
2689 { |
|
2690 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2691 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2692 } |
|
2693 |
|
2694 if (internal_settings->m_ShowPassWordPromptPresent == true) |
|
2695 { |
|
2696 EAP_TRACE_DEBUG( |
|
2697 m_am_tools, |
|
2698 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2699 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_ShowPassWordPrompt\n"), |
|
2700 eap_tlv_message_type_eap_method_settings, |
|
2701 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2702 |
|
2703 status = add_parameter_data((internal_settings->m_ShowPassWordPrompt)); |
|
2704 if (status != eap_status_ok) |
|
2705 { |
|
2706 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2707 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2708 } |
|
2709 } |
|
2710 } |
|
2711 |
|
2712 |
|
2713 { |
|
2714 EAP_TRACE_DEBUG( |
|
2715 m_am_tools, |
|
2716 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2717 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_UseIdentityPrivacyPresent\n"), |
|
2718 eap_tlv_message_type_eap_method_settings, |
|
2719 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2720 |
|
2721 // Whether to show (or Prompt) password. |
|
2722 status = add_parameter_data(internal_settings->m_UseIdentityPrivacyPresent); |
|
2723 if (status != eap_status_ok) |
|
2724 { |
|
2725 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2726 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2727 } |
|
2728 |
|
2729 if (internal_settings->m_UseIdentityPrivacyPresent == true) |
|
2730 { |
|
2731 EAP_TRACE_DEBUG( |
|
2732 m_am_tools, |
|
2733 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2734 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s, m_UseIdentityPrivacy\n"), |
|
2735 eap_tlv_message_type_eap_method_settings, |
|
2736 get_type_string(eap_tlv_message_type_eap_method_settings))); |
|
2737 |
|
2738 status = add_parameter_data((internal_settings->m_UseIdentityPrivacy)); |
|
2739 if (status != eap_status_ok) |
|
2740 { |
|
2741 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2742 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2743 } |
|
2744 } |
|
2745 } |
|
2746 |
|
2747 |
|
2748 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2749 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2750 } |
|
2751 |
|
2752 //-------------------------------------------------- |
|
2753 |
|
2754 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::add_parameter_data( |
|
2755 EAP_TEMPLATE_CONST eap_array_c<u16_t> * const ushort_array) |
|
2756 { |
|
2757 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2758 |
|
2759 EAP_TRACE_DEBUG( |
|
2760 m_am_tools, |
|
2761 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2762 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): array type=%d=%s\n"), |
|
2763 eap_tlv_message_type_u16_t, |
|
2764 get_type_string(eap_tlv_message_type_u16_t))); |
|
2765 |
|
2766 if (ushort_array == 0) |
|
2767 { |
|
2768 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2769 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
2770 } |
|
2771 |
|
2772 const u32_t size_of_ushort_array(get_payload_size(ushort_array)); |
|
2773 |
|
2774 eap_status_e status = add_structured_parameter_header( |
|
2775 eap_tlv_message_type_array, |
|
2776 size_of_ushort_array); |
|
2777 if (status != eap_status_ok) |
|
2778 { |
|
2779 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2780 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2781 } |
|
2782 |
|
2783 |
|
2784 for (u32_t ind = 0ul; ind < ushort_array->get_object_count(); ind++) |
|
2785 { |
|
2786 const u16_t * const value = ushort_array->get_object(ind); |
|
2787 if (value != 0) |
|
2788 { |
|
2789 status = add_parameter_data(*value); |
|
2790 if (status != eap_status_ok) |
|
2791 { |
|
2792 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2793 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2794 } |
|
2795 } |
|
2796 } |
|
2797 |
|
2798 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2799 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
2800 } |
|
2801 |
|
2802 //-------------------------------------------------- |
|
2803 |
|
2804 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::add_parameter_data( |
|
2805 EAP_TEMPLATE_CONST eap_array_c<eap_certificate_entry_c> * const cert_array) |
|
2806 { |
|
2807 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2808 |
|
2809 EAP_TRACE_DEBUG( |
|
2810 m_am_tools, |
|
2811 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2812 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): array type=%d=%s\n"), |
|
2813 eap_tlv_message_type_eap_certificate_entry, |
|
2814 get_type_string(eap_tlv_message_type_eap_certificate_entry))); |
|
2815 |
|
2816 if (cert_array == 0) |
|
2817 { |
|
2818 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2819 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
2820 } |
|
2821 |
|
2822 const u32_t size_of_cert_array(get_payload_size(cert_array)); |
|
2823 |
|
2824 eap_status_e status = add_structured_parameter_header( |
|
2825 eap_tlv_message_type_array, |
|
2826 size_of_cert_array); |
|
2827 if (status != eap_status_ok) |
|
2828 { |
|
2829 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2830 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2831 } |
|
2832 |
|
2833 |
|
2834 for (u32_t ind = 0ul; ind < cert_array->get_object_count(); ind++) |
|
2835 { |
|
2836 const eap_certificate_entry_c * const value = cert_array->get_object(ind); |
|
2837 if (value != 0) |
|
2838 { |
|
2839 status = add_parameter_data(value); |
|
2840 if (status != eap_status_ok) |
|
2841 { |
|
2842 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2843 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2844 } |
|
2845 } |
|
2846 } |
|
2847 |
|
2848 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2849 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
2850 } |
|
2851 |
|
2852 //-------------------------------------------------- |
|
2853 |
|
2854 #if defined(USE_EAP_SIMPLE_CONFIG) |
|
2855 |
|
2856 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::add_parameter_data( |
|
2857 EAP_TEMPLATE_CONST eap_array_c<simple_config_credential_c> * const credential_array) |
|
2858 { |
|
2859 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2860 |
|
2861 EAP_TRACE_DEBUG( |
|
2862 m_am_tools, |
|
2863 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2864 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): array type=%d=%s\n"), |
|
2865 eap_tlv_message_type_protected_setup_credential, |
|
2866 get_type_string(eap_tlv_message_type_protected_setup_credential))); |
|
2867 |
|
2868 if (credential_array == 0) |
|
2869 { |
|
2870 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2871 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
2872 } |
|
2873 |
|
2874 const u32_t size_of_credential_array(get_payload_size(credential_array)); |
|
2875 |
|
2876 eap_status_e status = add_structured_parameter_header( |
|
2877 eap_tlv_message_type_array, |
|
2878 size_of_credential_array); |
|
2879 if (status != eap_status_ok) |
|
2880 { |
|
2881 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2882 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2883 } |
|
2884 |
|
2885 |
|
2886 for (u32_t ind_credential = 0ul; ind_credential < credential_array->get_object_count(); ind_credential++) |
|
2887 { |
|
2888 simple_config_credential_c * const credential = credential_array->get_object(ind_credential); |
|
2889 if (credential != 0) |
|
2890 { |
|
2891 const u32_t size_of_credential(get_payload_size(credential)); |
|
2892 |
|
2893 eap_status_e status = add_structured_parameter_header( |
|
2894 eap_tlv_message_type_protected_setup_credential, |
|
2895 size_of_credential); |
|
2896 if (status != eap_status_ok) |
|
2897 { |
|
2898 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2899 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2900 } |
|
2901 |
|
2902 status = add_parameter_data(credential->get_network_index()); |
|
2903 if (status != eap_status_ok) |
|
2904 { |
|
2905 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2906 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2907 } |
|
2908 |
|
2909 status = add_parameter_data(credential->get_SSID()); |
|
2910 if (status != eap_status_ok) |
|
2911 { |
|
2912 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2913 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2914 } |
|
2915 |
|
2916 status = add_parameter_data(static_cast<u16_t>(credential->get_Authentication_Type())); |
|
2917 if (status != eap_status_ok) |
|
2918 { |
|
2919 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2920 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2921 } |
|
2922 |
|
2923 status = add_parameter_data(static_cast<u16_t>(credential->get_Encryption_Type())); |
|
2924 if (status != eap_status_ok) |
|
2925 { |
|
2926 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2927 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2928 } |
|
2929 |
|
2930 const u32_t size_of_network_key_array(get_payload_size(credential->get_network_keys())); |
|
2931 |
|
2932 status = add_structured_parameter_header( |
|
2933 eap_tlv_message_type_array, |
|
2934 size_of_network_key_array); |
|
2935 if (status != eap_status_ok) |
|
2936 { |
|
2937 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2938 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2939 } |
|
2940 |
|
2941 for (u32_t ind_network_key = 0ul; ind_network_key < credential->get_network_keys()->get_object_count(); ind_network_key++) |
|
2942 { |
|
2943 network_key_and_index_c * const network_key = credential->get_network_keys()->get_object(ind_network_key); |
|
2944 if (network_key != 0) |
|
2945 { |
|
2946 const u32_t size_of_network_key(get_payload_size(network_key)); |
|
2947 |
|
2948 status = add_structured_parameter_header( |
|
2949 eap_tlv_message_type_network_key, |
|
2950 size_of_network_key); |
|
2951 if (status != eap_status_ok) |
|
2952 { |
|
2953 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2954 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2955 } |
|
2956 |
|
2957 status = add_parameter_data(network_key->get_network_key_index()); |
|
2958 if (status != eap_status_ok) |
|
2959 { |
|
2960 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2961 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2962 } |
|
2963 |
|
2964 status = add_parameter_data(network_key->get_network_key()); |
|
2965 if (status != eap_status_ok) |
|
2966 { |
|
2967 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2968 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2969 } |
|
2970 } |
|
2971 } // for () |
|
2972 |
|
2973 status = add_parameter_data(credential->get_MAC_address()); |
|
2974 if (status != eap_status_ok) |
|
2975 { |
|
2976 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2977 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2978 } |
|
2979 } |
|
2980 } // for () |
|
2981 |
|
2982 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2983 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
2984 } |
|
2985 |
|
2986 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
|
2987 |
|
2988 //-------------------------------------------------- |
|
2989 |
|
2990 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::add_parameter_data( |
|
2991 const eap_variable_data_c * const selector, |
|
2992 const eap_config_value_c * const configuration_option) |
|
2993 { |
|
2994 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2995 |
|
2996 EAP_TRACE_DEBUG( |
|
2997 m_am_tools, |
|
2998 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2999 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(): type=%d=%s\n"), |
|
3000 eap_tlv_message_type_variable_data, |
|
3001 get_type_string(eap_tlv_message_type_variable_data))); |
|
3002 |
|
3003 if (selector == 0 |
|
3004 || selector->get_is_valid_data() == false |
|
3005 || configuration_option == 0 |
|
3006 || configuration_option->get_is_valid() == false) |
|
3007 { |
|
3008 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3009 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
3010 } |
|
3011 |
|
3012 eap_status_e status(eap_status_ok); |
|
3013 |
|
3014 u32_t size_of_data = get_payload_size( |
|
3015 selector, |
|
3016 configuration_option); |
|
3017 |
|
3018 if (size_of_data > 0ul) |
|
3019 { |
|
3020 status = add_structured_parameter_header( |
|
3021 eap_tlv_message_type_configuration_option, |
|
3022 size_of_data); |
|
3023 if (status != eap_status_ok) |
|
3024 { |
|
3025 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3026 return EAP_STATUS_RETURN(m_am_tools, status); |
|
3027 } |
|
3028 |
|
3029 status = add_parameter_data(static_cast<u32_t>(configuration_option->get_const_type())); |
|
3030 if (status != eap_status_ok) |
|
3031 { |
|
3032 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3033 return EAP_STATUS_RETURN(m_am_tools, status); |
|
3034 } |
|
3035 |
|
3036 status = add_parameter_data(selector); |
|
3037 if (status != eap_status_ok) |
|
3038 { |
|
3039 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3040 return EAP_STATUS_RETURN(m_am_tools, status); |
|
3041 } |
|
3042 |
|
3043 |
|
3044 switch(configuration_option->get_const_type()) |
|
3045 { |
|
3046 case eap_configure_type_string: |
|
3047 case eap_configure_type_hex_data: |
|
3048 status = add_parameter_data(configuration_option->get_const_data()); |
|
3049 if (status != eap_status_ok) |
|
3050 { |
|
3051 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3052 return EAP_STATUS_RETURN(m_am_tools, status); |
|
3053 } |
|
3054 break; |
|
3055 case eap_configure_type_u32_t: |
|
3056 case eap_configure_type_boolean: |
|
3057 { |
|
3058 const u32_t * value = reinterpret_cast<const u32_t *>(configuration_option->get_const_data()->get_data(sizeof(u32_t))); |
|
3059 if (value != 0) |
|
3060 { |
|
3061 status = add_parameter_data(*value); |
|
3062 if (status != eap_status_ok) |
|
3063 { |
|
3064 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3065 return EAP_STATUS_RETURN(m_am_tools, status); |
|
3066 } |
|
3067 } |
|
3068 } |
|
3069 break; |
|
3070 case eap_configure_type_u32array: |
|
3071 { |
|
3072 const u32_t count_of_values = configuration_option->get_const_data()->get_data_length() / sizeof(u32_t); |
|
3073 const u32_t * value = reinterpret_cast<const u32_t *>(configuration_option->get_const_data()->get_data(sizeof(u32_t))); |
|
3074 if (value != 0) |
|
3075 { |
|
3076 status = add_structured_parameter_header( |
|
3077 eap_tlv_message_type_array, |
|
3078 count_of_values*(eap_tlv_header_c::get_header_length()+sizeof(u32_t))); |
|
3079 if (status != eap_status_ok) |
|
3080 { |
|
3081 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3082 return EAP_STATUS_RETURN(m_am_tools, status); |
|
3083 } |
|
3084 |
|
3085 for (u32_t ind = 0ul; ind < count_of_values; ++ind) |
|
3086 { |
|
3087 status = add_parameter_data(value[ind]); |
|
3088 if (status != eap_status_ok) |
|
3089 { |
|
3090 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3091 return EAP_STATUS_RETURN(m_am_tools, status); |
|
3092 } |
|
3093 } |
|
3094 } |
|
3095 } |
|
3096 break; |
|
3097 default: |
|
3098 break; |
|
3099 }; |
|
3100 } |
|
3101 |
|
3102 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3103 return EAP_STATUS_RETURN(m_am_tools, status); |
|
3104 } |
|
3105 |
|
3106 //-------------------------------------------------- |
|
3107 |
|
3108 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::get_parameter_data( |
|
3109 const eap_tlv_header_c * const integer_header, |
|
3110 u64_t * const value) |
|
3111 { |
|
3112 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3113 |
|
3114 EAP_TRACE_DEBUG( |
|
3115 m_am_tools, |
|
3116 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
3117 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s\n"), |
|
3118 integer_header->get_type(), |
|
3119 get_type_string(static_cast<eap_tlv_message_type_e>(integer_header->get_type())))); |
|
3120 |
|
3121 EAP_TRACE_DATA_DEBUG( |
|
3122 m_am_tools, |
|
3123 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
3124 (EAPL("get_parameter_data(u64_t *)"), |
|
3125 integer_header->get_header_buffer(integer_header->get_header_buffer_length()), |
|
3126 integer_header->get_header_buffer_length())); |
|
3127 |
|
3128 if (static_cast<eap_tlv_message_type_e>(integer_header->get_type()) |
|
3129 != eap_tlv_message_type_u64_t) |
|
3130 { |
|
3131 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3132 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
3133 } |
|
3134 |
|
3135 const u8_t * const data = integer_header->get_value(sizeof(u64_t)); |
|
3136 if (data == 0) |
|
3137 { |
|
3138 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3139 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
3140 } |
|
3141 |
|
3142 *value = |
|
3143 eap_read_u64_t_network_order( |
|
3144 data, |
|
3145 sizeof(u64_t)); |
|
3146 |
|
3147 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3148 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
3149 } |
|
3150 |
|
3151 //-------------------------------------------------- |
|
3152 |
|
3153 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::get_parameter_data( |
|
3154 const eap_tlv_header_c * const integer_header, |
|
3155 u32_t * const value) |
|
3156 { |
|
3157 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3158 |
|
3159 EAP_TRACE_DEBUG( |
|
3160 m_am_tools, |
|
3161 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
3162 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s\n"), |
|
3163 integer_header->get_type(), |
|
3164 get_type_string(static_cast<eap_tlv_message_type_e>(integer_header->get_type())))); |
|
3165 |
|
3166 EAP_TRACE_DATA_DEBUG( |
|
3167 m_am_tools, |
|
3168 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
3169 (EAPL("get_parameter_data(u32_t *)"), |
|
3170 integer_header->get_header_buffer(integer_header->get_header_buffer_length()), |
|
3171 integer_header->get_header_buffer_length())); |
|
3172 |
|
3173 if (static_cast<eap_tlv_message_type_e>(integer_header->get_type()) |
|
3174 != eap_tlv_message_type_boolean |
|
3175 && static_cast<eap_tlv_message_type_e>(integer_header->get_type()) |
|
3176 != eap_tlv_message_type_eap_protocol_layer |
|
3177 && static_cast<eap_tlv_message_type_e>(integer_header->get_type()) |
|
3178 != eap_tlv_message_type_eapol_key_802_11_authentication_mode |
|
3179 && static_cast<eap_tlv_message_type_e>(integer_header->get_type()) |
|
3180 != eap_tlv_message_type_eapol_key_authentication_type |
|
3181 && static_cast<eap_tlv_message_type_e>(integer_header->get_type()) |
|
3182 != eap_tlv_message_type_eapol_key_type |
|
3183 && static_cast<eap_tlv_message_type_e>(integer_header->get_type()) |
|
3184 != eap_tlv_message_type_eapol_tkip_mic_failure_type |
|
3185 && static_cast<eap_tlv_message_type_e>(integer_header->get_type()) |
|
3186 != eap_tlv_message_type_eapol_wlan_authentication_state |
|
3187 && static_cast<eap_tlv_message_type_e>(integer_header->get_type()) |
|
3188 != eap_tlv_message_type_error |
|
3189 && static_cast<eap_tlv_message_type_e>(integer_header->get_type()) |
|
3190 != eap_tlv_message_type_function |
|
3191 && static_cast<eap_tlv_message_type_e>(integer_header->get_type()) |
|
3192 != eap_tlv_message_type_RSNA_cipher |
|
3193 && static_cast<eap_tlv_message_type_e>(integer_header->get_type()) |
|
3194 != eap_tlv_message_type_u32_t |
|
3195 && static_cast<eap_tlv_message_type_e>(integer_header->get_type()) |
|
3196 != eap_tlv_message_type_eap_status |
|
3197 ) |
|
3198 { |
|
3199 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3200 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
3201 } |
|
3202 |
|
3203 const u8_t * const data = integer_header->get_value(sizeof(u32_t)); |
|
3204 if (data == 0) |
|
3205 { |
|
3206 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3207 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
3208 } |
|
3209 |
|
3210 *value = |
|
3211 eap_read_u32_t_network_order( |
|
3212 data, |
|
3213 sizeof(u32_t)); |
|
3214 |
|
3215 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3216 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
3217 } |
|
3218 |
|
3219 //-------------------------------------------------- |
|
3220 |
|
3221 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::get_parameter_data( |
|
3222 const eap_tlv_header_c * const integer_header, |
|
3223 u16_t * const value) |
|
3224 { |
|
3225 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3226 |
|
3227 EAP_TRACE_DEBUG( |
|
3228 m_am_tools, |
|
3229 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
3230 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s\n"), |
|
3231 integer_header->get_type(), |
|
3232 get_type_string(static_cast<eap_tlv_message_type_e>(integer_header->get_type())))); |
|
3233 |
|
3234 EAP_TRACE_DATA_DEBUG( |
|
3235 m_am_tools, |
|
3236 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
3237 (EAPL("get_parameter_data(u16_t *)"), |
|
3238 integer_header->get_header_buffer(integer_header->get_header_buffer_length()), |
|
3239 integer_header->get_header_buffer_length())); |
|
3240 |
|
3241 if (static_cast<eap_tlv_message_type_e>(integer_header->get_type()) |
|
3242 != eap_tlv_message_type_u16_t) |
|
3243 { |
|
3244 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3245 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
3246 } |
|
3247 |
|
3248 const u8_t * const data = integer_header->get_value(sizeof(u16_t)); |
|
3249 if (data == 0) |
|
3250 { |
|
3251 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3252 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
3253 } |
|
3254 |
|
3255 *value = |
|
3256 eap_read_u16_t_network_order( |
|
3257 data, |
|
3258 sizeof(u16_t)); |
|
3259 |
|
3260 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3261 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
3262 } |
|
3263 |
|
3264 //-------------------------------------------------- |
|
3265 |
|
3266 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::get_parameter_data( |
|
3267 const eap_tlv_header_c * const integer_header, |
|
3268 u8_t * const value) |
|
3269 { |
|
3270 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3271 |
|
3272 EAP_TRACE_DEBUG( |
|
3273 m_am_tools, |
|
3274 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
3275 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s\n"), |
|
3276 integer_header->get_type(), |
|
3277 get_type_string(static_cast<eap_tlv_message_type_e>(integer_header->get_type())))); |
|
3278 |
|
3279 EAP_TRACE_DATA_DEBUG( |
|
3280 m_am_tools, |
|
3281 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
3282 (EAPL("get_parameter_data(u8_t *)"), |
|
3283 integer_header->get_header_buffer(integer_header->get_header_buffer_length()), |
|
3284 integer_header->get_header_buffer_length())); |
|
3285 |
|
3286 if (static_cast<eap_tlv_message_type_e>(integer_header->get_type()) |
|
3287 != eap_tlv_message_type_u8_t) |
|
3288 { |
|
3289 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3290 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
3291 } |
|
3292 |
|
3293 const u8_t * const data = integer_header->get_value(sizeof(u8_t)); |
|
3294 if (data == 0) |
|
3295 { |
|
3296 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3297 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
3298 } |
|
3299 |
|
3300 *value = *data; |
|
3301 |
|
3302 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3303 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
3304 } |
|
3305 |
|
3306 //-------------------------------------------------- |
|
3307 |
|
3308 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::get_parameter_data( |
|
3309 const eap_tlv_header_c * const integer_header, |
|
3310 i32_t * const value) |
|
3311 { |
|
3312 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3313 |
|
3314 EAP_TRACE_DEBUG( |
|
3315 m_am_tools, |
|
3316 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
3317 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s\n"), |
|
3318 integer_header->get_type(), |
|
3319 get_type_string(static_cast<eap_tlv_message_type_e>(integer_header->get_type())))); |
|
3320 |
|
3321 EAP_TRACE_DATA_DEBUG( |
|
3322 m_am_tools, |
|
3323 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
3324 (EAPL("get_parameter_data(u8_t *)"), |
|
3325 integer_header->get_header_buffer(integer_header->get_header_buffer_length()), |
|
3326 integer_header->get_header_buffer_length())); |
|
3327 |
|
3328 if (static_cast<eap_tlv_message_type_e>(integer_header->get_type()) |
|
3329 != eap_tlv_message_type_i32_t) |
|
3330 { |
|
3331 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3332 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
3333 } |
|
3334 |
|
3335 const u8_t * const data = integer_header->get_value(sizeof(i32_t)); |
|
3336 if (data == 0) |
|
3337 { |
|
3338 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3339 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
3340 } |
|
3341 |
|
3342 *value = static_cast<i32_t>(eap_read_u32_t_network_order( |
|
3343 data, |
|
3344 sizeof(i32_t))); |
|
3345 |
|
3346 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3347 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
3348 } |
|
3349 |
|
3350 //-------------------------------------------------- |
|
3351 |
|
3352 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::get_parameter_data( |
|
3353 const eap_tlv_header_c * const integer_header, |
|
3354 i16_t * const value) |
|
3355 { |
|
3356 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3357 |
|
3358 EAP_TRACE_DEBUG( |
|
3359 m_am_tools, |
|
3360 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
3361 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s\n"), |
|
3362 integer_header->get_type(), |
|
3363 get_type_string(static_cast<eap_tlv_message_type_e>(integer_header->get_type())))); |
|
3364 |
|
3365 EAP_TRACE_DATA_DEBUG( |
|
3366 m_am_tools, |
|
3367 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
3368 (EAPL("get_parameter_data(u8_t *)"), |
|
3369 integer_header->get_header_buffer(integer_header->get_header_buffer_length()), |
|
3370 integer_header->get_header_buffer_length())); |
|
3371 |
|
3372 if (static_cast<eap_tlv_message_type_e>(integer_header->get_type()) |
|
3373 != eap_tlv_message_type_i16_t) |
|
3374 { |
|
3375 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3376 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
3377 } |
|
3378 |
|
3379 const u8_t * const data = integer_header->get_value(sizeof(i16_t)); |
|
3380 if (data == 0) |
|
3381 { |
|
3382 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3383 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
3384 } |
|
3385 |
|
3386 *value = static_cast<i16_t>(eap_read_u16_t_network_order( |
|
3387 data, |
|
3388 sizeof(i16_t))); |
|
3389 |
|
3390 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3391 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
3392 } |
|
3393 |
|
3394 //-------------------------------------------------- |
|
3395 |
|
3396 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::get_parameter_data( |
|
3397 const eap_tlv_header_c * const integer_header, |
|
3398 i8_t * const value) |
|
3399 { |
|
3400 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3401 |
|
3402 EAP_TRACE_DEBUG( |
|
3403 m_am_tools, |
|
3404 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
3405 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s\n"), |
|
3406 integer_header->get_type(), |
|
3407 get_type_string(static_cast<eap_tlv_message_type_e>(integer_header->get_type())))); |
|
3408 |
|
3409 EAP_TRACE_DATA_DEBUG( |
|
3410 m_am_tools, |
|
3411 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
3412 (EAPL("get_parameter_data(u8_t *)"), |
|
3413 integer_header->get_header_buffer(integer_header->get_header_buffer_length()), |
|
3414 integer_header->get_header_buffer_length())); |
|
3415 |
|
3416 if (static_cast<eap_tlv_message_type_e>(integer_header->get_type()) |
|
3417 != eap_tlv_message_type_i8_t) |
|
3418 { |
|
3419 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3420 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
3421 } |
|
3422 |
|
3423 const u8_t * const data = integer_header->get_value(sizeof(i8_t)); |
|
3424 if (data == 0) |
|
3425 { |
|
3426 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3427 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
3428 } |
|
3429 |
|
3430 *value = static_cast<i8_t>(*data); |
|
3431 |
|
3432 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3433 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
3434 } |
|
3435 |
|
3436 //-------------------------------------------------- |
|
3437 |
|
3438 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::get_parameter_data( |
|
3439 const eap_tlv_header_c * const function_header, |
|
3440 eap_tlv_message_type_function_e * const function) |
|
3441 { |
|
3442 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3443 |
|
3444 EAP_TRACE_DEBUG( |
|
3445 m_am_tools, |
|
3446 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
3447 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s\n"), |
|
3448 function_header->get_type(), |
|
3449 get_type_string(static_cast<eap_tlv_message_type_e>(function_header->get_type())))); |
|
3450 |
|
3451 EAP_TRACE_DATA_DEBUG( |
|
3452 m_am_tools, |
|
3453 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
3454 (EAPL("get_parameter_data(eap_tlv_message_type_function_e *)"), |
|
3455 function_header->get_header_buffer(function_header->get_header_buffer_length()), |
|
3456 function_header->get_header_buffer_length())); |
|
3457 |
|
3458 if (static_cast<eap_tlv_message_type_e>(function_header->get_type()) |
|
3459 != eap_tlv_message_type_function) |
|
3460 { |
|
3461 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3462 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
3463 } |
|
3464 |
|
3465 u32_t host_order(0ul); |
|
3466 |
|
3467 eap_status_e status = get_parameter_data( |
|
3468 function_header, |
|
3469 &host_order); |
|
3470 if (status != eap_status_ok) |
|
3471 { |
|
3472 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3473 return EAP_STATUS_RETURN(m_am_tools, status); |
|
3474 } |
|
3475 |
|
3476 *function = static_cast<eap_tlv_message_type_function_e>(host_order); |
|
3477 |
|
3478 EAP_TRACE_DEBUG( |
|
3479 m_am_tools, |
|
3480 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
3481 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, function=%s\n"), |
|
3482 eap_tlv_message_type_function, |
|
3483 get_type_string(eap_tlv_message_type_function), |
|
3484 get_function_string(*function) |
|
3485 )); |
|
3486 |
|
3487 if (*function < eap_tlv_message_type_function_none |
|
3488 || eap_tlv_message_type_function_illegal_value <= *function) |
|
3489 { |
|
3490 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3491 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
3492 } |
|
3493 |
|
3494 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3495 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
3496 } |
|
3497 |
|
3498 //-------------------------------------------------- |
|
3499 |
|
3500 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::get_parameter_data( |
|
3501 const eap_tlv_header_c * const network_id_header, |
|
3502 eap_am_network_id_c * const new_network_id) |
|
3503 { |
|
3504 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3505 |
|
3506 EAP_TRACE_DEBUG( |
|
3507 m_am_tools, |
|
3508 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
3509 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s\n"), |
|
3510 network_id_header->get_type(), |
|
3511 get_type_string(static_cast<eap_tlv_message_type_e>(network_id_header->get_type())))); |
|
3512 |
|
3513 EAP_TRACE_DATA_DEBUG( |
|
3514 m_am_tools, |
|
3515 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
3516 (EAPL("get_parameter_data(eap_am_network_id_c *)"), |
|
3517 network_id_header->get_header_buffer(network_id_header->get_header_buffer_length()), |
|
3518 network_id_header->get_header_buffer_length())); |
|
3519 |
|
3520 if (static_cast<eap_tlv_message_type_e>(network_id_header->get_type()) |
|
3521 != eap_tlv_message_type_network_id) |
|
3522 { |
|
3523 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3524 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
3525 } |
|
3526 |
|
3527 eap_process_tlv_message_data_c network_id_data(m_am_tools); |
|
3528 |
|
3529 if (network_id_data.get_is_valid() == false) |
|
3530 { |
|
3531 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3532 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
3533 } |
|
3534 |
|
3535 eap_status_e status = network_id_data.set_message_data( |
|
3536 network_id_header->get_value_length(), |
|
3537 network_id_header->get_value(network_id_header->get_value_length())); |
|
3538 |
|
3539 if (status != eap_status_ok) |
|
3540 { |
|
3541 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3542 return EAP_STATUS_RETURN(m_am_tools, status); |
|
3543 } |
|
3544 |
|
3545 eap_array_c<eap_tlv_header_c> network_id_members(m_am_tools); |
|
3546 |
|
3547 status = network_id_data.parse_message_data(&network_id_members); |
|
3548 |
|
3549 if (status != eap_status_ok) |
|
3550 { |
|
3551 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3552 return EAP_STATUS_RETURN(m_am_tools, status); |
|
3553 } |
|
3554 |
|
3555 |
|
3556 u32_t member_index(0ul); |
|
3557 |
|
3558 eap_variable_data_c source_id( |
|
3559 m_am_tools); |
|
3560 |
|
3561 if (source_id.get_is_valid() == false) |
|
3562 { |
|
3563 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3564 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
3565 } |
|
3566 |
|
3567 { |
|
3568 const eap_tlv_header_c * const source_id_header = network_id_members.get_object(member_index); |
|
3569 if (source_id_header == 0) |
|
3570 { |
|
3571 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3572 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
3573 } |
|
3574 |
|
3575 status = network_id_data.get_parameter_data(source_id_header, &source_id); |
|
3576 if (status != eap_status_ok) |
|
3577 { |
|
3578 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3579 return EAP_STATUS_RETURN(m_am_tools, status); |
|
3580 } |
|
3581 } |
|
3582 |
|
3583 |
|
3584 ++member_index; |
|
3585 |
|
3586 eap_variable_data_c destination_id( |
|
3587 m_am_tools); |
|
3588 |
|
3589 if (destination_id.get_is_valid() == false) |
|
3590 { |
|
3591 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3592 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
3593 } |
|
3594 |
|
3595 { |
|
3596 const eap_tlv_header_c * const destination_id_header = network_id_members.get_object(member_index); |
|
3597 if (destination_id_header == 0) |
|
3598 { |
|
3599 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3600 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
3601 } |
|
3602 |
|
3603 status = network_id_data.get_parameter_data(destination_id_header, &destination_id); |
|
3604 if (status != eap_status_ok) |
|
3605 { |
|
3606 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3607 return EAP_STATUS_RETURN(m_am_tools, status); |
|
3608 } |
|
3609 } |
|
3610 |
|
3611 |
|
3612 ++member_index; |
|
3613 |
|
3614 u16_t type_value(0ul); |
|
3615 |
|
3616 { |
|
3617 const eap_tlv_header_c * const type_header = network_id_members.get_object(member_index); |
|
3618 if (type_header == 0) |
|
3619 { |
|
3620 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3621 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
3622 } |
|
3623 |
|
3624 status = network_id_data.get_parameter_data(type_header, &type_value); |
|
3625 if (status != eap_status_ok) |
|
3626 { |
|
3627 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3628 return EAP_STATUS_RETURN(m_am_tools, status); |
|
3629 } |
|
3630 } |
|
3631 |
|
3632 |
|
3633 status = new_network_id->set_copy_of_am_network_id( |
|
3634 source_id.get_data(), |
|
3635 source_id.get_data_length(), |
|
3636 destination_id.get_data(), |
|
3637 destination_id.get_data_length(), |
|
3638 type_value); |
|
3639 if (status != eap_status_ok) |
|
3640 { |
|
3641 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3642 return EAP_STATUS_RETURN(m_am_tools, status); |
|
3643 } |
|
3644 |
|
3645 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3646 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
3647 } |
|
3648 |
|
3649 //-------------------------------------------------- |
|
3650 |
|
3651 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::get_parameter_data( |
|
3652 const eap_tlv_header_c * const variable_data_header, |
|
3653 eap_variable_data_c * const variable_data) |
|
3654 { |
|
3655 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3656 |
|
3657 EAP_TRACE_DEBUG( |
|
3658 m_am_tools, |
|
3659 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
3660 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s\n"), |
|
3661 variable_data_header->get_type(), |
|
3662 get_type_string(static_cast<eap_tlv_message_type_e>(variable_data_header->get_type())))); |
|
3663 |
|
3664 EAP_TRACE_DATA_DEBUG( |
|
3665 m_am_tools, |
|
3666 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
3667 (EAPL("get_parameter_data(eap_variable_data_c *)"), |
|
3668 variable_data_header->get_header_buffer(variable_data_header->get_header_buffer_length()), |
|
3669 variable_data_header->get_header_buffer_length())); |
|
3670 |
|
3671 if (variable_data == 0 |
|
3672 || variable_data->get_is_valid() == false) |
|
3673 { |
|
3674 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3675 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
3676 } |
|
3677 |
|
3678 if (static_cast<eap_tlv_message_type_e>(variable_data_header->get_type()) |
|
3679 != eap_tlv_message_type_variable_data) |
|
3680 { |
|
3681 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3682 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
3683 } |
|
3684 |
|
3685 eap_status_e status = variable_data->set_copy_of_buffer( |
|
3686 variable_data_header->get_value(variable_data_header->get_value_length()), |
|
3687 variable_data_header->get_value_length()); |
|
3688 if (status != eap_status_ok) |
|
3689 { |
|
3690 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3691 return EAP_STATUS_RETURN(m_am_tools, status); |
|
3692 } |
|
3693 |
|
3694 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3695 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
3696 } |
|
3697 |
|
3698 //-------------------------------------------------- |
|
3699 |
|
3700 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::get_parameter_data( |
|
3701 const eap_tlv_header_c * const session_key_header, |
|
3702 eapol_session_key_c * const session_key) |
|
3703 { |
|
3704 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3705 |
|
3706 EAP_TRACE_DEBUG( |
|
3707 m_am_tools, |
|
3708 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
3709 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s\n"), |
|
3710 session_key_header->get_type(), |
|
3711 get_type_string(static_cast<eap_tlv_message_type_e>(session_key_header->get_type())))); |
|
3712 |
|
3713 EAP_TRACE_DATA_DEBUG( |
|
3714 m_am_tools, |
|
3715 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
3716 (EAPL("get_parameter_data(eapol_session_key_c *)"), |
|
3717 session_key_header->get_header_buffer(session_key_header->get_header_buffer_length()), |
|
3718 session_key_header->get_header_buffer_length())); |
|
3719 |
|
3720 if (static_cast<eap_tlv_message_type_e>(session_key_header->get_type()) |
|
3721 != eap_tlv_message_type_session_key) |
|
3722 { |
|
3723 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3724 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
3725 } |
|
3726 |
|
3727 eap_process_tlv_message_data_c session_key_data(m_am_tools); |
|
3728 |
|
3729 if (session_key_data.get_is_valid() == false) |
|
3730 { |
|
3731 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3732 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
3733 } |
|
3734 |
|
3735 eap_status_e status = session_key_data.set_message_data( |
|
3736 session_key_header->get_value_length(), |
|
3737 session_key_header->get_value(session_key_header->get_value_length())); |
|
3738 |
|
3739 if (status != eap_status_ok) |
|
3740 { |
|
3741 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3742 return EAP_STATUS_RETURN(m_am_tools, status); |
|
3743 } |
|
3744 |
|
3745 eap_array_c<eap_tlv_header_c> session_key_members(m_am_tools); |
|
3746 |
|
3747 status = session_key_data.parse_message_data(&session_key_members); |
|
3748 |
|
3749 if (status != eap_status_ok) |
|
3750 { |
|
3751 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3752 return EAP_STATUS_RETURN(m_am_tools, status); |
|
3753 } |
|
3754 |
|
3755 u32_t member_index(0ul); |
|
3756 |
|
3757 { |
|
3758 const eap_tlv_header_c * const a_session_key_header = session_key_members.get_object(member_index); |
|
3759 if (a_session_key_header == 0) |
|
3760 { |
|
3761 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3762 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
3763 } |
|
3764 |
|
3765 eap_variable_data_c key( |
|
3766 m_am_tools); |
|
3767 |
|
3768 if (key.get_is_valid() == false) |
|
3769 { |
|
3770 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3771 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
3772 } |
|
3773 |
|
3774 status = session_key_data.get_parameter_data(a_session_key_header, &key); |
|
3775 if (status != eap_status_ok) |
|
3776 { |
|
3777 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3778 return EAP_STATUS_RETURN(m_am_tools, status); |
|
3779 } |
|
3780 |
|
3781 status = session_key->set_key(&key); |
|
3782 if (status != eap_status_ok) |
|
3783 { |
|
3784 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3785 return EAP_STATUS_RETURN(m_am_tools, status); |
|
3786 } |
|
3787 } |
|
3788 |
|
3789 ++member_index; |
|
3790 |
|
3791 { |
|
3792 const eap_tlv_header_c * const sequence_number_header = session_key_members.get_object(member_index); |
|
3793 if (sequence_number_header == 0) |
|
3794 { |
|
3795 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3796 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
3797 } |
|
3798 |
|
3799 eap_variable_data_c sequence_number( |
|
3800 m_am_tools); |
|
3801 |
|
3802 if (sequence_number.get_is_valid() == false) |
|
3803 { |
|
3804 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3805 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
3806 } |
|
3807 |
|
3808 status = session_key_data.get_parameter_data(sequence_number_header, &sequence_number); |
|
3809 if (status != eap_status_ok) |
|
3810 { |
|
3811 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3812 return EAP_STATUS_RETURN(m_am_tools, status); |
|
3813 } |
|
3814 |
|
3815 status = session_key->set_sequence_number(&sequence_number); |
|
3816 if (status != eap_status_ok) |
|
3817 { |
|
3818 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3819 return EAP_STATUS_RETURN(m_am_tools, status); |
|
3820 } |
|
3821 } |
|
3822 |
|
3823 ++member_index; |
|
3824 |
|
3825 { |
|
3826 const eap_tlv_header_c * const key_type_header = session_key_members.get_object(member_index); |
|
3827 if (key_type_header == 0) |
|
3828 { |
|
3829 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3830 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
3831 } |
|
3832 |
|
3833 u32_t value(0ul); |
|
3834 |
|
3835 status = session_key_data.get_parameter_data(key_type_header, &value); |
|
3836 if (status != eap_status_ok) |
|
3837 { |
|
3838 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3839 return EAP_STATUS_RETURN(m_am_tools, status); |
|
3840 } |
|
3841 |
|
3842 session_key->set_key_type(static_cast<eapol_key_type_e>(value)); |
|
3843 } |
|
3844 |
|
3845 ++member_index; |
|
3846 |
|
3847 { |
|
3848 const eap_tlv_header_c * const key_index_header = session_key_members.get_object(member_index); |
|
3849 if (key_index_header == 0) |
|
3850 { |
|
3851 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3852 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
3853 } |
|
3854 |
|
3855 u32_t value(0ul); |
|
3856 |
|
3857 status = session_key_data.get_parameter_data(key_index_header, &value); |
|
3858 if (status != eap_status_ok) |
|
3859 { |
|
3860 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3861 return EAP_STATUS_RETURN(m_am_tools, status); |
|
3862 } |
|
3863 |
|
3864 session_key->set_key_index(value); |
|
3865 } |
|
3866 |
|
3867 ++member_index; |
|
3868 |
|
3869 { |
|
3870 const eap_tlv_header_c * const key_tx_bit_header = session_key_members.get_object(member_index); |
|
3871 if (key_tx_bit_header == 0) |
|
3872 { |
|
3873 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3874 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
3875 } |
|
3876 |
|
3877 u32_t value(0ul); |
|
3878 |
|
3879 status = session_key_data.get_parameter_data(key_tx_bit_header, &value); |
|
3880 if (status != eap_status_ok) |
|
3881 { |
|
3882 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3883 return EAP_STATUS_RETURN(m_am_tools, status); |
|
3884 } |
|
3885 |
|
3886 session_key->set_key_tx_bit((value == 0) ? false : true); |
|
3887 } |
|
3888 |
|
3889 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3890 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
3891 } |
|
3892 |
|
3893 //-------------------------------------------------- |
|
3894 |
|
3895 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::get_parameter_data( |
|
3896 const eap_tlv_header_c * const state_header, |
|
3897 eap_state_notification_c * * const state) |
|
3898 |
|
3899 { |
|
3900 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3901 |
|
3902 EAP_TRACE_DEBUG( |
|
3903 m_am_tools, |
|
3904 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
3905 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s\n"), |
|
3906 state_header->get_type(), |
|
3907 get_type_string(static_cast<eap_tlv_message_type_e>(state_header->get_type())))); |
|
3908 |
|
3909 EAP_TRACE_DATA_DEBUG( |
|
3910 m_am_tools, |
|
3911 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
3912 (EAPL("get_parameter_data(eap_state_notification_c *)"), |
|
3913 state_header->get_header_buffer(state_header->get_header_buffer_length()), |
|
3914 state_header->get_header_buffer_length())); |
|
3915 |
|
3916 if (static_cast<eap_tlv_message_type_e>(state_header->get_type()) |
|
3917 != eap_tlv_message_type_eap_state_notification) |
|
3918 { |
|
3919 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3920 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
3921 } |
|
3922 |
|
3923 eap_process_tlv_message_data_c session_key_data(m_am_tools); |
|
3924 |
|
3925 if (session_key_data.get_is_valid() == false) |
|
3926 { |
|
3927 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3928 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
3929 } |
|
3930 |
|
3931 eap_status_e status = session_key_data.set_message_data( |
|
3932 state_header->get_value_length(), |
|
3933 state_header->get_value(state_header->get_value_length())); |
|
3934 |
|
3935 if (status != eap_status_ok) |
|
3936 { |
|
3937 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3938 return EAP_STATUS_RETURN(m_am_tools, status); |
|
3939 } |
|
3940 |
|
3941 eap_array_c<eap_tlv_header_c> session_key_members(m_am_tools); |
|
3942 |
|
3943 status = session_key_data.parse_message_data(&session_key_members); |
|
3944 if (status != eap_status_ok) |
|
3945 { |
|
3946 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3947 return EAP_STATUS_RETURN(m_am_tools, status); |
|
3948 } |
|
3949 |
|
3950 |
|
3951 u32_t member_index(0ul); |
|
3952 |
|
3953 eap_am_network_id_c send_network_id(m_am_tools); |
|
3954 |
|
3955 { |
|
3956 const eap_tlv_header_c * const send_network_id_header = session_key_members.get_object(member_index); |
|
3957 if (send_network_id_header == 0) |
|
3958 { |
|
3959 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3960 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
3961 } |
|
3962 |
|
3963 status = get_parameter_data(send_network_id_header, &send_network_id); |
|
3964 if (status != eap_status_ok) |
|
3965 { |
|
3966 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3967 return EAP_STATUS_RETURN(m_am_tools, status); |
|
3968 } |
|
3969 } |
|
3970 |
|
3971 |
|
3972 ++member_index; |
|
3973 |
|
3974 eap_protocol_layer_e protocol_layer(eap_protocol_layer_none); |
|
3975 |
|
3976 { |
|
3977 const eap_tlv_header_c * const protocol_layer_header = session_key_members.get_object(member_index); |
|
3978 if (protocol_layer_header == 0) |
|
3979 { |
|
3980 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3981 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
3982 } |
|
3983 |
|
3984 u32_t value(0ul); |
|
3985 |
|
3986 status = session_key_data.get_parameter_data(protocol_layer_header, &value); |
|
3987 if (status != eap_status_ok) |
|
3988 { |
|
3989 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3990 return EAP_STATUS_RETURN(m_am_tools, status); |
|
3991 } |
|
3992 |
|
3993 protocol_layer = static_cast<eap_protocol_layer_e>(value); |
|
3994 } |
|
3995 |
|
3996 |
|
3997 ++member_index; |
|
3998 |
|
3999 u32_t protocol(0ul); |
|
4000 |
|
4001 { |
|
4002 const eap_tlv_header_c * const protocol_header = session_key_members.get_object(member_index); |
|
4003 if (protocol_header == 0) |
|
4004 { |
|
4005 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4006 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
4007 } |
|
4008 |
|
4009 status = session_key_data.get_parameter_data(protocol_header, &protocol); |
|
4010 if (status != eap_status_ok) |
|
4011 { |
|
4012 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4013 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4014 } |
|
4015 } |
|
4016 |
|
4017 |
|
4018 ++member_index; |
|
4019 |
|
4020 eap_type_value_e eap_type(eap_type_none); |
|
4021 |
|
4022 { |
|
4023 const eap_tlv_header_c * const eap_type_header = session_key_members.get_object(member_index); |
|
4024 if (eap_type_header == 0) |
|
4025 { |
|
4026 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4027 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
4028 } |
|
4029 |
|
4030 status = session_key_data.get_parameter_data(eap_type_header, &eap_type); |
|
4031 if (status != eap_status_ok) |
|
4032 { |
|
4033 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4034 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4035 } |
|
4036 } |
|
4037 |
|
4038 |
|
4039 ++member_index; |
|
4040 |
|
4041 u32_t current_state(0ul); |
|
4042 |
|
4043 { |
|
4044 const eap_tlv_header_c * const current_state_header = session_key_members.get_object(member_index); |
|
4045 if (current_state_header == 0) |
|
4046 { |
|
4047 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4048 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
4049 } |
|
4050 |
|
4051 status = session_key_data.get_parameter_data(current_state_header, ¤t_state); |
|
4052 if (status != eap_status_ok) |
|
4053 { |
|
4054 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4055 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4056 } |
|
4057 } |
|
4058 |
|
4059 |
|
4060 ++member_index; |
|
4061 |
|
4062 bool is_client(true); |
|
4063 |
|
4064 { |
|
4065 const eap_tlv_header_c * const is_client_header = session_key_members.get_object(member_index); |
|
4066 if (is_client_header == 0) |
|
4067 { |
|
4068 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4069 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
4070 } |
|
4071 |
|
4072 u32_t value(0ul); |
|
4073 |
|
4074 status = session_key_data.get_parameter_data(is_client_header, &value); |
|
4075 if (status != eap_status_ok) |
|
4076 { |
|
4077 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4078 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4079 } |
|
4080 |
|
4081 is_client = (value == 0ul) ? false : true; |
|
4082 } |
|
4083 |
|
4084 |
|
4085 ++member_index; |
|
4086 |
|
4087 eap_status_e authentication_error(eap_status_ok); |
|
4088 |
|
4089 { |
|
4090 const eap_tlv_header_c * const authentication_error_header = session_key_members.get_object(member_index); |
|
4091 if (authentication_error_header == 0) |
|
4092 { |
|
4093 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4094 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
4095 } |
|
4096 |
|
4097 u32_t value(0ul); |
|
4098 |
|
4099 status = session_key_data.get_parameter_data(authentication_error_header, &value); |
|
4100 if (status != eap_status_ok) |
|
4101 { |
|
4102 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4103 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4104 } |
|
4105 |
|
4106 authentication_error = static_cast<eap_status_e>(value); |
|
4107 } |
|
4108 |
|
4109 if (eap_type != eap_type_none) |
|
4110 { |
|
4111 *state = new eap_state_notification_c( |
|
4112 m_am_tools, |
|
4113 &send_network_id, |
|
4114 is_client, |
|
4115 eap_state_notification_eap, |
|
4116 protocol_layer, |
|
4117 eap_type, |
|
4118 current_state, |
|
4119 current_state, |
|
4120 0ul, |
|
4121 false); |
|
4122 } |
|
4123 else |
|
4124 { |
|
4125 |
|
4126 |
|
4127 *state = new eap_state_notification_c( |
|
4128 m_am_tools, |
|
4129 &send_network_id, |
|
4130 is_client, |
|
4131 eap_state_notification_generic, |
|
4132 protocol_layer, |
|
4133 protocol, |
|
4134 current_state, |
|
4135 current_state, |
|
4136 0ul, |
|
4137 false); |
|
4138 } |
|
4139 |
|
4140 if ((*state) == 0) |
|
4141 { |
|
4142 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4143 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
4144 } |
|
4145 |
|
4146 (*state)->set_authentication_error(authentication_error); |
|
4147 |
|
4148 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4149 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
4150 } |
|
4151 |
|
4152 //-------------------------------------------------- |
|
4153 |
|
4154 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::get_parameter_data( |
|
4155 const eap_tlv_header_c * const eap_type_header, |
|
4156 eap_type_value_e * const eap_type) |
|
4157 { |
|
4158 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4159 |
|
4160 EAP_TRACE_DEBUG( |
|
4161 m_am_tools, |
|
4162 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4163 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s\n"), |
|
4164 eap_type_header->get_type(), |
|
4165 get_type_string(static_cast<eap_tlv_message_type_e>(eap_type_header->get_type())))); |
|
4166 |
|
4167 EAP_TRACE_DATA_DEBUG( |
|
4168 m_am_tools, |
|
4169 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4170 (EAPL("get_parameter_data(eap_type_value_e *)"), |
|
4171 eap_type_header->get_header_buffer(eap_type_header->get_header_buffer_length()), |
|
4172 eap_type_header->get_header_buffer_length())); |
|
4173 |
|
4174 if (static_cast<eap_tlv_message_type_e>(eap_type_header->get_type()) |
|
4175 != eap_tlv_message_type_eap_type) |
|
4176 { |
|
4177 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4178 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
4179 } |
|
4180 |
|
4181 eap_status_e status = eap_expanded_type_c::read_type( |
|
4182 m_am_tools, |
|
4183 0ul, |
|
4184 eap_type_header->get_value(eap_type_header->get_value_length()), |
|
4185 eap_type_header->get_value_length(), |
|
4186 eap_type); |
|
4187 |
|
4188 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4189 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4190 } |
|
4191 |
|
4192 //-------------------------------------------------- |
|
4193 |
|
4194 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::get_parameter_data( |
|
4195 const eap_tlv_header_c * const settings_header, |
|
4196 eap_method_settings_c * const internal_settings) |
|
4197 { |
|
4198 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4199 |
|
4200 EAP_TRACE_DEBUG( |
|
4201 m_am_tools, |
|
4202 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4203 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s\n"), |
|
4204 settings_header->get_type(), |
|
4205 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4206 |
|
4207 EAP_TRACE_DATA_DEBUG( |
|
4208 m_am_tools, |
|
4209 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4210 (EAPL("get_parameter_data(eap_method_settings_c *)"), |
|
4211 settings_header->get_header_buffer(settings_header->get_header_buffer_length()), |
|
4212 settings_header->get_header_buffer_length())); |
|
4213 |
|
4214 if (static_cast<eap_tlv_message_type_e>(settings_header->get_type()) |
|
4215 != eap_tlv_message_type_eap_method_settings) |
|
4216 { |
|
4217 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4218 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
4219 } |
|
4220 |
|
4221 eap_process_tlv_message_data_c settings_data(m_am_tools); |
|
4222 |
|
4223 if (settings_data.get_is_valid() == false) |
|
4224 { |
|
4225 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4226 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
4227 } |
|
4228 |
|
4229 eap_status_e status = settings_data.set_message_data( |
|
4230 settings_header->get_value_length(), |
|
4231 settings_header->get_value(settings_header->get_value_length())); |
|
4232 |
|
4233 if (status != eap_status_ok) |
|
4234 { |
|
4235 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4236 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4237 } |
|
4238 |
|
4239 eap_array_c<eap_tlv_header_c> settings_members(m_am_tools); |
|
4240 |
|
4241 status = settings_data.parse_message_data(&settings_members); |
|
4242 |
|
4243 if (status != eap_status_ok) |
|
4244 { |
|
4245 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4246 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4247 } |
|
4248 |
|
4249 u32_t member_index(0ul); |
|
4250 |
|
4251 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
4252 |
|
4253 EAP_TRACE_DEBUG( |
|
4254 m_am_tools, |
|
4255 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4256 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_completion_status\n"), |
|
4257 settings_header->get_type(), |
|
4258 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4259 |
|
4260 status = read_parameter_data( |
|
4261 &settings_members, |
|
4262 member_index, |
|
4263 eap_tlv_message_type_eap_status, |
|
4264 &(internal_settings->m_completion_status)); |
|
4265 if (status != eap_status_ok) |
|
4266 { |
|
4267 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4268 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4269 } |
|
4270 |
|
4271 ++member_index; |
|
4272 |
|
4273 EAP_TRACE_DEBUG( |
|
4274 m_am_tools, |
|
4275 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4276 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_EAPType\n"), |
|
4277 settings_header->get_type(), |
|
4278 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4279 |
|
4280 status = read_parameter_data( |
|
4281 &settings_members, |
|
4282 member_index, |
|
4283 &(internal_settings->m_EAPType)); |
|
4284 if (status != eap_status_ok) |
|
4285 { |
|
4286 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4287 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4288 } |
|
4289 |
|
4290 ++member_index; |
|
4291 |
|
4292 EAP_TRACE_DEBUG( |
|
4293 m_am_tools, |
|
4294 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4295 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_IndexType\n"), |
|
4296 settings_header->get_type(), |
|
4297 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4298 |
|
4299 status = read_parameter_data( |
|
4300 &settings_members, |
|
4301 member_index, |
|
4302 &(internal_settings->m_IndexType)); |
|
4303 if (status != eap_status_ok) |
|
4304 { |
|
4305 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4306 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4307 } |
|
4308 |
|
4309 ++member_index; |
|
4310 |
|
4311 EAP_TRACE_DEBUG( |
|
4312 m_am_tools, |
|
4313 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4314 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_Index\n"), |
|
4315 settings_header->get_type(), |
|
4316 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4317 |
|
4318 status = read_parameter_data( |
|
4319 &settings_members, |
|
4320 member_index, |
|
4321 &(internal_settings->m_Index)); |
|
4322 if (status != eap_status_ok) |
|
4323 { |
|
4324 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4325 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4326 } |
|
4327 |
|
4328 ++member_index; |
|
4329 |
|
4330 { |
|
4331 EAP_TRACE_DEBUG( |
|
4332 m_am_tools, |
|
4333 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4334 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_UseAutomaticCACertificatePresent\n"), |
|
4335 settings_header->get_type(), |
|
4336 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4337 |
|
4338 // Use automatic CA certificate. |
|
4339 status = read_parameter_data( |
|
4340 &settings_members, |
|
4341 member_index, |
|
4342 &(internal_settings->m_UseAutomaticCACertificatePresent)); |
|
4343 if (status != eap_status_ok) |
|
4344 { |
|
4345 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4346 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4347 } |
|
4348 |
|
4349 if (internal_settings->m_UseAutomaticCACertificatePresent == true) |
|
4350 { |
|
4351 ++member_index; |
|
4352 |
|
4353 EAP_TRACE_DEBUG( |
|
4354 m_am_tools, |
|
4355 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4356 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_UseAutomaticCACertificate\n"), |
|
4357 settings_header->get_type(), |
|
4358 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4359 |
|
4360 status = read_parameter_data( |
|
4361 &settings_members, |
|
4362 member_index, |
|
4363 &(internal_settings->m_UseAutomaticCACertificate)); |
|
4364 if (status != eap_status_ok) |
|
4365 { |
|
4366 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4367 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4368 } |
|
4369 } |
|
4370 } |
|
4371 |
|
4372 ++member_index; |
|
4373 |
|
4374 { |
|
4375 EAP_TRACE_DEBUG( |
|
4376 m_am_tools, |
|
4377 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4378 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_UseAutomaticUsernamePresent\n"), |
|
4379 settings_header->get_type(), |
|
4380 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4381 |
|
4382 // Use automatic username. |
|
4383 status = read_parameter_data( |
|
4384 &settings_members, |
|
4385 member_index, |
|
4386 &(internal_settings->m_UseAutomaticUsernamePresent)); |
|
4387 if (status != eap_status_ok) |
|
4388 { |
|
4389 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4390 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4391 } |
|
4392 |
|
4393 if (internal_settings->m_UseAutomaticUsernamePresent == true) |
|
4394 { |
|
4395 ++member_index; |
|
4396 |
|
4397 EAP_TRACE_DEBUG( |
|
4398 m_am_tools, |
|
4399 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4400 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_UseAutomaticUsername\n"), |
|
4401 settings_header->get_type(), |
|
4402 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4403 |
|
4404 status = read_parameter_data( |
|
4405 &settings_members, |
|
4406 member_index, |
|
4407 &(internal_settings->m_UseAutomaticUsername)); |
|
4408 if (status != eap_status_ok) |
|
4409 { |
|
4410 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4411 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4412 } |
|
4413 } |
|
4414 } |
|
4415 |
|
4416 ++member_index; |
|
4417 |
|
4418 { |
|
4419 EAP_TRACE_DEBUG( |
|
4420 m_am_tools, |
|
4421 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4422 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_UseAutomaticRealmPresent\n"), |
|
4423 settings_header->get_type(), |
|
4424 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4425 |
|
4426 // Use automatic username. |
|
4427 status = read_parameter_data( |
|
4428 &settings_members, |
|
4429 member_index, |
|
4430 &(internal_settings->m_UseAutomaticRealmPresent)); |
|
4431 if (status != eap_status_ok) |
|
4432 { |
|
4433 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4434 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4435 } |
|
4436 |
|
4437 if (internal_settings->m_UseAutomaticRealmPresent == true) |
|
4438 { |
|
4439 ++member_index; |
|
4440 |
|
4441 EAP_TRACE_DEBUG( |
|
4442 m_am_tools, |
|
4443 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4444 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_UseAutomaticRealm\n"), |
|
4445 settings_header->get_type(), |
|
4446 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4447 |
|
4448 status = read_parameter_data( |
|
4449 &settings_members, |
|
4450 member_index, |
|
4451 &(internal_settings->m_UseAutomaticRealm)); |
|
4452 if (status != eap_status_ok) |
|
4453 { |
|
4454 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4455 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4456 } |
|
4457 } |
|
4458 } |
|
4459 |
|
4460 ++member_index; |
|
4461 |
|
4462 { |
|
4463 EAP_TRACE_DEBUG( |
|
4464 m_am_tools, |
|
4465 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4466 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_UsernamePresent\n"), |
|
4467 settings_header->get_type(), |
|
4468 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4469 |
|
4470 // Username in ASCII format |
|
4471 status = read_parameter_data( |
|
4472 &settings_members, |
|
4473 member_index, |
|
4474 &(internal_settings->m_UsernamePresent)); |
|
4475 if (status != eap_status_ok) |
|
4476 { |
|
4477 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4478 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4479 } |
|
4480 |
|
4481 if (internal_settings->m_UsernamePresent == true) |
|
4482 { |
|
4483 ++member_index; |
|
4484 |
|
4485 EAP_TRACE_DEBUG( |
|
4486 m_am_tools, |
|
4487 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4488 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_Username_fix\n"), |
|
4489 settings_header->get_type(), |
|
4490 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4491 |
|
4492 status = read_parameter_data( |
|
4493 &settings_members, |
|
4494 member_index, |
|
4495 &(internal_settings->m_Username_fix)); |
|
4496 if (status != eap_status_ok) |
|
4497 { |
|
4498 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4499 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4500 } |
|
4501 } |
|
4502 } |
|
4503 |
|
4504 ++member_index; |
|
4505 |
|
4506 { |
|
4507 EAP_TRACE_DEBUG( |
|
4508 m_am_tools, |
|
4509 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4510 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_PasswordExistPresent\n"), |
|
4511 settings_header->get_type(), |
|
4512 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4513 |
|
4514 // Password existence |
|
4515 status = read_parameter_data( |
|
4516 &settings_members, |
|
4517 member_index, |
|
4518 &(internal_settings->m_PasswordExistPresent)); |
|
4519 if (status != eap_status_ok) |
|
4520 { |
|
4521 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4522 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4523 } |
|
4524 |
|
4525 if (internal_settings->m_PasswordExistPresent == true) |
|
4526 { |
|
4527 ++member_index; |
|
4528 |
|
4529 EAP_TRACE_DEBUG( |
|
4530 m_am_tools, |
|
4531 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4532 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_PasswordExist\n"), |
|
4533 settings_header->get_type(), |
|
4534 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4535 |
|
4536 status = read_parameter_data( |
|
4537 &settings_members, |
|
4538 member_index, |
|
4539 &(internal_settings->m_PasswordExist)); |
|
4540 if (status != eap_status_ok) |
|
4541 { |
|
4542 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4543 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4544 } |
|
4545 } |
|
4546 } |
|
4547 |
|
4548 ++member_index; |
|
4549 |
|
4550 { |
|
4551 EAP_TRACE_DEBUG( |
|
4552 m_am_tools, |
|
4553 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4554 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_PasswordPresent\n"), |
|
4555 settings_header->get_type(), |
|
4556 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4557 |
|
4558 // Password in ASCII format |
|
4559 status = read_parameter_data( |
|
4560 &settings_members, |
|
4561 member_index, |
|
4562 &(internal_settings->m_PasswordPresent)); |
|
4563 if (status != eap_status_ok) |
|
4564 { |
|
4565 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4566 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4567 } |
|
4568 |
|
4569 if (internal_settings->m_PasswordPresent == true) |
|
4570 { |
|
4571 ++member_index; |
|
4572 |
|
4573 EAP_TRACE_DEBUG( |
|
4574 m_am_tools, |
|
4575 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4576 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_Password\n"), |
|
4577 settings_header->get_type(), |
|
4578 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4579 |
|
4580 status = read_parameter_data( |
|
4581 &settings_members, |
|
4582 member_index, |
|
4583 &(internal_settings->m_Password)); |
|
4584 if (status != eap_status_ok) |
|
4585 { |
|
4586 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4587 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4588 } |
|
4589 } |
|
4590 } |
|
4591 |
|
4592 ++member_index; |
|
4593 |
|
4594 { |
|
4595 EAP_TRACE_DEBUG( |
|
4596 m_am_tools, |
|
4597 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4598 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_RealmPresent\n"), |
|
4599 settings_header->get_type(), |
|
4600 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4601 |
|
4602 // Realm in ASCII format |
|
4603 status = read_parameter_data( |
|
4604 &settings_members, |
|
4605 member_index, |
|
4606 &(internal_settings->m_RealmPresent)); |
|
4607 if (status != eap_status_ok) |
|
4608 { |
|
4609 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4610 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4611 } |
|
4612 |
|
4613 if (internal_settings->m_RealmPresent == true) |
|
4614 { |
|
4615 ++member_index; |
|
4616 |
|
4617 EAP_TRACE_DEBUG( |
|
4618 m_am_tools, |
|
4619 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4620 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_Realm\n"), |
|
4621 settings_header->get_type(), |
|
4622 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4623 |
|
4624 status = read_parameter_data( |
|
4625 &settings_members, |
|
4626 member_index, |
|
4627 &(internal_settings->m_Realm)); |
|
4628 if (status != eap_status_ok) |
|
4629 { |
|
4630 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4631 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4632 } |
|
4633 } |
|
4634 } |
|
4635 |
|
4636 ++member_index; |
|
4637 |
|
4638 { |
|
4639 EAP_TRACE_DEBUG( |
|
4640 m_am_tools, |
|
4641 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4642 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_UsePseudonymsPresent\n"), |
|
4643 settings_header->get_type(), |
|
4644 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4645 |
|
4646 // Use pseudonym identities in EAP-SIM/AKA |
|
4647 status = read_parameter_data( |
|
4648 &settings_members, |
|
4649 member_index, |
|
4650 &(internal_settings->m_UsePseudonymsPresent)); |
|
4651 if (status != eap_status_ok) |
|
4652 { |
|
4653 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4654 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4655 } |
|
4656 |
|
4657 if (internal_settings->m_UsePseudonymsPresent == true) |
|
4658 { |
|
4659 ++member_index; |
|
4660 |
|
4661 EAP_TRACE_DEBUG( |
|
4662 m_am_tools, |
|
4663 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4664 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_UsePseudonyms\n"), |
|
4665 settings_header->get_type(), |
|
4666 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4667 |
|
4668 status = read_parameter_data( |
|
4669 &settings_members, |
|
4670 member_index, |
|
4671 &(internal_settings->m_UsePseudonyms)); |
|
4672 if (status != eap_status_ok) |
|
4673 { |
|
4674 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4675 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4676 } |
|
4677 } |
|
4678 } |
|
4679 |
|
4680 ++member_index; |
|
4681 |
|
4682 { |
|
4683 EAP_TRACE_DEBUG( |
|
4684 m_am_tools, |
|
4685 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4686 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_VerifyServerRealmPresent\n"), |
|
4687 settings_header->get_type(), |
|
4688 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4689 |
|
4690 // Whether EAP-TLS/TTLS/PEAP should verify server realm |
|
4691 status = read_parameter_data( |
|
4692 &settings_members, |
|
4693 member_index, |
|
4694 &(internal_settings->m_VerifyServerRealmPresent)); |
|
4695 if (status != eap_status_ok) |
|
4696 { |
|
4697 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4698 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4699 } |
|
4700 |
|
4701 if (internal_settings->m_VerifyServerRealmPresent == true) |
|
4702 { |
|
4703 ++member_index; |
|
4704 |
|
4705 EAP_TRACE_DEBUG( |
|
4706 m_am_tools, |
|
4707 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4708 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_VerifyServerRealm\n"), |
|
4709 settings_header->get_type(), |
|
4710 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4711 |
|
4712 status = read_parameter_data( |
|
4713 &settings_members, |
|
4714 member_index, |
|
4715 &(internal_settings->m_VerifyServerRealm)); |
|
4716 if (status != eap_status_ok) |
|
4717 { |
|
4718 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4719 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4720 } |
|
4721 } |
|
4722 } |
|
4723 |
|
4724 ++member_index; |
|
4725 |
|
4726 { |
|
4727 EAP_TRACE_DEBUG( |
|
4728 m_am_tools, |
|
4729 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4730 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_RequireClientAuthenticationPresent\n"), |
|
4731 settings_header->get_type(), |
|
4732 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4733 |
|
4734 // Whether EAP-TLS/TTLS/PEAP should require client authentication |
|
4735 status = read_parameter_data( |
|
4736 &settings_members, |
|
4737 member_index, |
|
4738 &(internal_settings->m_RequireClientAuthenticationPresent)); |
|
4739 if (status != eap_status_ok) |
|
4740 { |
|
4741 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4742 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4743 } |
|
4744 |
|
4745 if (internal_settings->m_RequireClientAuthenticationPresent == true) |
|
4746 { |
|
4747 ++member_index; |
|
4748 |
|
4749 EAP_TRACE_DEBUG( |
|
4750 m_am_tools, |
|
4751 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4752 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_RequireClientAuthentication\n"), |
|
4753 settings_header->get_type(), |
|
4754 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4755 |
|
4756 status = read_parameter_data( |
|
4757 &settings_members, |
|
4758 member_index, |
|
4759 &(internal_settings->m_RequireClientAuthentication)); |
|
4760 if (status != eap_status_ok) |
|
4761 { |
|
4762 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4763 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4764 } |
|
4765 } |
|
4766 } |
|
4767 |
|
4768 ++member_index; |
|
4769 |
|
4770 { |
|
4771 EAP_TRACE_DEBUG( |
|
4772 m_am_tools, |
|
4773 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4774 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_SessionValidityTimePresent\n"), |
|
4775 settings_header->get_type(), |
|
4776 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4777 |
|
4778 // General session validity time (in minutes) |
|
4779 status = read_parameter_data( |
|
4780 &settings_members, |
|
4781 member_index, |
|
4782 &(internal_settings->m_SessionValidityTimePresent)); |
|
4783 if (status != eap_status_ok) |
|
4784 { |
|
4785 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4786 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4787 } |
|
4788 |
|
4789 if (internal_settings->m_SessionValidityTimePresent == true) |
|
4790 { |
|
4791 ++member_index; |
|
4792 |
|
4793 EAP_TRACE_DEBUG( |
|
4794 m_am_tools, |
|
4795 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4796 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_SessionValidityTime\n"), |
|
4797 settings_header->get_type(), |
|
4798 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4799 |
|
4800 status = read_parameter_data( |
|
4801 &settings_members, |
|
4802 member_index, |
|
4803 &(internal_settings->m_SessionValidityTime)); |
|
4804 if (status != eap_status_ok) |
|
4805 { |
|
4806 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4807 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4808 } |
|
4809 } |
|
4810 } |
|
4811 |
|
4812 ++member_index; |
|
4813 |
|
4814 { |
|
4815 EAP_TRACE_DEBUG( |
|
4816 m_am_tools, |
|
4817 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4818 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_CipherSuitesPresent\n"), |
|
4819 settings_header->get_type(), |
|
4820 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4821 |
|
4822 // An array of allowed cipher suites for EAP-TLS/TTLS/PEAP. |
|
4823 // Refer to RFC2246 chapter A.5 for the values. |
|
4824 status = read_parameter_data( |
|
4825 &settings_members, |
|
4826 member_index, |
|
4827 &(internal_settings->m_CipherSuitesPresent)); |
|
4828 if (status != eap_status_ok) |
|
4829 { |
|
4830 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4831 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4832 } |
|
4833 |
|
4834 if (internal_settings->m_CipherSuitesPresent == true) |
|
4835 { |
|
4836 ++member_index; |
|
4837 |
|
4838 EAP_TRACE_DEBUG( |
|
4839 m_am_tools, |
|
4840 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4841 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_CipherSuites\n"), |
|
4842 settings_header->get_type(), |
|
4843 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4844 |
|
4845 status = read_parameter_data( |
|
4846 &settings_members, |
|
4847 member_index, |
|
4848 &(internal_settings->m_CipherSuites)); |
|
4849 if (status != eap_status_ok) |
|
4850 { |
|
4851 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4852 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4853 } |
|
4854 } |
|
4855 } |
|
4856 |
|
4857 ++member_index; |
|
4858 |
|
4859 { |
|
4860 EAP_TRACE_DEBUG( |
|
4861 m_am_tools, |
|
4862 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4863 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_PEAPVersionsPresent\n"), |
|
4864 settings_header->get_type(), |
|
4865 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4866 |
|
4867 // Which EAP-PEAP versions are allowed |
|
4868 status = read_parameter_data( |
|
4869 &settings_members, |
|
4870 member_index, |
|
4871 &(internal_settings->m_PEAPVersionsPresent)); |
|
4872 if (status != eap_status_ok) |
|
4873 { |
|
4874 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4875 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4876 } |
|
4877 |
|
4878 if (internal_settings->m_PEAPVersionsPresent == true) |
|
4879 { |
|
4880 ++member_index; |
|
4881 |
|
4882 EAP_TRACE_DEBUG( |
|
4883 m_am_tools, |
|
4884 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4885 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_PEAPv0Allowed\n"), |
|
4886 settings_header->get_type(), |
|
4887 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4888 |
|
4889 status = read_parameter_data( |
|
4890 &settings_members, |
|
4891 member_index, |
|
4892 &(internal_settings->m_PEAPv0Allowed)); |
|
4893 if (status != eap_status_ok) |
|
4894 { |
|
4895 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4896 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4897 } |
|
4898 |
|
4899 ++member_index; |
|
4900 |
|
4901 EAP_TRACE_DEBUG( |
|
4902 m_am_tools, |
|
4903 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4904 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_PEAPv1Allowed\n"), |
|
4905 settings_header->get_type(), |
|
4906 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4907 |
|
4908 status = read_parameter_data( |
|
4909 &settings_members, |
|
4910 member_index, |
|
4911 &(internal_settings->m_PEAPv1Allowed)); |
|
4912 if (status != eap_status_ok) |
|
4913 { |
|
4914 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4915 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4916 } |
|
4917 |
|
4918 ++member_index; |
|
4919 |
|
4920 EAP_TRACE_DEBUG( |
|
4921 m_am_tools, |
|
4922 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4923 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_PEAPv2Allowed\n"), |
|
4924 settings_header->get_type(), |
|
4925 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4926 |
|
4927 status = read_parameter_data( |
|
4928 &settings_members, |
|
4929 member_index, |
|
4930 &(internal_settings->m_PEAPv2Allowed)); |
|
4931 if (status != eap_status_ok) |
|
4932 { |
|
4933 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4934 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4935 } |
|
4936 } |
|
4937 } |
|
4938 |
|
4939 ++member_index; |
|
4940 |
|
4941 { |
|
4942 EAP_TRACE_DEBUG( |
|
4943 m_am_tools, |
|
4944 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4945 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_CertificatesPresent\n"), |
|
4946 settings_header->get_type(), |
|
4947 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4948 |
|
4949 // Array listing the allowed certificates for EAP-TLS/TTLS/PEAP. |
|
4950 // Subject key ID and Certificate type are the only mandatory certificate |
|
4951 // details needed at the moment. |
|
4952 status = read_parameter_data( |
|
4953 &settings_members, |
|
4954 member_index, |
|
4955 &(internal_settings->m_CertificatesPresent)); |
|
4956 if (status != eap_status_ok) |
|
4957 { |
|
4958 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4959 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4960 } |
|
4961 |
|
4962 if (internal_settings->m_CertificatesPresent == true) |
|
4963 { |
|
4964 ++member_index; |
|
4965 |
|
4966 EAP_TRACE_DEBUG( |
|
4967 m_am_tools, |
|
4968 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4969 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_Certificates\n"), |
|
4970 settings_header->get_type(), |
|
4971 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4972 |
|
4973 status = read_parameter_data( |
|
4974 &settings_members, |
|
4975 member_index, |
|
4976 &(internal_settings->m_Certificates)); |
|
4977 if (status != eap_status_ok) |
|
4978 { |
|
4979 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
4980 return EAP_STATUS_RETURN(m_am_tools, status); |
|
4981 } |
|
4982 } |
|
4983 } |
|
4984 |
|
4985 ++member_index; |
|
4986 |
|
4987 { |
|
4988 EAP_TRACE_DEBUG( |
|
4989 m_am_tools, |
|
4990 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
4991 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_EnabledEncapsulatedEAPTypesPresent\n"), |
|
4992 settings_header->get_type(), |
|
4993 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
4994 |
|
4995 // Array listing the encapsulated EAP types (in priority order). |
|
4996 // Use EAP type values from eap_type_value_e. |
|
4997 status = read_parameter_data( |
|
4998 &settings_members, |
|
4999 member_index, |
|
5000 &(internal_settings->m_EnabledEncapsulatedEAPTypesPresent)); |
|
5001 if (status != eap_status_ok) |
|
5002 { |
|
5003 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5004 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5005 } |
|
5006 |
|
5007 if (internal_settings->m_EnabledEncapsulatedEAPTypesPresent == true) |
|
5008 { |
|
5009 ++member_index; |
|
5010 |
|
5011 EAP_TRACE_DEBUG( |
|
5012 m_am_tools, |
|
5013 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5014 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_EnabledEncapsulatedEAPTypes\n"), |
|
5015 settings_header->get_type(), |
|
5016 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
5017 |
|
5018 status = read_parameter_data( |
|
5019 &settings_members, |
|
5020 member_index, |
|
5021 &(internal_settings->m_EnabledEncapsulatedEAPTypes)); |
|
5022 if (status != eap_status_ok) |
|
5023 { |
|
5024 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5025 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5026 } |
|
5027 } |
|
5028 } |
|
5029 |
|
5030 ++member_index; |
|
5031 |
|
5032 { |
|
5033 EAP_TRACE_DEBUG( |
|
5034 m_am_tools, |
|
5035 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5036 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_DisabledEncapsulatedEAPTypesPresent\n"), |
|
5037 settings_header->get_type(), |
|
5038 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
5039 |
|
5040 // Array listing the encapsulated EAP types (in priority order). |
|
5041 // Use EAP type values from eap_type_value_e. |
|
5042 status = read_parameter_data( |
|
5043 &settings_members, |
|
5044 member_index, |
|
5045 &(internal_settings->m_DisabledEncapsulatedEAPTypesPresent)); |
|
5046 if (status != eap_status_ok) |
|
5047 { |
|
5048 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5049 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5050 } |
|
5051 |
|
5052 if (internal_settings->m_DisabledEncapsulatedEAPTypesPresent == true) |
|
5053 { |
|
5054 ++member_index; |
|
5055 |
|
5056 EAP_TRACE_DEBUG( |
|
5057 m_am_tools, |
|
5058 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5059 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_DisabledEncapsulatedEAPTypes\n"), |
|
5060 settings_header->get_type(), |
|
5061 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
5062 |
|
5063 status = read_parameter_data( |
|
5064 &settings_members, |
|
5065 member_index, |
|
5066 &(internal_settings->m_DisabledEncapsulatedEAPTypes)); |
|
5067 if (status != eap_status_ok) |
|
5068 { |
|
5069 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5070 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5071 } |
|
5072 } |
|
5073 } |
|
5074 |
|
5075 ++member_index; |
|
5076 |
|
5077 { |
|
5078 EAP_TRACE_DEBUG( |
|
5079 m_am_tools, |
|
5080 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5081 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_AuthProvModeAllowedPresent\n"), |
|
5082 settings_header->get_type(), |
|
5083 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
5084 |
|
5085 // Whether Authenticated provisioning mode allowed or not in EAP-FAST. |
|
5086 status = read_parameter_data( |
|
5087 &settings_members, |
|
5088 member_index, |
|
5089 &(internal_settings->m_AuthProvModeAllowedPresent)); |
|
5090 if (status != eap_status_ok) |
|
5091 { |
|
5092 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5093 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5094 } |
|
5095 |
|
5096 if (internal_settings->m_AuthProvModeAllowedPresent == true) |
|
5097 { |
|
5098 ++member_index; |
|
5099 |
|
5100 EAP_TRACE_DEBUG( |
|
5101 m_am_tools, |
|
5102 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5103 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_AuthProvModeAllowed\n"), |
|
5104 settings_header->get_type(), |
|
5105 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
5106 |
|
5107 status = read_parameter_data( |
|
5108 &settings_members, |
|
5109 member_index, |
|
5110 &(internal_settings->m_AuthProvModeAllowed)); |
|
5111 if (status != eap_status_ok) |
|
5112 { |
|
5113 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5114 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5115 } |
|
5116 } |
|
5117 } |
|
5118 |
|
5119 ++member_index; |
|
5120 |
|
5121 { |
|
5122 EAP_TRACE_DEBUG( |
|
5123 m_am_tools, |
|
5124 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5125 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_UnauthProvModeAllowedPresent\n"), |
|
5126 settings_header->get_type(), |
|
5127 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
5128 |
|
5129 // Whether Unauthenticated provisioning mode allowed or not in EAP-FAST. |
|
5130 status = read_parameter_data( |
|
5131 &settings_members, |
|
5132 member_index, |
|
5133 &(internal_settings->m_UnauthProvModeAllowedPresent)); |
|
5134 if (status != eap_status_ok) |
|
5135 { |
|
5136 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5137 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5138 } |
|
5139 |
|
5140 if (internal_settings->m_UnauthProvModeAllowedPresent == true) |
|
5141 { |
|
5142 ++member_index; |
|
5143 |
|
5144 EAP_TRACE_DEBUG( |
|
5145 m_am_tools, |
|
5146 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5147 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_UnauthProvModeAllowed\n"), |
|
5148 settings_header->get_type(), |
|
5149 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
5150 |
|
5151 status = read_parameter_data( |
|
5152 &settings_members, |
|
5153 member_index, |
|
5154 &(internal_settings->m_UnauthProvModeAllowed)); |
|
5155 if (status != eap_status_ok) |
|
5156 { |
|
5157 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5158 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5159 } |
|
5160 } |
|
5161 } |
|
5162 |
|
5163 ++member_index; |
|
5164 |
|
5165 { |
|
5166 EAP_TRACE_DEBUG( |
|
5167 m_am_tools, |
|
5168 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5169 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_PACGroupReferencePresent\n"), |
|
5170 settings_header->get_type(), |
|
5171 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
5172 |
|
5173 // PAC group reference in ASCII format for EAP-FAST. |
|
5174 status = read_parameter_data( |
|
5175 &settings_members, |
|
5176 member_index, |
|
5177 &(internal_settings->m_PACGroupReferencePresent)); |
|
5178 if (status != eap_status_ok) |
|
5179 { |
|
5180 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5181 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5182 } |
|
5183 |
|
5184 if (internal_settings->m_PACGroupReferencePresent == true) |
|
5185 { |
|
5186 ++member_index; |
|
5187 |
|
5188 EAP_TRACE_DEBUG( |
|
5189 m_am_tools, |
|
5190 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5191 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_PACGroupReference\n"), |
|
5192 settings_header->get_type(), |
|
5193 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
5194 |
|
5195 status = read_parameter_data( |
|
5196 &settings_members, |
|
5197 member_index, |
|
5198 &(internal_settings->m_PACGroupReference)); |
|
5199 if (status != eap_status_ok) |
|
5200 { |
|
5201 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5202 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5203 } |
|
5204 } |
|
5205 } |
|
5206 |
|
5207 ++member_index; |
|
5208 |
|
5209 { |
|
5210 EAP_TRACE_DEBUG( |
|
5211 m_am_tools, |
|
5212 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5213 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_WarnADHPNoPACPresent\n"), |
|
5214 settings_header->get_type(), |
|
5215 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
5216 |
|
5217 // Whether to Warn (or Prompt) for ADHP (Authenticated Diffie-Hellman Protocol) |
|
5218 // auto-provisioning when there is no PAC at all. EAP-FAST specific. |
|
5219 status = read_parameter_data( |
|
5220 &settings_members, |
|
5221 member_index, |
|
5222 &(internal_settings->m_WarnADHPNoPACPresent)); |
|
5223 if (status != eap_status_ok) |
|
5224 { |
|
5225 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5226 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5227 } |
|
5228 |
|
5229 if (internal_settings->m_WarnADHPNoPACPresent == true) |
|
5230 { |
|
5231 ++member_index; |
|
5232 |
|
5233 EAP_TRACE_DEBUG( |
|
5234 m_am_tools, |
|
5235 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5236 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_WarnADHPNoPAC\n"), |
|
5237 settings_header->get_type(), |
|
5238 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
5239 |
|
5240 status = read_parameter_data( |
|
5241 &settings_members, |
|
5242 member_index, |
|
5243 &(internal_settings->m_WarnADHPNoPAC)); |
|
5244 if (status != eap_status_ok) |
|
5245 { |
|
5246 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5247 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5248 } |
|
5249 } |
|
5250 } |
|
5251 |
|
5252 ++member_index; |
|
5253 |
|
5254 { |
|
5255 EAP_TRACE_DEBUG( |
|
5256 m_am_tools, |
|
5257 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5258 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_WarnADHPNoMatchingPACPresent\n"), |
|
5259 settings_header->get_type(), |
|
5260 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
5261 |
|
5262 // Whether to Warn (or Prompt) for ADHP auto-provisioning when |
|
5263 // there is no PAC that matches the A-ID sent by server. EAP-FAST specific. |
|
5264 status = read_parameter_data( |
|
5265 &settings_members, |
|
5266 member_index, |
|
5267 &(internal_settings->m_WarnADHPNoMatchingPACPresent)); |
|
5268 if (status != eap_status_ok) |
|
5269 { |
|
5270 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5271 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5272 } |
|
5273 |
|
5274 if (internal_settings->m_WarnADHPNoMatchingPACPresent == true) |
|
5275 { |
|
5276 ++member_index; |
|
5277 |
|
5278 EAP_TRACE_DEBUG( |
|
5279 m_am_tools, |
|
5280 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5281 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_WarnADHPNoMatchingPAC\n"), |
|
5282 settings_header->get_type(), |
|
5283 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
5284 |
|
5285 status = read_parameter_data( |
|
5286 &settings_members, |
|
5287 member_index, |
|
5288 &(internal_settings->m_WarnADHPNoMatchingPAC)); |
|
5289 if (status != eap_status_ok) |
|
5290 { |
|
5291 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5292 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5293 } |
|
5294 } |
|
5295 } |
|
5296 |
|
5297 ++member_index; |
|
5298 |
|
5299 { |
|
5300 EAP_TRACE_DEBUG( |
|
5301 m_am_tools, |
|
5302 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5303 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_WarnNotDefaultServerPresent\n"), |
|
5304 settings_header->get_type(), |
|
5305 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
5306 |
|
5307 // Whether to Warn (or Prompt) when client encouters a server that has provisioned |
|
5308 // the client with a PAC before but is not currently selected as the default server. |
|
5309 // EAP-FAST specific. |
|
5310 status = read_parameter_data( |
|
5311 &settings_members, |
|
5312 member_index, |
|
5313 &(internal_settings->m_WarnNotDefaultServerPresent)); |
|
5314 if (status != eap_status_ok) |
|
5315 { |
|
5316 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5317 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5318 } |
|
5319 |
|
5320 if (internal_settings->m_WarnNotDefaultServerPresent == true) |
|
5321 { |
|
5322 ++member_index; |
|
5323 |
|
5324 EAP_TRACE_DEBUG( |
|
5325 m_am_tools, |
|
5326 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5327 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_WarnNotDefaultServer\n"), |
|
5328 settings_header->get_type(), |
|
5329 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
5330 |
|
5331 status = read_parameter_data( |
|
5332 &settings_members, |
|
5333 member_index, |
|
5334 &(internal_settings->m_WarnNotDefaultServer)); |
|
5335 if (status != eap_status_ok) |
|
5336 { |
|
5337 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5338 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5339 } |
|
5340 } |
|
5341 } |
|
5342 |
|
5343 ++member_index; |
|
5344 |
|
5345 { |
|
5346 EAP_TRACE_DEBUG( |
|
5347 m_am_tools, |
|
5348 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5349 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_SelectedEAPTypesPresent\n"), |
|
5350 settings_header->get_type(), |
|
5351 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
5352 |
|
5353 // Array listing the active and disabled EAP types (in priority order). |
|
5354 // Use EAP type values from eap_type_value_e. |
|
5355 status = read_parameter_data( |
|
5356 &settings_members, |
|
5357 member_index, |
|
5358 &(internal_settings->m_SelectedEAPTypesPresent)); |
|
5359 if (status != eap_status_ok) |
|
5360 { |
|
5361 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5362 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5363 } |
|
5364 |
|
5365 if (internal_settings->m_SelectedEAPTypesPresent == true) |
|
5366 { |
|
5367 ++member_index; |
|
5368 |
|
5369 EAP_TRACE_DEBUG( |
|
5370 m_am_tools, |
|
5371 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5372 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_active_eap_methods\n"), |
|
5373 settings_header->get_type(), |
|
5374 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
5375 |
|
5376 status = read_parameter_data( |
|
5377 &settings_members, |
|
5378 member_index, |
|
5379 &(internal_settings->m_active_eap_methods)); |
|
5380 if (status != eap_status_ok) |
|
5381 { |
|
5382 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5383 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5384 } |
|
5385 |
|
5386 ++member_index; |
|
5387 |
|
5388 EAP_TRACE_DEBUG( |
|
5389 m_am_tools, |
|
5390 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5391 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_disabled_eap_methods\n"), |
|
5392 settings_header->get_type(), |
|
5393 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
5394 |
|
5395 status = read_parameter_data( |
|
5396 &settings_members, |
|
5397 member_index, |
|
5398 &(internal_settings->m_disabled_eap_methods)); |
|
5399 if (status != eap_status_ok) |
|
5400 { |
|
5401 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5402 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5403 } |
|
5404 } |
|
5405 } |
|
5406 |
|
5407 ++member_index; |
|
5408 |
|
5409 { |
|
5410 EAP_TRACE_DEBUG( |
|
5411 m_am_tools, |
|
5412 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5413 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_TunnelingTypePresent\n"), |
|
5414 settings_header->get_type(), |
|
5415 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
5416 |
|
5417 status = read_parameter_data( |
|
5418 &settings_members, |
|
5419 member_index, |
|
5420 &(internal_settings->m_TunnelingTypePresent)); |
|
5421 if (status != eap_status_ok) |
|
5422 { |
|
5423 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5424 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5425 } |
|
5426 |
|
5427 if (internal_settings->m_TunnelingTypePresent == true) |
|
5428 { |
|
5429 ++member_index; |
|
5430 |
|
5431 EAP_TRACE_DEBUG( |
|
5432 m_am_tools, |
|
5433 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5434 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_TunnelingType\n"), |
|
5435 settings_header->get_type(), |
|
5436 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
5437 |
|
5438 status = read_parameter_data( |
|
5439 &settings_members, |
|
5440 member_index, |
|
5441 &(internal_settings->m_TunnelingType)); |
|
5442 if (status != eap_status_ok) |
|
5443 { |
|
5444 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5445 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5446 } |
|
5447 } |
|
5448 } |
|
5449 |
|
5450 ++member_index; |
|
5451 |
|
5452 { |
|
5453 EAP_TRACE_DEBUG( |
|
5454 m_am_tools, |
|
5455 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5456 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_DestinationIndexAndTypePresent\n"), |
|
5457 settings_header->get_type(), |
|
5458 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
5459 |
|
5460 status = read_parameter_data( |
|
5461 &settings_members, |
|
5462 member_index, |
|
5463 &(internal_settings->m_DestinationIndexAndTypePresent)); |
|
5464 if (status != eap_status_ok) |
|
5465 { |
|
5466 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5467 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5468 } |
|
5469 |
|
5470 if (internal_settings->m_DestinationIndexAndTypePresent == true) |
|
5471 { |
|
5472 ++member_index; |
|
5473 |
|
5474 EAP_TRACE_DEBUG( |
|
5475 m_am_tools, |
|
5476 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5477 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_DestinationIndexType\n"), |
|
5478 settings_header->get_type(), |
|
5479 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
5480 |
|
5481 status = read_parameter_data( |
|
5482 &settings_members, |
|
5483 member_index, |
|
5484 &(internal_settings->m_DestinationIndexType)); |
|
5485 if (status != eap_status_ok) |
|
5486 { |
|
5487 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5488 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5489 } |
|
5490 |
|
5491 ++member_index; |
|
5492 |
|
5493 EAP_TRACE_DEBUG( |
|
5494 m_am_tools, |
|
5495 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5496 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_DestinationIndex\n"), |
|
5497 settings_header->get_type(), |
|
5498 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
5499 |
|
5500 status = read_parameter_data( |
|
5501 &settings_members, |
|
5502 member_index, |
|
5503 &(internal_settings->m_DestinationIndex)); |
|
5504 if (status != eap_status_ok) |
|
5505 { |
|
5506 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5507 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5508 } |
|
5509 } |
|
5510 } |
|
5511 |
|
5512 ++member_index; |
|
5513 |
|
5514 { |
|
5515 EAP_TRACE_DEBUG( |
|
5516 m_am_tools, |
|
5517 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5518 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_MethodInfoPresent\n"), |
|
5519 settings_header->get_type(), |
|
5520 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
5521 |
|
5522 status = read_parameter_data( |
|
5523 &settings_members, |
|
5524 member_index, |
|
5525 &(internal_settings->m_MethodInfoPresent)); |
|
5526 if (status != eap_status_ok) |
|
5527 { |
|
5528 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5529 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5530 } |
|
5531 |
|
5532 if (internal_settings->m_MethodInfoPresent == true) |
|
5533 { |
|
5534 ++member_index; |
|
5535 |
|
5536 EAP_TRACE_DEBUG( |
|
5537 m_am_tools, |
|
5538 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5539 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_KReleaseDate\n"), |
|
5540 settings_header->get_type(), |
|
5541 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
5542 |
|
5543 status = read_parameter_data( |
|
5544 &settings_members, |
|
5545 member_index, |
|
5546 &(internal_settings->m_KReleaseDate)); |
|
5547 if (status != eap_status_ok) |
|
5548 { |
|
5549 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5550 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5551 } |
|
5552 |
|
5553 ++member_index; |
|
5554 |
|
5555 EAP_TRACE_DEBUG( |
|
5556 m_am_tools, |
|
5557 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5558 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_KEapTypeVersion\n"), |
|
5559 settings_header->get_type(), |
|
5560 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
5561 |
|
5562 status = read_parameter_data( |
|
5563 &settings_members, |
|
5564 member_index, |
|
5565 &(internal_settings->m_KEapTypeVersion)); |
|
5566 if (status != eap_status_ok) |
|
5567 { |
|
5568 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5569 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5570 } |
|
5571 |
|
5572 ++member_index; |
|
5573 |
|
5574 EAP_TRACE_DEBUG( |
|
5575 m_am_tools, |
|
5576 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5577 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_KManufacturer\n"), |
|
5578 settings_header->get_type(), |
|
5579 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
5580 |
|
5581 status = read_parameter_data( |
|
5582 &settings_members, |
|
5583 member_index, |
|
5584 &(internal_settings->m_KManufacturer)); |
|
5585 if (status != eap_status_ok) |
|
5586 { |
|
5587 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5588 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5589 } |
|
5590 } |
|
5591 } |
|
5592 |
|
5593 ++member_index; |
|
5594 |
|
5595 { |
|
5596 EAP_TRACE_DEBUG( |
|
5597 m_am_tools, |
|
5598 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5599 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_ButtonIdPresent\n"), |
|
5600 settings_header->get_type(), |
|
5601 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
5602 |
|
5603 status = read_parameter_data( |
|
5604 &settings_members, |
|
5605 member_index, |
|
5606 &(internal_settings->m_ButtonIdPresent)); |
|
5607 if (status != eap_status_ok) |
|
5608 { |
|
5609 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5610 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5611 } |
|
5612 |
|
5613 if (internal_settings->m_ButtonIdPresent == true) |
|
5614 { |
|
5615 ++member_index; |
|
5616 |
|
5617 EAP_TRACE_DEBUG( |
|
5618 m_am_tools, |
|
5619 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5620 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_ButtonId\n"), |
|
5621 settings_header->get_type(), |
|
5622 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
5623 |
|
5624 status = read_parameter_data( |
|
5625 &settings_members, |
|
5626 member_index, |
|
5627 &(internal_settings->m_ButtonId)); |
|
5628 if (status != eap_status_ok) |
|
5629 { |
|
5630 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5631 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5632 } |
|
5633 } |
|
5634 } |
|
5635 |
|
5636 ++member_index; |
|
5637 |
|
5638 { |
|
5639 EAP_TRACE_DEBUG( |
|
5640 m_am_tools, |
|
5641 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5642 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_ShowPassWordPromptPresent\n"), |
|
5643 settings_header->get_type(), |
|
5644 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
5645 |
|
5646 status = read_parameter_data( |
|
5647 &settings_members, |
|
5648 member_index, |
|
5649 &(internal_settings->m_ShowPassWordPromptPresent)); |
|
5650 if (status != eap_status_ok) |
|
5651 { |
|
5652 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5653 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5654 } |
|
5655 |
|
5656 if (internal_settings->m_ShowPassWordPromptPresent == true) |
|
5657 { |
|
5658 ++member_index; |
|
5659 |
|
5660 EAP_TRACE_DEBUG( |
|
5661 m_am_tools, |
|
5662 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5663 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_ShowPassWordPrompt\n"), |
|
5664 settings_header->get_type(), |
|
5665 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
5666 |
|
5667 status = read_parameter_data( |
|
5668 &settings_members, |
|
5669 member_index, |
|
5670 &(internal_settings->m_ShowPassWordPrompt)); |
|
5671 if (status != eap_status_ok) |
|
5672 { |
|
5673 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5674 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5675 } |
|
5676 } |
|
5677 } |
|
5678 |
|
5679 ++member_index; |
|
5680 |
|
5681 { |
|
5682 EAP_TRACE_DEBUG( |
|
5683 m_am_tools, |
|
5684 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5685 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_UseIdentityPrivacyPresent\n"), |
|
5686 settings_header->get_type(), |
|
5687 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
5688 |
|
5689 status = read_parameter_data( |
|
5690 &settings_members, |
|
5691 member_index, |
|
5692 &(internal_settings->m_UseIdentityPrivacyPresent)); |
|
5693 if (status != eap_status_ok) |
|
5694 { |
|
5695 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5696 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5697 } |
|
5698 |
|
5699 if (internal_settings->m_UseIdentityPrivacyPresent == true) |
|
5700 { |
|
5701 ++member_index; |
|
5702 |
|
5703 EAP_TRACE_DEBUG( |
|
5704 m_am_tools, |
|
5705 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5706 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s, m_UseIdentityPrivacy\n"), |
|
5707 settings_header->get_type(), |
|
5708 get_type_string(static_cast<eap_tlv_message_type_e>(settings_header->get_type())))); |
|
5709 |
|
5710 status = read_parameter_data( |
|
5711 &settings_members, |
|
5712 member_index, |
|
5713 &(internal_settings->m_UseIdentityPrivacy)); |
|
5714 if (status != eap_status_ok) |
|
5715 { |
|
5716 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5717 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5718 } |
|
5719 } |
|
5720 } |
|
5721 |
|
5722 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5723 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5724 } |
|
5725 |
|
5726 //-------------------------------------------------- |
|
5727 |
|
5728 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::get_parameter_data( |
|
5729 const eap_tlv_header_c * const cert_entry_header, |
|
5730 eap_certificate_entry_c * const cert_entry) |
|
5731 { |
|
5732 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5733 |
|
5734 EAP_TRACE_DEBUG( |
|
5735 m_am_tools, |
|
5736 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5737 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s\n"), |
|
5738 cert_entry_header->get_type(), |
|
5739 get_type_string(static_cast<eap_tlv_message_type_e>(cert_entry_header->get_type())))); |
|
5740 |
|
5741 EAP_TRACE_DATA_DEBUG( |
|
5742 m_am_tools, |
|
5743 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
5744 (EAPL("get_parameter_data(eap_certificate_entry_c *)"), |
|
5745 cert_entry_header->get_header_buffer(cert_entry_header->get_header_buffer_length()), |
|
5746 cert_entry_header->get_header_buffer_length())); |
|
5747 |
|
5748 if (static_cast<eap_tlv_message_type_e>(cert_entry_header->get_type()) |
|
5749 != eap_tlv_message_type_eap_certificate_entry) |
|
5750 { |
|
5751 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5752 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
5753 } |
|
5754 |
|
5755 eap_process_tlv_message_data_c settings_data(m_am_tools); |
|
5756 |
|
5757 if (settings_data.get_is_valid() == false) |
|
5758 { |
|
5759 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5760 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
5761 } |
|
5762 |
|
5763 eap_status_e status = settings_data.set_message_data( |
|
5764 cert_entry_header->get_value_length(), |
|
5765 cert_entry_header->get_value(cert_entry_header->get_value_length())); |
|
5766 |
|
5767 if (status != eap_status_ok) |
|
5768 { |
|
5769 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5770 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5771 } |
|
5772 |
|
5773 eap_array_c<eap_tlv_header_c> settings_members(m_am_tools); |
|
5774 |
|
5775 status = settings_data.parse_message_data(&settings_members); |
|
5776 |
|
5777 if (status != eap_status_ok) |
|
5778 { |
|
5779 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5780 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5781 } |
|
5782 |
|
5783 u32_t member_index(0ul); |
|
5784 |
|
5785 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
5786 |
|
5787 { |
|
5788 // Specifies whether this entry describes user or CA certificate (mandatory) |
|
5789 status = read_parameter_data( |
|
5790 &settings_members, |
|
5791 member_index, |
|
5792 &(cert_entry->m_CertType)); |
|
5793 if (status != eap_status_ok) |
|
5794 { |
|
5795 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5796 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5797 } |
|
5798 } |
|
5799 |
|
5800 ++member_index; |
|
5801 |
|
5802 { |
|
5803 // Subject name in distinguished name ASCII form. This is optional. |
|
5804 // For example "/C=US/O=Some organization/CN=Some common name". |
|
5805 status = read_parameter_data( |
|
5806 &settings_members, |
|
5807 member_index, |
|
5808 &(cert_entry->m_SubjectNamePresent)); |
|
5809 if (status != eap_status_ok) |
|
5810 { |
|
5811 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5812 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5813 } |
|
5814 |
|
5815 if (cert_entry->m_SubjectNamePresent == true) |
|
5816 { |
|
5817 ++member_index; |
|
5818 |
|
5819 status = read_parameter_data( |
|
5820 &settings_members, |
|
5821 member_index, |
|
5822 &(cert_entry->m_SubjectName)); |
|
5823 if (status != eap_status_ok) |
|
5824 { |
|
5825 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5826 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5827 } |
|
5828 } |
|
5829 } |
|
5830 |
|
5831 ++member_index; |
|
5832 |
|
5833 { |
|
5834 // Issuer name in distinguished name ASCII form. This is optional. |
|
5835 // For example "/C=US/O=Some organization/CN=Some common name". |
|
5836 status = read_parameter_data( |
|
5837 &settings_members, |
|
5838 member_index, |
|
5839 &(cert_entry->m_IssuerNamePresent)); |
|
5840 if (status != eap_status_ok) |
|
5841 { |
|
5842 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5843 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5844 } |
|
5845 |
|
5846 if (cert_entry->m_IssuerNamePresent == true) |
|
5847 { |
|
5848 ++member_index; |
|
5849 |
|
5850 status = read_parameter_data( |
|
5851 &settings_members, |
|
5852 member_index, |
|
5853 &(cert_entry->m_IssuerName)); |
|
5854 if (status != eap_status_ok) |
|
5855 { |
|
5856 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5857 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5858 } |
|
5859 } |
|
5860 } |
|
5861 |
|
5862 ++member_index; |
|
5863 |
|
5864 { |
|
5865 // Serial number in ASCII form. This is optional. |
|
5866 status = read_parameter_data( |
|
5867 &settings_members, |
|
5868 member_index, |
|
5869 &(cert_entry->m_SerialNumberPresent)); |
|
5870 if (status != eap_status_ok) |
|
5871 { |
|
5872 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5873 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5874 } |
|
5875 |
|
5876 if (cert_entry->m_SerialNumberPresent == true) |
|
5877 { |
|
5878 ++member_index; |
|
5879 |
|
5880 status = read_parameter_data( |
|
5881 &settings_members, |
|
5882 member_index, |
|
5883 &(cert_entry->m_SerialNumber)); |
|
5884 if (status != eap_status_ok) |
|
5885 { |
|
5886 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5887 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5888 } |
|
5889 } |
|
5890 } |
|
5891 |
|
5892 ++member_index; |
|
5893 |
|
5894 { |
|
5895 // Subject key in binary form. This is mandatory. |
|
5896 status = read_parameter_data( |
|
5897 &settings_members, |
|
5898 member_index, |
|
5899 &(cert_entry->m_SubjectKeyIDPresent)); |
|
5900 if (status != eap_status_ok) |
|
5901 { |
|
5902 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5903 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5904 } |
|
5905 |
|
5906 if (cert_entry->m_SubjectKeyIDPresent == true) |
|
5907 { |
|
5908 ++member_index; |
|
5909 |
|
5910 status = read_parameter_data( |
|
5911 &settings_members, |
|
5912 member_index, |
|
5913 &(cert_entry->m_SubjectKeyID)); |
|
5914 if (status != eap_status_ok) |
|
5915 { |
|
5916 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5917 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5918 } |
|
5919 } |
|
5920 } |
|
5921 |
|
5922 ++member_index; |
|
5923 |
|
5924 { |
|
5925 // Subject key in binary form. This is mandatory. |
|
5926 status = read_parameter_data( |
|
5927 &settings_members, |
|
5928 member_index, |
|
5929 &(cert_entry->m_ThumbprintPresent)); |
|
5930 if (status != eap_status_ok) |
|
5931 { |
|
5932 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5933 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5934 } |
|
5935 |
|
5936 if (cert_entry->m_ThumbprintPresent == true) |
|
5937 { |
|
5938 ++member_index; |
|
5939 |
|
5940 status = read_parameter_data( |
|
5941 &settings_members, |
|
5942 member_index, |
|
5943 &(cert_entry->m_Thumbprint)); |
|
5944 if (status != eap_status_ok) |
|
5945 { |
|
5946 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5947 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5948 } |
|
5949 } |
|
5950 } |
|
5951 |
|
5952 ++member_index; |
|
5953 |
|
5954 { |
|
5955 // This holds only the certificate label. This is the text UI will show. |
|
5956 status = read_parameter_data( |
|
5957 &settings_members, |
|
5958 member_index, |
|
5959 &(cert_entry->m_LabelPresent)); |
|
5960 if (status != eap_status_ok) |
|
5961 { |
|
5962 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5963 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5964 } |
|
5965 |
|
5966 if (cert_entry->m_LabelPresent == true) |
|
5967 { |
|
5968 ++member_index; |
|
5969 |
|
5970 status = read_parameter_data( |
|
5971 &settings_members, |
|
5972 member_index, |
|
5973 &(cert_entry->m_Label)); |
|
5974 if (status != eap_status_ok) |
|
5975 { |
|
5976 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5977 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5978 } |
|
5979 } |
|
5980 } |
|
5981 |
|
5982 ++member_index; |
|
5983 |
|
5984 { |
|
5985 // Primary name of the certificate if any, UI uses this. |
|
5986 status = read_parameter_data( |
|
5987 &settings_members, |
|
5988 member_index, |
|
5989 &(cert_entry->m_PrimaryNamePresent)); |
|
5990 if (status != eap_status_ok) |
|
5991 { |
|
5992 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
5993 return EAP_STATUS_RETURN(m_am_tools, status); |
|
5994 } |
|
5995 |
|
5996 if (cert_entry->m_PrimaryNamePresent == true) |
|
5997 { |
|
5998 ++member_index; |
|
5999 |
|
6000 status = read_parameter_data( |
|
6001 &settings_members, |
|
6002 member_index, |
|
6003 &(cert_entry->m_PrimaryName)); |
|
6004 if (status != eap_status_ok) |
|
6005 { |
|
6006 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6007 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6008 } |
|
6009 } |
|
6010 } |
|
6011 |
|
6012 ++member_index; |
|
6013 |
|
6014 { |
|
6015 // Secondary name of the certificate if any, UI uses this. |
|
6016 status = read_parameter_data( |
|
6017 &settings_members, |
|
6018 member_index, |
|
6019 &(cert_entry->m_SecondaryNamePresent)); |
|
6020 if (status != eap_status_ok) |
|
6021 { |
|
6022 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6023 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6024 } |
|
6025 |
|
6026 if (cert_entry->m_SecondaryNamePresent == true) |
|
6027 { |
|
6028 ++member_index; |
|
6029 |
|
6030 status = read_parameter_data( |
|
6031 &settings_members, |
|
6032 member_index, |
|
6033 &(cert_entry->m_SecondaryName)); |
|
6034 if (status != eap_status_ok) |
|
6035 { |
|
6036 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6037 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6038 } |
|
6039 } |
|
6040 } |
|
6041 |
|
6042 ++member_index; |
|
6043 |
|
6044 { |
|
6045 // UI uses this to indicate enabled certificate. |
|
6046 status = read_parameter_data( |
|
6047 &settings_members, |
|
6048 member_index, |
|
6049 &(cert_entry->m_iIsEnabledPresent)); |
|
6050 if (status != eap_status_ok) |
|
6051 { |
|
6052 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6053 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6054 } |
|
6055 |
|
6056 if (cert_entry->m_iIsEnabledPresent == true) |
|
6057 { |
|
6058 ++member_index; |
|
6059 |
|
6060 status = read_parameter_data( |
|
6061 &settings_members, |
|
6062 member_index, |
|
6063 &(cert_entry->m_iIsEnabled)); |
|
6064 if (status != eap_status_ok) |
|
6065 { |
|
6066 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6067 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6068 } |
|
6069 } |
|
6070 } |
|
6071 |
|
6072 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6073 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6074 } |
|
6075 |
|
6076 //-------------------------------------------------- |
|
6077 |
|
6078 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::get_parameter_data( |
|
6079 const eap_tlv_header_c * const ushort_array_header, |
|
6080 eap_array_c<u16_t> * const ushort_array) |
|
6081 { |
|
6082 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6083 |
|
6084 EAP_TRACE_DEBUG( |
|
6085 m_am_tools, |
|
6086 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
6087 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s\n"), |
|
6088 ushort_array_header->get_type(), |
|
6089 get_type_string(static_cast<eap_tlv_message_type_e>(ushort_array_header->get_type())))); |
|
6090 |
|
6091 EAP_TRACE_DATA_DEBUG( |
|
6092 m_am_tools, |
|
6093 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
6094 (EAPL("get_parameter_data(eap_array_c<u16_t> *)"), |
|
6095 ushort_array_header->get_header_buffer(ushort_array_header->get_header_buffer_length()), |
|
6096 ushort_array_header->get_header_buffer_length())); |
|
6097 |
|
6098 if (static_cast<eap_tlv_message_type_e>(ushort_array_header->get_type()) |
|
6099 != eap_tlv_message_type_array) |
|
6100 { |
|
6101 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6102 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
6103 } |
|
6104 |
|
6105 eap_process_tlv_message_data_c ushort_array_data(m_am_tools); |
|
6106 |
|
6107 if (ushort_array_data.get_is_valid() == false) |
|
6108 { |
|
6109 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6110 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
6111 } |
|
6112 |
|
6113 eap_status_e status = ushort_array_data.set_message_data( |
|
6114 ushort_array_header->get_value_length(), |
|
6115 ushort_array_header->get_value(ushort_array_header->get_value_length())); |
|
6116 |
|
6117 if (status != eap_status_ok) |
|
6118 { |
|
6119 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6120 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6121 } |
|
6122 |
|
6123 eap_array_c<eap_tlv_header_c> ushort_array_members(m_am_tools); |
|
6124 |
|
6125 status = ushort_array_data.parse_message_data(&ushort_array_members); |
|
6126 |
|
6127 if (status != eap_status_ok) |
|
6128 { |
|
6129 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6130 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6131 } |
|
6132 |
|
6133 |
|
6134 for (u32_t ind_member = 0ul; ind_member < ushort_array_members.get_object_count(); ind_member++) |
|
6135 { |
|
6136 u16_t * const ushort_value = new u16_t; |
|
6137 |
|
6138 eap_automatic_variable_c<u16_t> automatic_ushort_value(m_am_tools, ushort_value); |
|
6139 |
|
6140 if (ushort_value == 0) |
|
6141 { |
|
6142 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6143 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
6144 } |
|
6145 |
|
6146 { |
|
6147 const eap_tlv_header_c * const ushort_header = ushort_array_members.get_object(ind_member); |
|
6148 if (ushort_header == 0) |
|
6149 { |
|
6150 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6151 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
6152 } |
|
6153 |
|
6154 status = ushort_array_data.get_parameter_data(ushort_header, ushort_value); |
|
6155 if (status != eap_status_ok) |
|
6156 { |
|
6157 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6158 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6159 } |
|
6160 |
|
6161 automatic_ushort_value.do_not_free_variable(); |
|
6162 |
|
6163 status = ushort_array->add_object(ushort_value, true); |
|
6164 if (status != eap_status_ok) |
|
6165 { |
|
6166 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6167 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6168 } |
|
6169 } |
|
6170 } // for () |
|
6171 |
|
6172 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6173 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
6174 } |
|
6175 |
|
6176 //-------------------------------------------------- |
|
6177 |
|
6178 EAP_FUNC_EXPORT u32_t eap_process_tlv_message_data_c::get_payload_size( |
|
6179 EAP_TEMPLATE_CONST eap_array_c<eap_type_value_e> * const eap_type_array) const |
|
6180 { |
|
6181 EAP_TRACE_DEBUG( |
|
6182 m_am_tools, |
|
6183 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
6184 (EAPL("eap_process_tlv_message_data_c::get_payload_size(eap_array_c<eap_type_value_e> * )\n"))); |
|
6185 |
|
6186 u32_t size = eap_type_array->get_object_count() |
|
6187 * (eap_tlv_header_c::get_header_length() |
|
6188 + eap_expanded_type_c::get_eap_expanded_type_size()); // Size of eap_type_value_e |
|
6189 |
|
6190 return (size); |
|
6191 } |
|
6192 |
|
6193 //-------------------------------------------------- |
|
6194 |
|
6195 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::add_parameter_data( |
|
6196 EAP_TEMPLATE_CONST eap_array_c<eap_type_value_e> * const eap_type_array) |
|
6197 { |
|
6198 EAP_TRACE_DEBUG( |
|
6199 m_am_tools, |
|
6200 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
6201 (EAPL("eap_process_tlv_message_data_c::add_parameter_data(eap_array_c<eap_type_value_e> * )\n"))); |
|
6202 |
|
6203 const u32_t size_of_eap_type_array(get_payload_size(eap_type_array)); |
|
6204 |
|
6205 eap_status_e status = add_structured_parameter_header( |
|
6206 eap_tlv_message_type_array, |
|
6207 size_of_eap_type_array); |
|
6208 if (status != eap_status_ok) |
|
6209 { |
|
6210 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6211 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6212 } |
|
6213 |
|
6214 for (u32_t ind = 0ul; ind < eap_type_array->get_object_count(); ind++) |
|
6215 { |
|
6216 const eap_type_value_e * const value = eap_type_array->get_object(ind); |
|
6217 if (value != 0) |
|
6218 { |
|
6219 status = add_parameter_data(*value); |
|
6220 if (status != eap_status_ok) |
|
6221 { |
|
6222 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6223 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6224 } |
|
6225 } |
|
6226 } |
|
6227 |
|
6228 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6229 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
6230 } |
|
6231 |
|
6232 //-------------------------------------------------- |
|
6233 |
|
6234 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::get_parameter_data( |
|
6235 const eap_tlv_header_c * const eap_type_array_header, |
|
6236 eap_array_c<eap_type_value_e> * const eap_type_array) |
|
6237 { |
|
6238 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6239 |
|
6240 EAP_TRACE_DEBUG( |
|
6241 m_am_tools, |
|
6242 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
6243 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s\n"), |
|
6244 eap_type_array_header->get_type(), |
|
6245 get_type_string(static_cast<eap_tlv_message_type_e>(eap_type_array_header->get_type())))); |
|
6246 |
|
6247 EAP_TRACE_DATA_DEBUG( |
|
6248 m_am_tools, |
|
6249 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
6250 (EAPL("get_parameter_data(eap_array_c<eap_type_value_e> *)"), |
|
6251 eap_type_array_header->get_header_buffer(eap_type_array_header->get_header_buffer_length()), |
|
6252 eap_type_array_header->get_header_buffer_length())); |
|
6253 |
|
6254 if (static_cast<eap_tlv_message_type_e>(eap_type_array_header->get_type()) |
|
6255 != eap_tlv_message_type_array) |
|
6256 { |
|
6257 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6258 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
6259 } |
|
6260 |
|
6261 eap_process_tlv_message_data_c ushort_array_data(m_am_tools); |
|
6262 |
|
6263 if (ushort_array_data.get_is_valid() == false) |
|
6264 { |
|
6265 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6266 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
6267 } |
|
6268 |
|
6269 eap_status_e status = ushort_array_data.set_message_data( |
|
6270 eap_type_array_header->get_value_length(), |
|
6271 eap_type_array_header->get_value(eap_type_array_header->get_value_length())); |
|
6272 |
|
6273 if (status != eap_status_ok) |
|
6274 { |
|
6275 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6276 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6277 } |
|
6278 |
|
6279 eap_array_c<eap_tlv_header_c> ushort_array_members(m_am_tools); |
|
6280 |
|
6281 status = ushort_array_data.parse_message_data(&ushort_array_members); |
|
6282 |
|
6283 if (status != eap_status_ok) |
|
6284 { |
|
6285 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6286 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6287 } |
|
6288 |
|
6289 |
|
6290 for (u32_t ind_member = 0ul; ind_member < ushort_array_members.get_object_count(); ind_member++) |
|
6291 { |
|
6292 eap_type_value_e * const eap_type_value = new eap_type_value_e(); |
|
6293 |
|
6294 eap_automatic_variable_c<eap_type_value_e> automatic_eap_type_value(m_am_tools, eap_type_value); |
|
6295 |
|
6296 if (eap_type_value == 0) |
|
6297 { |
|
6298 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6299 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
6300 } |
|
6301 |
|
6302 { |
|
6303 const eap_tlv_header_c * const eap_type_value_header = ushort_array_members.get_object(ind_member); |
|
6304 if (eap_type_value_header == 0) |
|
6305 { |
|
6306 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6307 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
6308 } |
|
6309 |
|
6310 status = ushort_array_data.get_parameter_data(eap_type_value_header, eap_type_value); |
|
6311 if (status != eap_status_ok) |
|
6312 { |
|
6313 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6314 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6315 } |
|
6316 |
|
6317 automatic_eap_type_value.do_not_free_variable(); |
|
6318 |
|
6319 status = eap_type_array->add_object(eap_type_value, true); |
|
6320 if (status != eap_status_ok) |
|
6321 { |
|
6322 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6323 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6324 } |
|
6325 } |
|
6326 } // for () |
|
6327 |
|
6328 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6329 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
6330 } |
|
6331 |
|
6332 //-------------------------------------------------- |
|
6333 |
|
6334 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::get_parameter_data( |
|
6335 const eap_tlv_header_c * const cert_array_header, |
|
6336 eap_array_c<eap_certificate_entry_c> * const cert_array) |
|
6337 { |
|
6338 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6339 |
|
6340 EAP_TRACE_DEBUG( |
|
6341 m_am_tools, |
|
6342 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
6343 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s\n"), |
|
6344 cert_array_header->get_type(), |
|
6345 get_type_string(static_cast<eap_tlv_message_type_e>(cert_array_header->get_type())))); |
|
6346 |
|
6347 EAP_TRACE_DATA_DEBUG( |
|
6348 m_am_tools, |
|
6349 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
6350 (EAPL("get_parameter_data(eap_array_c<eap_certificate_entry_c> *)"), |
|
6351 cert_array_header->get_header_buffer(cert_array_header->get_header_buffer_length()), |
|
6352 cert_array_header->get_header_buffer_length())); |
|
6353 |
|
6354 if (static_cast<eap_tlv_message_type_e>(cert_array_header->get_type()) |
|
6355 != eap_tlv_message_type_array) |
|
6356 { |
|
6357 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6358 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
6359 } |
|
6360 |
|
6361 eap_process_tlv_message_data_c cert_array_data(m_am_tools); |
|
6362 |
|
6363 if (cert_array_data.get_is_valid() == false) |
|
6364 { |
|
6365 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6366 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
6367 } |
|
6368 |
|
6369 eap_status_e status = cert_array_data.set_message_data( |
|
6370 cert_array_header->get_value_length(), |
|
6371 cert_array_header->get_value(cert_array_header->get_value_length())); |
|
6372 |
|
6373 if (status != eap_status_ok) |
|
6374 { |
|
6375 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6376 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6377 } |
|
6378 |
|
6379 eap_array_c<eap_tlv_header_c> cert_array_members(m_am_tools); |
|
6380 |
|
6381 status = cert_array_data.parse_message_data(&cert_array_members); |
|
6382 |
|
6383 if (status != eap_status_ok) |
|
6384 { |
|
6385 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6386 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6387 } |
|
6388 |
|
6389 |
|
6390 for (u32_t ind_member = 0ul; ind_member < cert_array_members.get_object_count(); ind_member++) |
|
6391 { |
|
6392 eap_certificate_entry_c * const cert_entry = new eap_certificate_entry_c(m_am_tools); |
|
6393 |
|
6394 eap_automatic_variable_c<eap_certificate_entry_c> automatic_cert_entry(m_am_tools, cert_entry); |
|
6395 |
|
6396 if (cert_entry == 0) |
|
6397 { |
|
6398 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6399 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
6400 } |
|
6401 |
|
6402 { |
|
6403 const eap_tlv_header_c * const cert_entry_header = cert_array_members.get_object(ind_member); |
|
6404 if (cert_entry_header == 0) |
|
6405 { |
|
6406 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6407 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
6408 } |
|
6409 |
|
6410 status = cert_array_data.get_parameter_data(cert_entry_header, cert_entry); |
|
6411 if (status != eap_status_ok) |
|
6412 { |
|
6413 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6414 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6415 } |
|
6416 |
|
6417 automatic_cert_entry.do_not_free_variable(); |
|
6418 |
|
6419 status = cert_array->add_object(cert_entry, true); |
|
6420 if (status != eap_status_ok) |
|
6421 { |
|
6422 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6423 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6424 } |
|
6425 } |
|
6426 } // for () |
|
6427 |
|
6428 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6429 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
6430 } |
|
6431 |
|
6432 //-------------------------------------------------- |
|
6433 |
|
6434 #if defined(USE_EAP_SIMPLE_CONFIG) |
|
6435 |
|
6436 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::get_parameter_data( |
|
6437 const eap_tlv_header_c * const network_key_header, |
|
6438 network_key_and_index_c * const network_key) |
|
6439 { |
|
6440 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6441 |
|
6442 EAP_TRACE_DEBUG( |
|
6443 m_am_tools, |
|
6444 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
6445 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s\n"), |
|
6446 network_key_header->get_type(), |
|
6447 get_type_string(static_cast<eap_tlv_message_type_e>(network_key_header->get_type())))); |
|
6448 |
|
6449 EAP_TRACE_DATA_DEBUG( |
|
6450 m_am_tools, |
|
6451 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
6452 (EAPL("get_parameter_data(network_key_and_index_c *)"), |
|
6453 network_key_header->get_header_buffer(network_key_header->get_header_buffer_length()), |
|
6454 network_key_header->get_header_buffer_length())); |
|
6455 |
|
6456 if (static_cast<eap_tlv_message_type_e>(network_key_header->get_type()) |
|
6457 != eap_tlv_message_type_network_key) |
|
6458 { |
|
6459 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6460 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
6461 } |
|
6462 |
|
6463 eap_process_tlv_message_data_c credential_data(m_am_tools); |
|
6464 |
|
6465 if (credential_data.get_is_valid() == false) |
|
6466 { |
|
6467 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6468 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
6469 } |
|
6470 |
|
6471 eap_status_e status = credential_data.set_message_data( |
|
6472 network_key_header->get_value_length(), |
|
6473 network_key_header->get_value(network_key_header->get_value_length())); |
|
6474 |
|
6475 if (status != eap_status_ok) |
|
6476 { |
|
6477 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6478 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6479 } |
|
6480 |
|
6481 eap_array_c<eap_tlv_header_c> credential_members(m_am_tools); |
|
6482 |
|
6483 status = credential_data.parse_message_data(&credential_members); |
|
6484 |
|
6485 if (status != eap_status_ok) |
|
6486 { |
|
6487 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6488 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6489 } |
|
6490 |
|
6491 u32_t member_index(0ul); |
|
6492 |
|
6493 u8_t network_key_index(0ul); |
|
6494 |
|
6495 { |
|
6496 const eap_tlv_header_c * const network_key_index_header = credential_members.get_object(member_index); |
|
6497 if (network_key_index_header == 0) |
|
6498 { |
|
6499 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6500 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
6501 } |
|
6502 |
|
6503 status = credential_data.get_parameter_data(network_key_index_header, &network_key_index); |
|
6504 if (status != eap_status_ok) |
|
6505 { |
|
6506 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6507 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6508 } |
|
6509 } |
|
6510 |
|
6511 ++member_index; |
|
6512 |
|
6513 eap_variable_data_c key(m_am_tools); |
|
6514 |
|
6515 { |
|
6516 const eap_tlv_header_c * const key_header = credential_members.get_object(member_index); |
|
6517 if (key_header == 0) |
|
6518 { |
|
6519 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6520 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
6521 } |
|
6522 |
|
6523 status = credential_data.get_parameter_data(key_header, &key); |
|
6524 if (status != eap_status_ok) |
|
6525 { |
|
6526 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6527 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6528 } |
|
6529 } |
|
6530 |
|
6531 ++member_index; |
|
6532 |
|
6533 network_key->set_network_key_index(network_key_index); |
|
6534 |
|
6535 status = network_key->get_network_key()->set_copy_of_buffer(&key); |
|
6536 if (status != eap_status_ok) |
|
6537 { |
|
6538 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6539 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6540 } |
|
6541 |
|
6542 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6543 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
6544 } |
|
6545 |
|
6546 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
|
6547 |
|
6548 //-------------------------------------------------- |
|
6549 |
|
6550 #if defined(USE_EAP_SIMPLE_CONFIG) |
|
6551 |
|
6552 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::get_parameter_data( |
|
6553 const eap_tlv_header_c * const network_keys_array_header, |
|
6554 eap_array_c<network_key_and_index_c> * const network_keys_array) |
|
6555 { |
|
6556 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6557 |
|
6558 EAP_TRACE_DEBUG( |
|
6559 m_am_tools, |
|
6560 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
6561 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s\n"), |
|
6562 network_keys_array_header->get_type(), |
|
6563 get_type_string(static_cast<eap_tlv_message_type_e>(network_keys_array_header->get_type())))); |
|
6564 |
|
6565 EAP_TRACE_DATA_DEBUG( |
|
6566 m_am_tools, |
|
6567 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
6568 (EAPL("get_parameter_data(eap_array_c<network_key_and_index_c> *)"), |
|
6569 network_keys_array_header->get_header_buffer(network_keys_array_header->get_header_buffer_length()), |
|
6570 network_keys_array_header->get_header_buffer_length())); |
|
6571 |
|
6572 if (static_cast<eap_tlv_message_type_e>(network_keys_array_header->get_type()) |
|
6573 != eap_tlv_message_type_array) |
|
6574 { |
|
6575 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6576 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
6577 } |
|
6578 |
|
6579 eap_process_tlv_message_data_c credential_array_data(m_am_tools); |
|
6580 |
|
6581 if (credential_array_data.get_is_valid() == false) |
|
6582 { |
|
6583 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6584 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
6585 } |
|
6586 |
|
6587 eap_status_e status = credential_array_data.set_message_data( |
|
6588 network_keys_array_header->get_value_length(), |
|
6589 network_keys_array_header->get_value(network_keys_array_header->get_value_length())); |
|
6590 |
|
6591 if (status != eap_status_ok) |
|
6592 { |
|
6593 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6594 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6595 } |
|
6596 |
|
6597 eap_array_c<eap_tlv_header_c> credential_array_members(m_am_tools); |
|
6598 |
|
6599 status = credential_array_data.parse_message_data(&credential_array_members); |
|
6600 |
|
6601 if (status != eap_status_ok) |
|
6602 { |
|
6603 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6604 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6605 } |
|
6606 |
|
6607 |
|
6608 for (u32_t ind_member = 0ul; ind_member < credential_array_members.get_object_count(); ind_member++) |
|
6609 { |
|
6610 network_key_and_index_c * const network_key = new network_key_and_index_c(m_am_tools); |
|
6611 |
|
6612 eap_automatic_variable_c<network_key_and_index_c> automatic_network_key(m_am_tools, network_key); |
|
6613 |
|
6614 if (network_key == 0 |
|
6615 || network_key->get_is_valid() == false) |
|
6616 { |
|
6617 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6618 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
6619 } |
|
6620 |
|
6621 { |
|
6622 const eap_tlv_header_c * const simple_config_credential_header = credential_array_members.get_object(ind_member); |
|
6623 if (simple_config_credential_header == 0) |
|
6624 { |
|
6625 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6626 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
6627 } |
|
6628 |
|
6629 status = credential_array_data.get_parameter_data(simple_config_credential_header, network_key); |
|
6630 if (status != eap_status_ok) |
|
6631 { |
|
6632 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6633 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6634 } |
|
6635 |
|
6636 automatic_network_key.do_not_free_variable(); |
|
6637 |
|
6638 status = network_keys_array->add_object(network_key, true); |
|
6639 if (status != eap_status_ok) |
|
6640 { |
|
6641 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6642 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6643 } |
|
6644 } |
|
6645 } // for () |
|
6646 |
|
6647 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6648 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
6649 } |
|
6650 |
|
6651 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
|
6652 |
|
6653 //-------------------------------------------------- |
|
6654 |
|
6655 #if defined(USE_EAP_SIMPLE_CONFIG) |
|
6656 |
|
6657 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::get_parameter_data( |
|
6658 const eap_tlv_header_c * const credential_header, |
|
6659 simple_config_credential_c * const credential) |
|
6660 { |
|
6661 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6662 |
|
6663 EAP_TRACE_DEBUG( |
|
6664 m_am_tools, |
|
6665 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
6666 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s\n"), |
|
6667 credential_header->get_type(), |
|
6668 get_type_string(static_cast<eap_tlv_message_type_e>(credential_header->get_type())))); |
|
6669 |
|
6670 EAP_TRACE_DATA_DEBUG( |
|
6671 m_am_tools, |
|
6672 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
6673 (EAPL("get_parameter_data(simple_config_credential_c *)"), |
|
6674 credential_header->get_header_buffer(credential_header->get_header_buffer_length()), |
|
6675 credential_header->get_header_buffer_length())); |
|
6676 |
|
6677 if (static_cast<eap_tlv_message_type_e>(credential_header->get_type()) |
|
6678 != eap_tlv_message_type_protected_setup_credential) |
|
6679 { |
|
6680 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6681 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
6682 } |
|
6683 |
|
6684 eap_process_tlv_message_data_c credential_data(m_am_tools); |
|
6685 |
|
6686 if (credential_data.get_is_valid() == false) |
|
6687 { |
|
6688 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6689 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
6690 } |
|
6691 |
|
6692 eap_status_e status = credential_data.set_message_data( |
|
6693 credential_header->get_value_length(), |
|
6694 credential_header->get_value(credential_header->get_value_length())); |
|
6695 |
|
6696 if (status != eap_status_ok) |
|
6697 { |
|
6698 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6699 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6700 } |
|
6701 |
|
6702 eap_array_c<eap_tlv_header_c> credential_members(m_am_tools); |
|
6703 |
|
6704 status = credential_data.parse_message_data(&credential_members); |
|
6705 |
|
6706 if (status != eap_status_ok) |
|
6707 { |
|
6708 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6709 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6710 } |
|
6711 |
|
6712 u32_t member_index(0ul); |
|
6713 |
|
6714 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
6715 |
|
6716 u8_t network_index(0ul); |
|
6717 |
|
6718 status = credential_data.read_parameter_data( |
|
6719 &credential_members, |
|
6720 member_index, |
|
6721 &network_index); |
|
6722 if (status != eap_status_ok) |
|
6723 { |
|
6724 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6725 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6726 } |
|
6727 |
|
6728 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
6729 |
|
6730 ++member_index; |
|
6731 |
|
6732 eap_variable_data_c SSID(m_am_tools); |
|
6733 |
|
6734 status = credential_data.read_parameter_data( |
|
6735 &credential_members, |
|
6736 member_index, |
|
6737 &SSID); |
|
6738 if (status != eap_status_ok) |
|
6739 { |
|
6740 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6741 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6742 } |
|
6743 |
|
6744 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
6745 |
|
6746 ++member_index; |
|
6747 |
|
6748 simple_config_Authentication_Type_e authentication_type(simple_config_Authentication_Type_None); |
|
6749 |
|
6750 status = credential_data.read_parameter_data( |
|
6751 &credential_members, |
|
6752 member_index, |
|
6753 &authentication_type); |
|
6754 if (status != eap_status_ok) |
|
6755 { |
|
6756 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6757 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6758 } |
|
6759 |
|
6760 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
6761 |
|
6762 ++member_index; |
|
6763 |
|
6764 simple_config_Encryption_Type_e encryption_type(simple_config_Encryption_Type_None); |
|
6765 |
|
6766 status = credential_data.read_parameter_data( |
|
6767 &credential_members, |
|
6768 member_index, |
|
6769 &encryption_type); |
|
6770 if (status != eap_status_ok) |
|
6771 { |
|
6772 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6773 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6774 } |
|
6775 |
|
6776 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
6777 |
|
6778 ++member_index; |
|
6779 |
|
6780 eap_array_c<network_key_and_index_c> network_keys_array(m_am_tools); |
|
6781 |
|
6782 status = credential_data.read_parameter_data( |
|
6783 &credential_members, |
|
6784 member_index, |
|
6785 &network_keys_array); |
|
6786 if (status != eap_status_ok) |
|
6787 { |
|
6788 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6789 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6790 } |
|
6791 |
|
6792 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
6793 |
|
6794 ++member_index; |
|
6795 |
|
6796 eap_variable_data_c MAC_address(m_am_tools); |
|
6797 |
|
6798 status = credential_data.read_parameter_data( |
|
6799 &credential_members, |
|
6800 member_index, |
|
6801 &MAC_address); |
|
6802 if (status != eap_status_ok) |
|
6803 { |
|
6804 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6805 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6806 } |
|
6807 |
|
6808 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
6809 |
|
6810 credential->set_network_index(network_index); |
|
6811 |
|
6812 status = credential->get_SSID()->set_copy_of_buffer(&SSID); |
|
6813 if (status != eap_status_ok) |
|
6814 { |
|
6815 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6816 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6817 } |
|
6818 |
|
6819 credential->set_Authentication_Type(authentication_type); |
|
6820 |
|
6821 credential->set_Encryption_Type(encryption_type); |
|
6822 |
|
6823 status = copy( |
|
6824 &network_keys_array, |
|
6825 credential->get_network_keys(), |
|
6826 m_am_tools, |
|
6827 false); |
|
6828 if (status != eap_status_ok) |
|
6829 { |
|
6830 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6831 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6832 } |
|
6833 |
|
6834 status = credential->get_MAC_address()->set_copy_of_buffer(&MAC_address); |
|
6835 if (status != eap_status_ok) |
|
6836 { |
|
6837 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6838 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6839 } |
|
6840 |
|
6841 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6842 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
6843 } |
|
6844 |
|
6845 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
|
6846 |
|
6847 //-------------------------------------------------- |
|
6848 |
|
6849 #if defined(USE_EAP_SIMPLE_CONFIG) |
|
6850 |
|
6851 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::get_parameter_data( |
|
6852 const eap_tlv_header_c * const credential_array_header, |
|
6853 eap_array_c<simple_config_credential_c> * const credential_array) |
|
6854 { |
|
6855 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6856 |
|
6857 EAP_TRACE_DEBUG( |
|
6858 m_am_tools, |
|
6859 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
6860 (EAPL("eap_process_tlv_message_data_c::get_parameter_data(): type=%d=%s\n"), |
|
6861 credential_array_header->get_type(), |
|
6862 get_type_string(static_cast<eap_tlv_message_type_e>(credential_array_header->get_type())))); |
|
6863 |
|
6864 EAP_TRACE_DATA_DEBUG( |
|
6865 m_am_tools, |
|
6866 EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
6867 (EAPL("get_parameter_data(eap_array_c<simple_config_credential_c> *)"), |
|
6868 credential_array_header->get_header_buffer(credential_array_header->get_header_buffer_length()), |
|
6869 credential_array_header->get_header_buffer_length())); |
|
6870 |
|
6871 if (static_cast<eap_tlv_message_type_e>(credential_array_header->get_type()) |
|
6872 != eap_tlv_message_type_array) |
|
6873 { |
|
6874 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6875 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
6876 } |
|
6877 |
|
6878 eap_process_tlv_message_data_c credential_array_data(m_am_tools); |
|
6879 |
|
6880 if (credential_array_data.get_is_valid() == false) |
|
6881 { |
|
6882 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6883 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
6884 } |
|
6885 |
|
6886 eap_status_e status = credential_array_data.set_message_data( |
|
6887 credential_array_header->get_value_length(), |
|
6888 credential_array_header->get_value(credential_array_header->get_value_length())); |
|
6889 |
|
6890 if (status != eap_status_ok) |
|
6891 { |
|
6892 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6893 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6894 } |
|
6895 |
|
6896 eap_array_c<eap_tlv_header_c> credential_array_members(m_am_tools); |
|
6897 |
|
6898 status = credential_array_data.parse_message_data(&credential_array_members); |
|
6899 |
|
6900 if (status != eap_status_ok) |
|
6901 { |
|
6902 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6903 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6904 } |
|
6905 |
|
6906 |
|
6907 for (u32_t ind_member = 0ul; ind_member < credential_array_members.get_object_count(); ind_member++) |
|
6908 { |
|
6909 simple_config_credential_c * const simple_config_credential = new simple_config_credential_c(m_am_tools); |
|
6910 |
|
6911 eap_automatic_variable_c<simple_config_credential_c> automatic_simple_config_credential(m_am_tools, simple_config_credential); |
|
6912 |
|
6913 if (simple_config_credential == 0 |
|
6914 || simple_config_credential->get_is_valid() == false) |
|
6915 { |
|
6916 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6917 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
6918 } |
|
6919 |
|
6920 { |
|
6921 const eap_tlv_header_c * const simple_config_credential_header = credential_array_members.get_object(ind_member); |
|
6922 if (simple_config_credential_header == 0) |
|
6923 { |
|
6924 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6925 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
6926 } |
|
6927 |
|
6928 status = credential_array_data.get_parameter_data(simple_config_credential_header, simple_config_credential); |
|
6929 if (status != eap_status_ok) |
|
6930 { |
|
6931 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6932 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6933 } |
|
6934 |
|
6935 automatic_simple_config_credential.do_not_free_variable(); |
|
6936 |
|
6937 status = credential_array->add_object(simple_config_credential, true); |
|
6938 if (status != eap_status_ok) |
|
6939 { |
|
6940 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6941 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6942 } |
|
6943 } |
|
6944 } // for () |
|
6945 |
|
6946 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6947 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
6948 } |
|
6949 |
|
6950 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
|
6951 |
|
6952 //-------------------------------------------------- |
|
6953 |
|
6954 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::read_parameter_data( |
|
6955 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters, |
|
6956 const u32_t parameter_index, |
|
6957 eap_am_network_id_c * const out_data) |
|
6958 { |
|
6959 if (parameters == 0 |
|
6960 || out_data == 0) |
|
6961 { |
|
6962 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6963 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
6964 } |
|
6965 |
|
6966 const eap_tlv_header_c * const positional_parameter |
|
6967 = parameters->get_object(parameter_index); |
|
6968 |
|
6969 if (positional_parameter == 0 |
|
6970 || positional_parameter->get_type() != eap_tlv_message_type_network_id) |
|
6971 { |
|
6972 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6973 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
6974 } |
|
6975 |
|
6976 eap_status_e status = get_parameter_data(positional_parameter, out_data); |
|
6977 |
|
6978 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6979 return EAP_STATUS_RETURN(m_am_tools, status); |
|
6980 } |
|
6981 |
|
6982 //-------------------------------------------------- |
|
6983 |
|
6984 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::read_parameter_data( |
|
6985 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters, |
|
6986 const u32_t parameter_index, |
|
6987 eap_variable_data_c * const out_data) |
|
6988 { |
|
6989 if (parameters == 0 |
|
6990 || out_data == 0) |
|
6991 { |
|
6992 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
6993 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
6994 } |
|
6995 |
|
6996 const eap_tlv_header_c * const positional_parameter |
|
6997 = parameters->get_object(parameter_index); |
|
6998 |
|
6999 if (positional_parameter == 0 |
|
7000 || positional_parameter->get_type() != eap_tlv_message_type_variable_data) |
|
7001 { |
|
7002 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7003 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7004 } |
|
7005 |
|
7006 eap_status_e status = get_parameter_data(positional_parameter, out_data); |
|
7007 |
|
7008 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7009 return EAP_STATUS_RETURN(m_am_tools, status); |
|
7010 } |
|
7011 |
|
7012 //-------------------------------------------------- |
|
7013 |
|
7014 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::read_parameter_data( |
|
7015 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters, |
|
7016 const u32_t parameter_index, |
|
7017 const eap_tlv_message_type_e type, |
|
7018 eap_status_e * const out_data) |
|
7019 { |
|
7020 if (parameters == 0 |
|
7021 || out_data == 0) |
|
7022 { |
|
7023 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7024 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7025 } |
|
7026 |
|
7027 const eap_tlv_header_c * const positional_parameter |
|
7028 = parameters->get_object(parameter_index); |
|
7029 |
|
7030 if (positional_parameter == 0 |
|
7031 || positional_parameter->get_type() != static_cast<eap_tlv_type_t>(type)) |
|
7032 { |
|
7033 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7034 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7035 } |
|
7036 |
|
7037 u32_t value(0ul); |
|
7038 |
|
7039 eap_status_e status = get_parameter_data(positional_parameter, &value); |
|
7040 |
|
7041 *out_data = static_cast<eap_status_e>(value); |
|
7042 |
|
7043 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7044 return EAP_STATUS_RETURN(m_am_tools, status); |
|
7045 } |
|
7046 |
|
7047 //-------------------------------------------------- |
|
7048 |
|
7049 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::read_parameter_data( |
|
7050 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters, |
|
7051 const u32_t parameter_index, |
|
7052 eap_array_c<eap_am_network_id_c> * const out_data) |
|
7053 { |
|
7054 if (parameters == 0 |
|
7055 || out_data == 0) |
|
7056 { |
|
7057 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7058 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7059 } |
|
7060 |
|
7061 const eap_tlv_header_c * const array_of_network_ids |
|
7062 = parameters->get_object(parameter_index); |
|
7063 |
|
7064 if (array_of_network_ids == 0 |
|
7065 || array_of_network_ids->get_type() != eap_tlv_message_type_array) |
|
7066 { |
|
7067 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7068 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7069 } |
|
7070 |
|
7071 eap_process_tlv_message_data_c array_data(m_am_tools); |
|
7072 |
|
7073 if (array_data.get_is_valid() == false) |
|
7074 { |
|
7075 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7076 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
7077 } |
|
7078 |
|
7079 eap_status_e status = array_data.set_message_data( |
|
7080 array_of_network_ids->get_value_length(), |
|
7081 array_of_network_ids->get_value(array_of_network_ids->get_value_length())); |
|
7082 |
|
7083 if (status != eap_status_ok) |
|
7084 { |
|
7085 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7086 return EAP_STATUS_RETURN(m_am_tools, status); |
|
7087 } |
|
7088 |
|
7089 eap_array_c<eap_tlv_header_c> network_ids(m_am_tools); |
|
7090 |
|
7091 status = array_data.parse_message_data( |
|
7092 &network_ids); |
|
7093 if (status != eap_status_ok) |
|
7094 { |
|
7095 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7096 return EAP_STATUS_RETURN(m_am_tools, status); |
|
7097 } |
|
7098 |
|
7099 for (u32_t ind = 0ul; ind < network_ids.get_object_count(); ++ind) |
|
7100 { |
|
7101 const eap_tlv_header_c * const header = network_ids.get_object(ind); |
|
7102 |
|
7103 if (header == 0) |
|
7104 { |
|
7105 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7106 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7107 } |
|
7108 |
|
7109 eap_am_network_id_c * const new_network_id = new eap_am_network_id_c(m_am_tools); |
|
7110 if (new_network_id == 0) |
|
7111 { |
|
7112 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7113 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
7114 } |
|
7115 |
|
7116 eap_automatic_variable_c<eap_am_network_id_c> automatic_new_network_id(m_am_tools, new_network_id); |
|
7117 |
|
7118 status = array_data.get_parameter_data(header, new_network_id); |
|
7119 if (status != eap_status_ok) |
|
7120 { |
|
7121 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7122 return EAP_STATUS_RETURN(m_am_tools, status); |
|
7123 } |
|
7124 |
|
7125 automatic_new_network_id.do_not_free_variable(); |
|
7126 |
|
7127 status = out_data->add_object( |
|
7128 new_network_id, |
|
7129 true); |
|
7130 if (status != eap_status_ok) |
|
7131 { |
|
7132 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7133 return EAP_STATUS_RETURN(m_am_tools, status); |
|
7134 } |
|
7135 |
|
7136 } // for() |
|
7137 |
|
7138 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7139 return EAP_STATUS_RETURN(m_am_tools, status); |
|
7140 } |
|
7141 |
|
7142 //-------------------------------------------------- |
|
7143 |
|
7144 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::read_parameter_data( |
|
7145 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters, |
|
7146 const u32_t parameter_index, |
|
7147 eap_state_notification_c * * const out_data) |
|
7148 { |
|
7149 if (parameters == 0 |
|
7150 || out_data == 0) |
|
7151 { |
|
7152 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7153 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7154 } |
|
7155 |
|
7156 const eap_tlv_header_c * const positional_parameter |
|
7157 = parameters->get_object(parameter_index); |
|
7158 |
|
7159 if (positional_parameter == 0 |
|
7160 || positional_parameter->get_type() != eap_tlv_message_type_eap_state_notification) |
|
7161 { |
|
7162 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7163 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7164 } |
|
7165 |
|
7166 eap_status_e status = get_parameter_data(positional_parameter, out_data); |
|
7167 |
|
7168 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7169 return EAP_STATUS_RETURN(m_am_tools, status); |
|
7170 } |
|
7171 |
|
7172 //-------------------------------------------------- |
|
7173 |
|
7174 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::read_parameter_data( |
|
7175 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters, |
|
7176 const u32_t parameter_index, |
|
7177 eapol_RSNA_key_header_c::eapol_RSNA_cipher_e * const out_data) |
|
7178 { |
|
7179 if (parameters == 0 |
|
7180 || out_data == 0) |
|
7181 { |
|
7182 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7183 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7184 } |
|
7185 |
|
7186 const eap_tlv_header_c * const positional_parameter |
|
7187 = parameters->get_object(parameter_index); |
|
7188 |
|
7189 if (positional_parameter == 0 |
|
7190 || positional_parameter->get_type() != eap_tlv_message_type_RSNA_cipher) |
|
7191 { |
|
7192 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7193 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7194 } |
|
7195 |
|
7196 u32_t value(0ul); |
|
7197 |
|
7198 eap_status_e status = get_parameter_data(positional_parameter, &value); |
|
7199 |
|
7200 *out_data = static_cast<eapol_RSNA_key_header_c::eapol_RSNA_cipher_e>(value); |
|
7201 |
|
7202 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7203 return EAP_STATUS_RETURN(m_am_tools, status); |
|
7204 } |
|
7205 |
|
7206 //-------------------------------------------------- |
|
7207 |
|
7208 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::read_parameter_data( |
|
7209 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters, |
|
7210 const u32_t parameter_index, |
|
7211 bool * const out_data) |
|
7212 { |
|
7213 if (parameters == 0 |
|
7214 || out_data == 0) |
|
7215 { |
|
7216 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7217 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7218 } |
|
7219 |
|
7220 const eap_tlv_header_c * const positional_parameter |
|
7221 = parameters->get_object(parameter_index); |
|
7222 |
|
7223 if (positional_parameter == 0 |
|
7224 || positional_parameter->get_type() != eap_tlv_message_type_boolean) |
|
7225 { |
|
7226 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7227 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7228 } |
|
7229 |
|
7230 u32_t value(0ul); |
|
7231 |
|
7232 eap_status_e status = get_parameter_data(positional_parameter, &value); |
|
7233 |
|
7234 *out_data = (value == 0) ? false: true; |
|
7235 |
|
7236 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7237 return EAP_STATUS_RETURN(m_am_tools, status); |
|
7238 } |
|
7239 |
|
7240 //-------------------------------------------------- |
|
7241 |
|
7242 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::read_parameter_data( |
|
7243 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters, |
|
7244 const u32_t parameter_index, |
|
7245 eap_type_value_e * const out_data) |
|
7246 { |
|
7247 if (parameters == 0 |
|
7248 || out_data == 0) |
|
7249 { |
|
7250 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7251 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7252 } |
|
7253 |
|
7254 const eap_tlv_header_c * const positional_parameter |
|
7255 = parameters->get_object(parameter_index); |
|
7256 |
|
7257 if (positional_parameter == 0 |
|
7258 || positional_parameter->get_type() != eap_tlv_message_type_eap_type) |
|
7259 { |
|
7260 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7261 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7262 } |
|
7263 |
|
7264 eap_status_e status = get_parameter_data(positional_parameter, out_data); |
|
7265 |
|
7266 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7267 return EAP_STATUS_RETURN(m_am_tools, status); |
|
7268 } |
|
7269 |
|
7270 //-------------------------------------------------- |
|
7271 |
|
7272 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::read_parameter_data( |
|
7273 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters, |
|
7274 const u32_t parameter_index, |
|
7275 eapol_key_authentication_type_e * const out_data) |
|
7276 { |
|
7277 if (parameters == 0 |
|
7278 || out_data == 0) |
|
7279 { |
|
7280 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7281 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7282 } |
|
7283 |
|
7284 const eap_tlv_header_c * const positional_parameter |
|
7285 = parameters->get_object(parameter_index); |
|
7286 |
|
7287 if (positional_parameter == 0 |
|
7288 || positional_parameter->get_type() != eap_tlv_message_type_eapol_key_authentication_type) |
|
7289 { |
|
7290 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7291 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7292 } |
|
7293 |
|
7294 u32_t value(0ul); |
|
7295 |
|
7296 eap_status_e status = get_parameter_data(positional_parameter, &value); |
|
7297 |
|
7298 *out_data = static_cast<eapol_key_authentication_type_e>(value); |
|
7299 |
|
7300 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7301 return EAP_STATUS_RETURN(m_am_tools, status); |
|
7302 } |
|
7303 |
|
7304 //-------------------------------------------------- |
|
7305 |
|
7306 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::read_parameter_data( |
|
7307 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters, |
|
7308 const u32_t parameter_index, |
|
7309 eapol_session_key_c * const out_data) |
|
7310 { |
|
7311 if (parameters == 0 |
|
7312 || out_data == 0) |
|
7313 { |
|
7314 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7315 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7316 } |
|
7317 |
|
7318 const eap_tlv_header_c * const positional_parameter |
|
7319 = parameters->get_object(parameter_index); |
|
7320 |
|
7321 if (positional_parameter == 0 |
|
7322 || positional_parameter->get_type() != eap_tlv_message_type_session_key) |
|
7323 { |
|
7324 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7325 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7326 } |
|
7327 |
|
7328 eap_status_e status = get_parameter_data(positional_parameter, out_data); |
|
7329 |
|
7330 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7331 return EAP_STATUS_RETURN(m_am_tools, status); |
|
7332 } |
|
7333 |
|
7334 //-------------------------------------------------- |
|
7335 |
|
7336 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::read_parameter_data( |
|
7337 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters, |
|
7338 const u32_t parameter_index, |
|
7339 eap_tlv_message_type_function_e * const out_data) |
|
7340 { |
|
7341 if (parameters == 0 |
|
7342 || out_data == 0) |
|
7343 { |
|
7344 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7345 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7346 } |
|
7347 |
|
7348 const eap_tlv_header_c * const positional_parameter |
|
7349 = parameters->get_object(parameter_index); |
|
7350 |
|
7351 if (positional_parameter == 0 |
|
7352 || positional_parameter->get_type() != eap_tlv_message_type_function) |
|
7353 { |
|
7354 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7355 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7356 } |
|
7357 |
|
7358 eap_status_e status = get_parameter_data(positional_parameter, out_data); |
|
7359 |
|
7360 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7361 return EAP_STATUS_RETURN(m_am_tools, status); |
|
7362 } |
|
7363 |
|
7364 //-------------------------------------------------- |
|
7365 |
|
7366 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::read_parameter_data( |
|
7367 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters, |
|
7368 const u32_t parameter_index, |
|
7369 eapol_key_802_11_authentication_mode_e * const out_data) |
|
7370 { |
|
7371 if (parameters == 0 |
|
7372 || out_data == 0) |
|
7373 { |
|
7374 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7375 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7376 } |
|
7377 |
|
7378 const eap_tlv_header_c * const positional_parameter |
|
7379 = parameters->get_object(parameter_index); |
|
7380 |
|
7381 if (positional_parameter == 0 |
|
7382 || positional_parameter->get_type() != eap_tlv_message_type_eapol_key_802_11_authentication_mode) |
|
7383 { |
|
7384 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7385 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7386 } |
|
7387 |
|
7388 u32_t value(0ul); |
|
7389 |
|
7390 eap_status_e status = get_parameter_data(positional_parameter, &value); |
|
7391 |
|
7392 *out_data = static_cast<eapol_key_802_11_authentication_mode_e>(value); |
|
7393 |
|
7394 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7395 return EAP_STATUS_RETURN(m_am_tools, status); |
|
7396 } |
|
7397 |
|
7398 //-------------------------------------------------- |
|
7399 |
|
7400 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::read_parameter_data( |
|
7401 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters, |
|
7402 const u32_t parameter_index, |
|
7403 eapol_RSNA_key_header_c::eapol_tkip_mic_failure_type_e * const out_data) |
|
7404 { |
|
7405 if (parameters == 0 |
|
7406 || out_data == 0) |
|
7407 { |
|
7408 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7409 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7410 } |
|
7411 |
|
7412 const eap_tlv_header_c * const positional_parameter |
|
7413 = parameters->get_object(parameter_index); |
|
7414 |
|
7415 if (positional_parameter == 0 |
|
7416 || positional_parameter->get_type() != eap_tlv_message_type_eapol_tkip_mic_failure_type) |
|
7417 { |
|
7418 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7419 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7420 } |
|
7421 |
|
7422 u32_t value(0ul); |
|
7423 |
|
7424 eap_status_e status = get_parameter_data(positional_parameter, &value); |
|
7425 |
|
7426 *out_data = static_cast<eapol_RSNA_key_header_c::eapol_tkip_mic_failure_type_e>(value); |
|
7427 |
|
7428 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7429 return EAP_STATUS_RETURN(m_am_tools, status); |
|
7430 } |
|
7431 |
|
7432 //-------------------------------------------------- |
|
7433 |
|
7434 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::read_parameter_data( |
|
7435 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters, |
|
7436 const u32_t parameter_index, |
|
7437 eapol_wlan_authentication_state_e * const out_data) |
|
7438 { |
|
7439 if (parameters == 0 |
|
7440 || out_data == 0) |
|
7441 { |
|
7442 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7443 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7444 } |
|
7445 |
|
7446 const eap_tlv_header_c * const positional_parameter |
|
7447 = parameters->get_object(parameter_index); |
|
7448 |
|
7449 if (positional_parameter == 0 |
|
7450 || positional_parameter->get_type() != eap_tlv_message_type_eapol_wlan_authentication_state) |
|
7451 { |
|
7452 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7453 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7454 } |
|
7455 |
|
7456 u32_t value(0ul); |
|
7457 |
|
7458 eap_status_e status = get_parameter_data(positional_parameter, &value); |
|
7459 |
|
7460 *out_data = static_cast<eapol_wlan_authentication_state_e>(value); |
|
7461 |
|
7462 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7463 return EAP_STATUS_RETURN(m_am_tools, status); |
|
7464 } |
|
7465 |
|
7466 //-------------------------------------------------- |
|
7467 |
|
7468 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::read_parameter_data( |
|
7469 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters, |
|
7470 const u32_t parameter_index, |
|
7471 u64_t * const out_data) |
|
7472 { |
|
7473 if (parameters == 0 |
|
7474 || out_data == 0) |
|
7475 { |
|
7476 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7477 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7478 } |
|
7479 |
|
7480 const eap_tlv_header_c * const positional_parameter |
|
7481 = parameters->get_object(parameter_index); |
|
7482 |
|
7483 if (positional_parameter == 0 |
|
7484 || positional_parameter->get_type() != eap_tlv_message_type_u64_t) |
|
7485 { |
|
7486 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7487 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7488 } |
|
7489 |
|
7490 eap_status_e status = get_parameter_data(positional_parameter, out_data); |
|
7491 |
|
7492 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7493 return EAP_STATUS_RETURN(m_am_tools, status); |
|
7494 } |
|
7495 |
|
7496 //-------------------------------------------------- |
|
7497 |
|
7498 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::read_parameter_data( |
|
7499 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters, |
|
7500 const u32_t parameter_index, |
|
7501 u32_t * const out_data) |
|
7502 { |
|
7503 if (parameters == 0 |
|
7504 || out_data == 0) |
|
7505 { |
|
7506 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7507 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7508 } |
|
7509 |
|
7510 const eap_tlv_header_c * const positional_parameter |
|
7511 = parameters->get_object(parameter_index); |
|
7512 |
|
7513 if (positional_parameter == 0 |
|
7514 || positional_parameter->get_type() != eap_tlv_message_type_u32_t) |
|
7515 { |
|
7516 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7517 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7518 } |
|
7519 |
|
7520 eap_status_e status = get_parameter_data(positional_parameter, out_data); |
|
7521 |
|
7522 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7523 return EAP_STATUS_RETURN(m_am_tools, status); |
|
7524 } |
|
7525 |
|
7526 //-------------------------------------------------- |
|
7527 |
|
7528 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::read_parameter_data( |
|
7529 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters, |
|
7530 const u32_t parameter_index, |
|
7531 u16_t * const out_data) |
|
7532 { |
|
7533 if (parameters == 0 |
|
7534 || out_data == 0) |
|
7535 { |
|
7536 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7537 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7538 } |
|
7539 |
|
7540 const eap_tlv_header_c * const positional_parameter |
|
7541 = parameters->get_object(parameter_index); |
|
7542 |
|
7543 if (positional_parameter == 0 |
|
7544 || positional_parameter->get_type() != eap_tlv_message_type_u16_t) |
|
7545 { |
|
7546 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7547 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7548 } |
|
7549 |
|
7550 eap_status_e status = get_parameter_data(positional_parameter, out_data); |
|
7551 |
|
7552 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7553 return EAP_STATUS_RETURN(m_am_tools, status); |
|
7554 } |
|
7555 |
|
7556 //-------------------------------------------------- |
|
7557 |
|
7558 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::read_parameter_data( |
|
7559 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters, |
|
7560 const u32_t parameter_index, |
|
7561 u8_t * const out_data) |
|
7562 { |
|
7563 if (parameters == 0 |
|
7564 || out_data == 0) |
|
7565 { |
|
7566 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7567 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7568 } |
|
7569 |
|
7570 const eap_tlv_header_c * const positional_parameter |
|
7571 = parameters->get_object(parameter_index); |
|
7572 |
|
7573 if (positional_parameter == 0 |
|
7574 || positional_parameter->get_type() != eap_tlv_message_type_u8_t) |
|
7575 { |
|
7576 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7577 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7578 } |
|
7579 |
|
7580 eap_status_e status = get_parameter_data(positional_parameter, out_data); |
|
7581 |
|
7582 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7583 return EAP_STATUS_RETURN(m_am_tools, status); |
|
7584 } |
|
7585 |
|
7586 //-------------------------------------------------- |
|
7587 |
|
7588 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::read_parameter_data( |
|
7589 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters, |
|
7590 const u32_t parameter_index, |
|
7591 i32_t * const out_data) |
|
7592 { |
|
7593 if (parameters == 0 |
|
7594 || out_data == 0) |
|
7595 { |
|
7596 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7597 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7598 } |
|
7599 |
|
7600 const eap_tlv_header_c * const positional_parameter |
|
7601 = parameters->get_object(parameter_index); |
|
7602 |
|
7603 if (positional_parameter == 0 |
|
7604 || positional_parameter->get_type() != eap_tlv_message_type_i32_t) |
|
7605 { |
|
7606 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7607 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7608 } |
|
7609 |
|
7610 eap_status_e status = get_parameter_data(positional_parameter, out_data); |
|
7611 |
|
7612 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7613 return EAP_STATUS_RETURN(m_am_tools, status); |
|
7614 } |
|
7615 |
|
7616 //-------------------------------------------------- |
|
7617 |
|
7618 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::read_parameter_data( |
|
7619 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters, |
|
7620 const u32_t parameter_index, |
|
7621 i16_t * const out_data) |
|
7622 { |
|
7623 if (parameters == 0 |
|
7624 || out_data == 0) |
|
7625 { |
|
7626 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7627 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7628 } |
|
7629 |
|
7630 const eap_tlv_header_c * const positional_parameter |
|
7631 = parameters->get_object(parameter_index); |
|
7632 |
|
7633 if (positional_parameter == 0 |
|
7634 || positional_parameter->get_type() != eap_tlv_message_type_i16_t) |
|
7635 { |
|
7636 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7637 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7638 } |
|
7639 |
|
7640 eap_status_e status = get_parameter_data(positional_parameter, out_data); |
|
7641 |
|
7642 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7643 return EAP_STATUS_RETURN(m_am_tools, status); |
|
7644 } |
|
7645 |
|
7646 //-------------------------------------------------- |
|
7647 |
|
7648 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::read_parameter_data( |
|
7649 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters, |
|
7650 const u32_t parameter_index, |
|
7651 i8_t * const out_data) |
|
7652 { |
|
7653 if (parameters == 0 |
|
7654 || out_data == 0) |
|
7655 { |
|
7656 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7657 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7658 } |
|
7659 |
|
7660 const eap_tlv_header_c * const positional_parameter |
|
7661 = parameters->get_object(parameter_index); |
|
7662 |
|
7663 if (positional_parameter == 0 |
|
7664 || positional_parameter->get_type() != eap_tlv_message_type_i8_t) |
|
7665 { |
|
7666 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7667 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7668 } |
|
7669 |
|
7670 eap_status_e status = get_parameter_data(positional_parameter, out_data); |
|
7671 |
|
7672 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7673 return EAP_STATUS_RETURN(m_am_tools, status); |
|
7674 } |
|
7675 |
|
7676 //-------------------------------------------------- |
|
7677 |
|
7678 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::read_parameter_data( |
|
7679 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters, |
|
7680 const u32_t parameter_index, |
|
7681 eap_method_settings_c * const out_data) |
|
7682 { |
|
7683 if (parameters == 0 |
|
7684 || out_data == 0) |
|
7685 { |
|
7686 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7687 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7688 } |
|
7689 |
|
7690 const eap_tlv_header_c * const positional_parameter |
|
7691 = parameters->get_object(parameter_index); |
|
7692 |
|
7693 if (positional_parameter == 0 |
|
7694 || positional_parameter->get_type() != eap_tlv_message_type_eap_method_settings) |
|
7695 { |
|
7696 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7697 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7698 } |
|
7699 |
|
7700 eap_status_e status = get_parameter_data(positional_parameter, out_data); |
|
7701 |
|
7702 out_data->trace(); |
|
7703 |
|
7704 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7705 return EAP_STATUS_RETURN(m_am_tools, status); |
|
7706 } |
|
7707 |
|
7708 //-------------------------------------------------- |
|
7709 |
|
7710 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::read_parameter_data( |
|
7711 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters, |
|
7712 const u32_t parameter_index, |
|
7713 eap_array_c<u16_t> * const out_data) |
|
7714 { |
|
7715 if (parameters == 0 |
|
7716 || out_data == 0) |
|
7717 { |
|
7718 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7719 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7720 } |
|
7721 |
|
7722 const eap_tlv_header_c * const positional_parameter |
|
7723 = parameters->get_object(parameter_index); |
|
7724 |
|
7725 if (positional_parameter == 0 |
|
7726 || positional_parameter->get_type() != eap_tlv_message_type_array) |
|
7727 { |
|
7728 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7729 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7730 } |
|
7731 |
|
7732 eap_status_e status = get_parameter_data(positional_parameter, out_data); |
|
7733 |
|
7734 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7735 return EAP_STATUS_RETURN(m_am_tools, status); |
|
7736 } |
|
7737 |
|
7738 //-------------------------------------------------- |
|
7739 |
|
7740 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::read_parameter_data( |
|
7741 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters, |
|
7742 const u32_t parameter_index, |
|
7743 eap_array_c<eap_type_value_e> * const out_data) |
|
7744 { |
|
7745 if (parameters == 0 |
|
7746 || out_data == 0) |
|
7747 { |
|
7748 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7749 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7750 } |
|
7751 |
|
7752 const eap_tlv_header_c * const positional_parameter |
|
7753 = parameters->get_object(parameter_index); |
|
7754 |
|
7755 if (positional_parameter == 0 |
|
7756 || positional_parameter->get_type() != eap_tlv_message_type_array) |
|
7757 { |
|
7758 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7759 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7760 } |
|
7761 |
|
7762 eap_status_e status = get_parameter_data(positional_parameter, out_data); |
|
7763 |
|
7764 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7765 return EAP_STATUS_RETURN(m_am_tools, status); |
|
7766 } |
|
7767 |
|
7768 //-------------------------------------------------- |
|
7769 |
|
7770 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::read_parameter_data( |
|
7771 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters, |
|
7772 const u32_t parameter_index, |
|
7773 eap_array_c<eap_certificate_entry_c> * const out_data) |
|
7774 { |
|
7775 if (parameters == 0 |
|
7776 || out_data == 0) |
|
7777 { |
|
7778 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7779 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7780 } |
|
7781 |
|
7782 const eap_tlv_header_c * const positional_parameter |
|
7783 = parameters->get_object(parameter_index); |
|
7784 |
|
7785 if (positional_parameter == 0 |
|
7786 || positional_parameter->get_type() != eap_tlv_message_type_array) |
|
7787 { |
|
7788 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7789 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7790 } |
|
7791 |
|
7792 eap_status_e status = get_parameter_data(positional_parameter, out_data); |
|
7793 |
|
7794 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7795 return EAP_STATUS_RETURN(m_am_tools, status); |
|
7796 } |
|
7797 |
|
7798 //-------------------------------------------------- |
|
7799 |
|
7800 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::read_parameter_data( |
|
7801 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters, |
|
7802 const u32_t parameter_index, |
|
7803 eap_certificate_entry_c::eap_certificate_type_e * const out_data) |
|
7804 { |
|
7805 if (parameters == 0 |
|
7806 || out_data == 0) |
|
7807 { |
|
7808 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7809 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7810 } |
|
7811 |
|
7812 u32_t integer_value(0ul); |
|
7813 |
|
7814 eap_status_e status = read_parameter_data( |
|
7815 parameters, |
|
7816 parameter_index, |
|
7817 &integer_value); |
|
7818 |
|
7819 *out_data = static_cast<eap_certificate_entry_c::eap_certificate_type_e>(integer_value); |
|
7820 |
|
7821 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7822 return EAP_STATUS_RETURN(m_am_tools, status); |
|
7823 } |
|
7824 |
|
7825 //-------------------------------------------------- |
|
7826 |
|
7827 #if defined(USE_EAP_SIMPLE_CONFIG) |
|
7828 |
|
7829 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::read_parameter_data( |
|
7830 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters, |
|
7831 const u32_t parameter_index, |
|
7832 simple_config_Encryption_Type_e * const out_data) |
|
7833 { |
|
7834 if (parameters == 0 |
|
7835 || out_data == 0) |
|
7836 { |
|
7837 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7838 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7839 } |
|
7840 |
|
7841 u16_t integer_value(0ul); |
|
7842 |
|
7843 eap_status_e status = read_parameter_data( |
|
7844 parameters, |
|
7845 parameter_index, |
|
7846 &integer_value); |
|
7847 |
|
7848 *out_data = static_cast<simple_config_Encryption_Type_e>(integer_value); |
|
7849 |
|
7850 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7851 return EAP_STATUS_RETURN(m_am_tools, status); |
|
7852 } |
|
7853 |
|
7854 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
|
7855 |
|
7856 //-------------------------------------------------- |
|
7857 |
|
7858 #if defined(USE_EAP_SIMPLE_CONFIG) |
|
7859 |
|
7860 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::read_parameter_data( |
|
7861 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters, |
|
7862 const u32_t parameter_index, |
|
7863 simple_config_Authentication_Type_e * const out_data) |
|
7864 { |
|
7865 if (parameters == 0 |
|
7866 || out_data == 0) |
|
7867 { |
|
7868 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7869 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7870 } |
|
7871 |
|
7872 u16_t integer_value(0ul); |
|
7873 |
|
7874 eap_status_e status = read_parameter_data( |
|
7875 parameters, |
|
7876 parameter_index, |
|
7877 &integer_value); |
|
7878 |
|
7879 *out_data = static_cast<simple_config_Authentication_Type_e>(integer_value); |
|
7880 |
|
7881 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7882 return EAP_STATUS_RETURN(m_am_tools, status); |
|
7883 } |
|
7884 |
|
7885 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
|
7886 |
|
7887 //-------------------------------------------------- |
|
7888 |
|
7889 #if defined(USE_EAP_SIMPLE_CONFIG) |
|
7890 |
|
7891 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::read_parameter_data( |
|
7892 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters, |
|
7893 const u32_t parameter_index, |
|
7894 eap_array_c<simple_config_credential_c> * const out_data) |
|
7895 { |
|
7896 if (parameters == 0 |
|
7897 || out_data == 0) |
|
7898 { |
|
7899 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7900 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7901 } |
|
7902 |
|
7903 const eap_tlv_header_c * const positional_parameter |
|
7904 = parameters->get_object(parameter_index); |
|
7905 |
|
7906 if (positional_parameter == 0 |
|
7907 || positional_parameter->get_type() != eap_tlv_message_type_array) |
|
7908 { |
|
7909 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7910 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7911 } |
|
7912 |
|
7913 eap_status_e status = get_parameter_data(positional_parameter, out_data); |
|
7914 |
|
7915 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7916 return EAP_STATUS_RETURN(m_am_tools, status); |
|
7917 } |
|
7918 |
|
7919 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
|
7920 |
|
7921 //-------------------------------------------------- |
|
7922 |
|
7923 #if defined(USE_EAP_SIMPLE_CONFIG) |
|
7924 |
|
7925 EAP_FUNC_EXPORT eap_status_e eap_process_tlv_message_data_c::read_parameter_data( |
|
7926 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters, |
|
7927 const u32_t parameter_index, |
|
7928 eap_array_c<network_key_and_index_c> * const out_data) |
|
7929 { |
|
7930 if (parameters == 0 |
|
7931 || out_data == 0) |
|
7932 { |
|
7933 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7934 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7935 } |
|
7936 |
|
7937 const eap_tlv_header_c * const positional_parameter |
|
7938 = parameters->get_object(parameter_index); |
|
7939 |
|
7940 if (positional_parameter == 0 |
|
7941 || positional_parameter->get_type() != eap_tlv_message_type_array) |
|
7942 { |
|
7943 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7944 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
7945 } |
|
7946 |
|
7947 eap_status_e status = get_parameter_data(positional_parameter, out_data); |
|
7948 |
|
7949 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
7950 return EAP_STATUS_RETURN(m_am_tools, status); |
|
7951 } |
|
7952 |
|
7953 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
|
7954 |
|
7955 //-------------------------------------------------- |
|
7956 |
|
7957 EAP_FUNC_EXPORT eap_const_string eap_process_tlv_message_data_c::get_type_string(const eap_tlv_message_type_e type) |
|
7958 { |
|
7959 #if defined(USE_EAP_TRACE_STRINGS) |
|
7960 EAP_IF_RETURN_STRING(type, eap_tlv_message_type_none) |
|
7961 else EAP_IF_RETURN_STRING(type, eap_tlv_message_type_array) |
|
7962 else EAP_IF_RETURN_STRING(type, eap_tlv_message_type_boolean) |
|
7963 else EAP_IF_RETURN_STRING(type, eap_tlv_message_type_eap_protocol_layer) |
|
7964 else EAP_IF_RETURN_STRING(type, eap_tlv_message_type_eap_state_notification) |
|
7965 else EAP_IF_RETURN_STRING(type, eap_tlv_message_type_eap_status) |
|
7966 else EAP_IF_RETURN_STRING(type, eap_tlv_message_type_eap_type) |
|
7967 else EAP_IF_RETURN_STRING(type, eap_tlv_message_type_eapol_key_802_11_authentication_mode) |
|
7968 else EAP_IF_RETURN_STRING(type, eap_tlv_message_type_eapol_key_authentication_type) |
|
7969 else EAP_IF_RETURN_STRING(type, eap_tlv_message_type_eapol_key_type) |
|
7970 else EAP_IF_RETURN_STRING(type, eap_tlv_message_type_eapol_tkip_mic_failure_type) |
|
7971 else EAP_IF_RETURN_STRING(type, eap_tlv_message_type_eapol_wlan_authentication_state) |
|
7972 else EAP_IF_RETURN_STRING(type, eap_tlv_message_type_error) |
|
7973 else EAP_IF_RETURN_STRING(type, eap_tlv_message_type_function) |
|
7974 else EAP_IF_RETURN_STRING(type, eap_tlv_message_type_network_id) |
|
7975 else EAP_IF_RETURN_STRING(type, eap_tlv_message_type_network_key) |
|
7976 else EAP_IF_RETURN_STRING(type, eap_tlv_message_type_protected_setup_credential) |
|
7977 else EAP_IF_RETURN_STRING(type, eap_tlv_message_type_RSNA_cipher) |
|
7978 else EAP_IF_RETURN_STRING(type, eap_tlv_message_type_session_key) |
|
7979 else EAP_IF_RETURN_STRING(type, eap_tlv_message_type_u8_t) |
|
7980 else EAP_IF_RETURN_STRING(type, eap_tlv_message_type_u16_t) |
|
7981 else EAP_IF_RETURN_STRING(type, eap_tlv_message_type_u32_t) |
|
7982 else EAP_IF_RETURN_STRING(type, eap_tlv_message_type_u64_t) |
|
7983 else EAP_IF_RETURN_STRING(type, eap_tlv_message_type_variable_data) |
|
7984 else EAP_IF_RETURN_STRING(type, eap_tlv_message_type_eap_method_settings) |
|
7985 else EAP_IF_RETURN_STRING(type, eap_tlv_message_type_eap_certificate_entry) |
|
7986 else EAP_IF_RETURN_STRING(type, eap_tlv_message_type_i8_t) |
|
7987 else EAP_IF_RETURN_STRING(type, eap_tlv_message_type_i16_t) |
|
7988 else EAP_IF_RETURN_STRING(type, eap_tlv_message_type_i32_t) |
|
7989 else EAP_IF_RETURN_STRING(type, eap_tlv_message_type_configuration_option) |
|
7990 else |
|
7991 #endif // #if defined(USE_EAP_TRACE_STRINGS) |
|
7992 { |
|
7993 EAP_UNREFERENCED_PARAMETER(type); |
|
7994 |
|
7995 return EAPL("Unknown EAPOL-TLV message type"); |
|
7996 } |
|
7997 } |
|
7998 |
|
7999 //-------------------------------------------------- |
|
8000 |
|
8001 EAP_FUNC_EXPORT eap_const_string eap_process_tlv_message_data_c::get_function_string(const eap_tlv_message_type_function_e function) |
|
8002 { |
|
8003 #if defined(USE_EAP_TRACE_STRINGS) |
|
8004 EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_none) |
|
8005 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_check_pmksa_cache) |
|
8006 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_start_authentication) |
|
8007 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_complete_association) |
|
8008 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_disassociation) |
|
8009 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_start_preauthentication) |
|
8010 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_start_reassociation) |
|
8011 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_complete_reassociation) |
|
8012 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_start_WPXM_reassociation) |
|
8013 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_complete_WPXM_reassociation) |
|
8014 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_packet_process) |
|
8015 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_tkip_mic_failure) |
|
8016 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_eap_acknowledge) |
|
8017 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_update_header_offset) |
|
8018 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_complete_check_pmksa_cache) |
|
8019 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_packet_send) |
|
8020 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_associate) |
|
8021 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_disassociate) |
|
8022 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_packet_data_session_key) |
|
8023 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_state_notification) |
|
8024 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_reassociate) |
|
8025 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_update_wlan_database_reference_values) |
|
8026 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_complete_start_WPXM_reassociation) |
|
8027 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_new_protected_setup_credentials) |
|
8028 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_create_eap_session) |
|
8029 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_remove_eap_session) |
|
8030 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_send_eap_identity_request) |
|
8031 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_packet_data_crypto_keys) |
|
8032 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_restart_authentication) |
|
8033 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_create_state) |
|
8034 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_remove_bksa_from_cache) |
|
8035 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_association) |
|
8036 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_set_eap_database_reference_values) |
|
8037 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_eap_mtu) |
|
8038 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_get_802_11_authentication_mode) |
|
8039 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_complete_get_802_11_authentication_mode) |
|
8040 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_complete_remove_eap_session) |
|
8041 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_complete_disassociation) |
|
8042 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_last_function) |
|
8043 |
|
8044 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_plugin_get_configuration) |
|
8045 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_plugin_set_configuration) |
|
8046 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_plugin_copy_configuration) |
|
8047 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_plugin_delete_configuration) |
|
8048 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_plugin_set_index) |
|
8049 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_plugin_get_type_info) |
|
8050 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_plugin_invoke_ui) |
|
8051 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_plugin_complete_get_configuration) |
|
8052 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_plugin_complete_set_configuration) |
|
8053 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_plugin_complete_delete_configuration) |
|
8054 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_plugin_complete_copy_configuration) |
|
8055 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_plugin_complete_set_index) |
|
8056 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_plugin_complete_get_type_info) |
|
8057 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_plugin_complete_invoke_ui) |
|
8058 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_plugin_last_function) |
|
8059 |
|
8060 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_general_settings_set_eap_methods) |
|
8061 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_general_settings_get_eap_methods) |
|
8062 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_general_settings_get_certificate_lists) |
|
8063 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_general_settings_delete_all_eap_settings) |
|
8064 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_general_settings_copy_all_eap_settings) |
|
8065 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_general_settings_complete_set_eap_methods) |
|
8066 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_general_settings_complete_get_eap_methods) |
|
8067 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_general_settings_complete_get_certificate_lists) |
|
8068 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_general_settings_complete_delete_all_eap_settings) |
|
8069 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_general_settings_complete_copy_all_eap_settings) |
|
8070 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_general_settings_last_function) |
|
8071 |
|
8072 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_pac_store_open_pac_store) |
|
8073 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_pac_store_create_device_seed) |
|
8074 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_pac_store_is_master_key_present) |
|
8075 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_pac_store_is_master_key_and_password_matching) |
|
8076 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_pac_store_create_and_save_master_key) |
|
8077 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_pac_store_compare_pac_store_password) |
|
8078 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_pac_store_is_pacstore_password_present) |
|
8079 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_pac_store_set_pac_store_password) |
|
8080 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_pac_store_destroy_pac_store) |
|
8081 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_pac_store_complete_open_pac_store) |
|
8082 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_pac_store_complete_create_device_seed) |
|
8083 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_pac_store_complete_is_master_key_present) |
|
8084 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_pac_store_complete_is_master_key_and_password_matching) |
|
8085 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_pac_store_complete_create_and_save_master_key) |
|
8086 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_pac_store_complete_is_pacstore_password_present) |
|
8087 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_pac_store_complete_compare_pac_store_password) |
|
8088 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_pac_store_complete_set_pac_store_password) |
|
8089 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_pac_store_complete_destroy_pac_store) |
|
8090 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_pac_store_last_function) |
|
8091 |
|
8092 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_wapi_settings_get_all_certificate_labels) |
|
8093 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_wapi_settings_reset_certificate_store) |
|
8094 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_wapi_settings_get_configuration) |
|
8095 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_wapi_settings_set_configuration) |
|
8096 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_wapi_settings_set_ca_cert) |
|
8097 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_wapi_settings_set_user_cert) |
|
8098 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_wapi_settings_delete_configuration) |
|
8099 |
|
8100 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_wapi_settings_complete_get_all_certificate_labels) |
|
8101 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_wapi_settings_complete_reset_certificate_store) |
|
8102 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_wapi_settings_complete_get_configuration) |
|
8103 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_wapi_settings_complete_set_configuration) |
|
8104 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_wapi_settings_complete_set_ca_cert) |
|
8105 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_wapi_settings_complete_set_user_cert) |
|
8106 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_wapi_settings_complete_delete_configuration) |
|
8107 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_wapi_settings_complete_last_function) |
|
8108 |
|
8109 else EAP_IF_RETURN_STRING(function, eap_tlv_message_type_function_illegal_value) |
|
8110 else |
|
8111 #endif // #if defined(USE_EAP_TRACE_STRINGS) |
|
8112 { |
|
8113 EAP_UNREFERENCED_PARAMETER(function); |
|
8114 |
|
8115 return EAPL("Unknown EAPOL-TLV message function"); |
|
8116 } |
|
8117 } |
|
8118 |
|
8119 //-------------------------------------------------- |
|
8120 |
|
8121 // End. |
|