author | Pat Downey <patd@symbian.org> |
Wed, 01 Sep 2010 12:23:57 +0100 | |
branch | RCL_3 |
changeset 46 | c74b3d9f6b9e |
parent 45 | bad0cc58d154 |
permissions | -rw-r--r-- |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2001-2006 Nokia Corporation and/or its subsidiary(-ies). |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: EAP and WLAN authentication protocols. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
|
2
1c7bc153c08e
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
18 |
/* |
46 | 19 |
* %version: 31.1.3 % |
2
1c7bc153c08e
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
20 |
*/ |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
21 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
22 |
// This is enumeration of EAPOL source code. |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
23 |
#if defined(USE_EAP_MINIMUM_RELEASE_TRACES) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
24 |
#undef EAP_FILE_NUMBER_ENUM |
46 | 25 |
#define EAP_FILE_NUMBER_ENUM 40 |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
26 |
#undef EAP_FILE_NUMBER_DATE |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
27 |
#define EAP_FILE_NUMBER_DATE 1127594498 |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
28 |
#endif //#if defined(USE_EAP_MINIMUM_RELEASE_TRACES) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
29 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
30 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
31 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
32 |
#include "eap_am_memory.h" |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
33 |
#include "eap_automatic_variable.h" |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
34 |
#include "eapol_handle_tlv_message_data.h" |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
35 |
#include "eap_variable_data.h" |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
36 |
#include "eap_am_network_id.h" |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
37 |
#include "eap_buffer.h" |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
38 |
#include "eapol_session_key.h" |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
39 |
#include "abs_eap_state_notification.h" |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
40 |
#include "eap_state_notification.h" |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
41 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
42 |
#if defined(USE_EAP_SIMPLE_CONFIG) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
43 |
#include "simple_config_types.h" |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
44 |
#include "simple_config_credential.h" |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
45 |
#include "simple_config_payloads.h" |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
46 |
#endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
47 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
48 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
49 |
/** @file */ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
50 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
51 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
52 |
//-------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
53 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
54 |
EAP_FUNC_EXPORT eapol_handle_tlv_message_data_c::~eapol_handle_tlv_message_data_c() |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
55 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
56 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
57 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
58 |
//-------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
59 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
60 |
EAP_FUNC_EXPORT eapol_handle_tlv_message_data_c::eapol_handle_tlv_message_data_c( |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
61 |
abs_eap_am_tools_c * const tools) |
46 | 62 |
: eap_tlv_message_data_c(tools) |
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
63 |
, m_am_tools(tools) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
64 |
, m_is_valid(true) |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
65 |
{ |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
66 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
67 |
|
46 | 68 |
//------------------------------------------------------------------- |
69 |
||
70 |
/** |
|
71 |
* This function should increase reference count. |
|
72 |
*/ |
|
73 |
EAP_FUNC_EXPORT void eapol_handle_tlv_message_data_c::object_increase_reference_count() |
|
74 |
{ |
|
75 |
} |
|
76 |
||
77 |
//------------------------------------------------------------------- |
|
78 |
||
79 |
/** |
|
80 |
* This function should first decrease reference count |
|
81 |
* and second return the remaining reference count. |
|
82 |
* Reference count must not be decreased when it is zero. |
|
83 |
*/ |
|
84 |
EAP_FUNC_EXPORT u32_t eapol_handle_tlv_message_data_c::object_decrease_reference_count() |
|
85 |
{ |
|
86 |
return 0; |
|
87 |
} |
|
88 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
89 |
//-------------------------------------------------- |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
90 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
91 |
EAP_FUNC_EXPORT bool eapol_handle_tlv_message_data_c::get_is_valid() |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
92 |
{ |
46 | 93 |
return m_is_valid && eap_tlv_message_data_c::get_is_valid(); |
94 |
} |
|
95 |
||
96 |
//-------------------------------------------------- |
|
97 |
||
98 |
EAP_FUNC_EXPORT u32_t eapol_handle_tlv_message_data_c::get_payload_size( |
|
99 |
const eap_am_network_id_c * const network_id) const |
|
100 |
{ |
|
101 |
return |
|
102 |
(3ul * eap_tlv_header_c::get_header_length() // Each attribute have their own header. |
|
103 |
+ network_id->get_source_id()->get_data_length() |
|
104 |
+ network_id->get_destination_id()->get_data_length() |
|
105 |
+ sizeof(network_id->get_type())); |
|
106 |
} |
|
107 |
||
108 |
//-------------------------------------------------- |
|
109 |
||
110 |
EAP_FUNC_EXPORT u32_t eapol_handle_tlv_message_data_c::get_payload_size( |
|
111 |
const abs_eap_state_notification_c * const state) const |
|
112 |
{ |
|
113 |
return |
|
114 |
(7ul * eap_tlv_header_c::get_header_length()) // Each attribute have their own header. |
|
115 |
+ (get_payload_size(state->get_send_network_id()) |
|
116 |
+ sizeof(u32_t) // eap_protocol_layer_e |
|
117 |
+ sizeof(state->get_protocol()) |
|
118 |
+ eap_expanded_type_c::get_eap_expanded_type_size() |
|
119 |
+ sizeof(state->get_current_state()) |
|
120 |
+ sizeof(u32_t) // bool is_client |
|
121 |
+ sizeof(u32_t) // eap_status_e authentication error |
|
122 |
); |
|
123 |
} |
|
124 |
||
125 |
//-------------------------------------------------- |
|
126 |
||
127 |
EAP_FUNC_EXPORT u32_t eapol_handle_tlv_message_data_c::get_payload_size( |
|
128 |
const eapol_session_key_c * const session_key) const |
|
129 |
{ |
|
130 |
return |
|
131 |
((5ul * eap_tlv_header_c::get_header_length()) // Each attribute have their own header. |
|
132 |
+ session_key->get_key()->get_data_length() |
|
133 |
+ session_key->get_sequence_number()->get_data_length() |
|
134 |
+ sizeof(u32_t) // const eapol_key_type_e m_key_type |
|
135 |
+ sizeof(session_key->get_key_index()) |
|
136 |
+ sizeof(u32_t) // const bool m_key_tx_bit |
|
137 |
); |
|
138 |
} |
|
139 |
||
140 |
//-------------------------------------------------- |
|
141 |
||
142 |
#if defined(USE_EAP_SIMPLE_CONFIG) |
|
143 |
||
144 |
EAP_FUNC_EXPORT u32_t eapol_handle_tlv_message_data_c::get_payload_size( |
|
145 |
network_key_and_index_c * key) const |
|
146 |
{ |
|
147 |
u32_t size(0ul); |
|
148 |
||
149 |
if (key != 0) |
|
150 |
{ |
|
151 |
size += eap_tlv_header_c::get_header_length() |
|
152 |
+ sizeof(key->get_network_key_index()) // Size of Network Key Index |
|
153 |
+ eap_tlv_header_c::get_header_length() |
|
154 |
+ key->get_network_key()->get_data_length() // Size of Network Key |
|
155 |
; |
|
156 |
} |
|
157 |
||
158 |
return (size); |
|
159 |
} |
|
160 |
||
161 |
#endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
|
162 |
||
163 |
//-------------------------------------------------- |
|
164 |
||
165 |
#if defined(USE_EAP_SIMPLE_CONFIG) |
|
166 |
||
167 |
EAP_FUNC_EXPORT u32_t eapol_handle_tlv_message_data_c::get_payload_size( |
|
168 |
EAP_TEMPLATE_CONST eap_array_c<network_key_and_index_c> * network_keys) const |
|
169 |
{ |
|
170 |
u32_t size(0ul); |
|
171 |
||
172 |
for (u32_t ind_network_key = 0ul; ind_network_key < network_keys->get_object_count(); ind_network_key++) |
|
173 |
{ |
|
174 |
network_key_and_index_c * const key = network_keys->get_object(ind_network_key); |
|
175 |
if (key != 0) |
|
176 |
{ |
|
177 |
size += eap_tlv_header_c::get_header_length() // Size of structure header |
|
178 |
+ get_payload_size(key); // Size of Network Key |
|
179 |
} |
|
180 |
} // for () |
|
181 |
||
182 |
return (size); |
|
183 |
} |
|
184 |
||
185 |
#endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
|
186 |
||
187 |
//-------------------------------------------------- |
|
188 |
||
189 |
#if defined(USE_EAP_SIMPLE_CONFIG) |
|
190 |
||
191 |
EAP_FUNC_EXPORT u32_t eapol_handle_tlv_message_data_c::get_payload_size( |
|
192 |
simple_config_credential_c * const credential) const |
|
193 |
{ |
|
194 |
u32_t size(0ul); |
|
195 |
||
196 |
if (credential != 0) |
|
197 |
{ |
|
198 |
size += eap_tlv_header_c::get_header_length() |
|
199 |
+ sizeof(credential->get_network_index()) // Size of Network Index |
|
200 |
+ eap_tlv_header_c::get_header_length() |
|
201 |
+ credential->get_SSID()->get_data_length() // Size of SSID |
|
202 |
+ eap_tlv_header_c::get_header_length() |
|
203 |
+ sizeof(u16_t) // Size of Authentiction type |
|
204 |
+ eap_tlv_header_c::get_header_length() |
|
205 |
+ sizeof(u16_t) // Size of Encryption type |
|
206 |
; |
|
207 |
||
208 |
size += eap_tlv_header_c::get_header_length() // Size of header of Array |
|
209 |
+ get_payload_size(credential->get_network_keys()); |
|
210 |
||
211 |
size += eap_tlv_header_c::get_header_length() |
|
212 |
+ credential->get_MAC_address()->get_data_length() // Size of MAC Address |
|
213 |
; |
|
214 |
} |
|
215 |
||
216 |
return (size); |
|
217 |
} |
|
218 |
||
219 |
#endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
|
220 |
||
221 |
//-------------------------------------------------- |
|
222 |
||
223 |
#if defined(USE_EAP_SIMPLE_CONFIG) |
|
224 |
||
225 |
EAP_FUNC_EXPORT u32_t eapol_handle_tlv_message_data_c::get_payload_size( |
|
226 |
EAP_TEMPLATE_CONST eap_array_c<simple_config_credential_c> * const credential_array) const |
|
227 |
{ |
|
228 |
u32_t size(0ul); |
|
229 |
||
230 |
for (u32_t ind_credential = 0ul; ind_credential < credential_array->get_object_count(); ind_credential++) |
|
231 |
{ |
|
232 |
simple_config_credential_c * const credential = credential_array->get_object(ind_credential); |
|
233 |
if (credential != 0) |
|
234 |
{ |
|
235 |
size += eap_tlv_header_c::get_header_length() // Size of structure header |
|
236 |
+ get_payload_size(credential); |
|
237 |
} |
|
238 |
} // for () |
|
239 |
||
240 |
return (size); |
|
241 |
} |
|
242 |
||
243 |
#endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
|
244 |
||
245 |
//-------------------------------------------------- |
|
246 |
||
247 |
EAP_FUNC_EXPORT eap_status_e eapol_handle_tlv_message_data_c::add_structured_parameter_header( |
|
248 |
const eapol_tlv_message_type_e type, |
|
249 |
const u32_t length) |
|
250 |
{ |
|
251 |
EAP_TRACE_DEBUG( |
|
252 |
m_am_tools, |
|
253 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
254 |
(EAPL("eapol_handle_tlv_message_data_c::add_structured_parameter_header(): type=%s\n"), |
|
255 |
get_type_string(type))); |
|
256 |
||
257 |
return add_message_header( |
|
258 |
type, |
|
259 |
length); |
|
260 |
} |
|
261 |
||
262 |
//-------------------------------------------------- |
|
263 |
||
264 |
EAP_FUNC_EXPORT eap_status_e eapol_handle_tlv_message_data_c::add_parameter_data( |
|
265 |
const eapol_tlv_message_type_e type, |
|
266 |
const u32_t integer) |
|
267 |
{ |
|
268 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
269 |
||
270 |
EAP_TRACE_DEBUG( |
|
271 |
m_am_tools, |
|
272 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
273 |
(EAPL("eapol_handle_tlv_message_data_c::add_parameter_data(): type=%s\n"), |
|
274 |
get_type_string(type))); |
|
275 |
||
276 |
const u32_t network_order_integer(eap_htonl(integer)); |
|
277 |
||
278 |
eap_status_e status = add_message_data( |
|
279 |
type, |
|
280 |
sizeof(network_order_integer), |
|
281 |
&network_order_integer); |
|
282 |
||
283 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
284 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
285 |
} |
|
286 |
||
287 |
//-------------------------------------------------- |
|
288 |
||
289 |
EAP_FUNC_EXPORT eap_status_e eapol_handle_tlv_message_data_c::add_parameter_data( |
|
290 |
const u64_t long_integer) |
|
291 |
{ |
|
292 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
293 |
||
294 |
EAP_TRACE_DEBUG( |
|
295 |
m_am_tools, |
|
296 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
297 |
(EAPL("eapol_handle_tlv_message_data_c::add_parameter_data(): type=%s\n"), |
|
298 |
get_type_string(eapol_tlv_message_type_u64_t))); |
|
299 |
||
300 |
const u64_t network_order_long_integer(eap_htonll(long_integer)); |
|
301 |
||
302 |
eap_status_e status = add_message_data( |
|
303 |
eapol_tlv_message_type_u64_t, |
|
304 |
sizeof(network_order_long_integer), |
|
305 |
&network_order_long_integer); |
|
306 |
||
307 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
308 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
309 |
} |
|
310 |
||
311 |
//-------------------------------------------------- |
|
312 |
||
313 |
EAP_FUNC_EXPORT eap_status_e eapol_handle_tlv_message_data_c::add_parameter_data( |
|
314 |
const u32_t integer) |
|
315 |
{ |
|
316 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
317 |
||
318 |
EAP_TRACE_DEBUG( |
|
319 |
m_am_tools, |
|
320 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
321 |
(EAPL("eapol_handle_tlv_message_data_c::add_parameter_data(): type=%s\n"), |
|
322 |
get_type_string(eapol_tlv_message_type_u32_t))); |
|
323 |
||
324 |
const u32_t network_order_integer(eap_htonl(integer)); |
|
325 |
||
326 |
eap_status_e status = add_message_data( |
|
327 |
eapol_tlv_message_type_u32_t, |
|
328 |
sizeof(network_order_integer), |
|
329 |
&network_order_integer); |
|
330 |
||
331 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
332 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
333 |
} |
|
334 |
||
335 |
//-------------------------------------------------- |
|
336 |
||
337 |
EAP_FUNC_EXPORT eap_status_e eapol_handle_tlv_message_data_c::add_parameter_data( |
|
338 |
const u16_t short_integer) |
|
339 |
{ |
|
340 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
341 |
||
342 |
EAP_TRACE_DEBUG( |
|
343 |
m_am_tools, |
|
344 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
345 |
(EAPL("eapol_handle_tlv_message_data_c::add_parameter_data(): type=%s\n"), |
|
346 |
get_type_string(eapol_tlv_message_type_u16_t))); |
|
347 |
||
348 |
const u16_t network_order_short_integer(eap_htons(short_integer)); |
|
349 |
||
350 |
eap_status_e status = add_message_data( |
|
351 |
eapol_tlv_message_type_u16_t, |
|
352 |
sizeof(network_order_short_integer), |
|
353 |
&network_order_short_integer); |
|
354 |
||
355 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
356 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
357 |
} |
|
358 |
||
359 |
//-------------------------------------------------- |
|
360 |
||
361 |
EAP_FUNC_EXPORT eap_status_e eapol_handle_tlv_message_data_c::add_parameter_data( |
|
362 |
const u8_t byte_integer) |
|
363 |
{ |
|
364 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
365 |
||
366 |
EAP_TRACE_DEBUG( |
|
367 |
m_am_tools, |
|
368 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
369 |
(EAPL("eapol_handle_tlv_message_data_c::add_parameter_data(): type=%s\n"), |
|
370 |
get_type_string(eapol_tlv_message_type_u8_t))); |
|
371 |
||
372 |
eap_status_e status = add_message_data( |
|
373 |
eapol_tlv_message_type_u8_t, |
|
374 |
sizeof(byte_integer), |
|
375 |
&byte_integer); |
|
376 |
||
377 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
378 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
379 |
} |
|
380 |
||
381 |
//-------------------------------------------------- |
|
382 |
||
383 |
EAP_FUNC_EXPORT eap_status_e eapol_handle_tlv_message_data_c::add_parameter_data( |
|
384 |
const bool boolean) |
|
385 |
{ |
|
386 |
const u32_t value((boolean == false) ? 0u: 1u); |
|
387 |
||
388 |
return add_parameter_data( |
|
389 |
eapol_tlv_message_type_boolean, |
|
390 |
value); |
|
391 |
} |
|
392 |
||
393 |
//-------------------------------------------------- |
|
394 |
||
395 |
EAP_FUNC_EXPORT eap_status_e eapol_handle_tlv_message_data_c::add_parameter_data( |
|
396 |
const eap_status_e status) |
|
397 |
{ |
|
398 |
const u32_t value(static_cast<u32_t>(status)); |
|
399 |
||
400 |
return add_parameter_data( |
|
401 |
eapol_tlv_message_type_eap_status, |
|
402 |
value); |
|
403 |
} |
|
404 |
||
405 |
//-------------------------------------------------- |
|
406 |
||
407 |
EAP_FUNC_EXPORT eap_status_e eapol_handle_tlv_message_data_c::add_parameter_data( |
|
408 |
const eapol_tlv_message_type_function_e function) |
|
409 |
{ |
|
410 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
411 |
||
412 |
EAP_TRACE_DEBUG( |
|
413 |
m_am_tools, |
|
414 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
415 |
(EAPL("eapol_handle_tlv_message_data_c::add_parameter_data(): type=%s, function=%s\n"), |
|
416 |
get_type_string(eapol_tlv_message_type_function), |
|
417 |
get_function_string(function))); |
|
418 |
||
419 |
if (function < eapol_tlv_message_type_function_none |
|
420 |
|| function >= eapol_tlv_message_type_function_illegal_value) |
|
421 |
{ |
|
422 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
423 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
424 |
} |
|
425 |
||
426 |
const u32_t network_order_function(eap_htonl(function)); |
|
427 |
||
428 |
eap_status_e status = add_message_data( |
|
429 |
eapol_tlv_message_type_function, |
|
430 |
sizeof(network_order_function), |
|
431 |
&network_order_function); |
|
432 |
||
433 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
434 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
435 |
} |
|
436 |
||
437 |
//-------------------------------------------------- |
|
438 |
||
439 |
EAP_FUNC_EXPORT eap_status_e eapol_handle_tlv_message_data_c::add_parameter_data( |
|
440 |
const eap_variable_data_c * const variable_data) |
|
441 |
{ |
|
442 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
443 |
||
444 |
EAP_TRACE_DEBUG( |
|
445 |
m_am_tools, |
|
446 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
447 |
(EAPL("eapol_handle_tlv_message_data_c::add_parameter_data(): type=%s\n"), |
|
448 |
get_type_string(eapol_tlv_message_type_variable_data))); |
|
449 |
||
450 |
if (variable_data == 0) |
|
451 |
{ |
|
452 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
453 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
454 |
} |
|
455 |
||
456 |
eap_status_e status(eap_status_process_general_error); |
|
457 |
||
458 |
if (variable_data->get_is_valid_data() == false) |
|
459 |
{ |
|
460 |
// Empty variable data. Add just the header. |
|
461 |
status = add_structured_parameter_header( |
|
462 |
eapol_tlv_message_type_variable_data, |
|
463 |
0ul); |
|
464 |
} |
|
465 |
else |
|
466 |
{ |
|
467 |
status = add_message_data( |
|
468 |
eapol_tlv_message_type_variable_data, |
|
469 |
variable_data->get_data_length(), |
|
470 |
variable_data->get_data()); |
|
471 |
} |
|
472 |
||
473 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
474 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
475 |
} |
|
476 |
||
477 |
//-------------------------------------------------- |
|
478 |
||
479 |
EAP_FUNC_EXPORT eap_status_e eapol_handle_tlv_message_data_c::add_parameter_data( |
|
480 |
const eap_am_network_id_c * const network_id) |
|
481 |
{ |
|
482 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
483 |
||
484 |
EAP_TRACE_DEBUG( |
|
485 |
m_am_tools, |
|
486 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
487 |
(EAPL("eapol_handle_tlv_message_data_c::add_parameter_data(): type=%s\n"), |
|
488 |
get_type_string(eapol_tlv_message_type_network_id))); |
|
489 |
||
490 |
if (network_id == 0 |
|
491 |
|| network_id->get_is_valid() == false) |
|
492 |
{ |
|
493 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
494 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
495 |
} |
|
496 |
||
497 |
const u32_t size_of_network_id = get_payload_size(network_id); |
|
498 |
||
499 |
eap_status_e status = add_structured_parameter_header( |
|
500 |
eapol_tlv_message_type_network_id, |
|
501 |
size_of_network_id); |
|
502 |
if (status != eap_status_ok) |
|
503 |
{ |
|
504 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
505 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
506 |
} |
|
507 |
||
508 |
status = add_parameter_data( |
|
509 |
network_id->get_source_id()); |
|
510 |
if (status != eap_status_ok) |
|
511 |
{ |
|
512 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
513 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
514 |
} |
|
515 |
||
516 |
status = add_parameter_data( |
|
517 |
network_id->get_destination_id()); |
|
518 |
if (status != eap_status_ok) |
|
519 |
{ |
|
520 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
521 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
522 |
} |
|
523 |
||
524 |
status = add_parameter_data( |
|
525 |
network_id->get_type()); |
|
526 |
if (status != eap_status_ok) |
|
527 |
{ |
|
528 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
529 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
530 |
} |
|
531 |
||
532 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
533 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
534 |
} |
|
535 |
||
536 |
//-------------------------------------------------- |
|
537 |
||
538 |
EAP_FUNC_EXPORT eap_status_e eapol_handle_tlv_message_data_c::add_parameter_data( |
|
539 |
const eap_buf_chain_wr_c * const packet_buffer) |
|
540 |
{ |
|
541 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
542 |
||
543 |
EAP_TRACE_DEBUG( |
|
544 |
m_am_tools, |
|
545 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
546 |
(EAPL("eapol_handle_tlv_message_data_c::add_parameter_data(): type=%s\n"), |
|
547 |
get_type_string(eapol_tlv_message_type_variable_data))); |
|
548 |
||
549 |
if (packet_buffer == 0 |
|
550 |
|| packet_buffer->get_is_valid() == false) |
|
551 |
{ |
|
552 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
553 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
554 |
} |
|
555 |
||
556 |
eap_status_e status = add_message_data( |
|
557 |
eapol_tlv_message_type_variable_data, |
|
558 |
packet_buffer->get_data_length(), |
|
559 |
packet_buffer->get_data(packet_buffer->get_data_length())); |
|
560 |
||
561 |
||
562 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
563 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
564 |
} |
|
565 |
||
566 |
//-------------------------------------------------- |
|
567 |
||
568 |
EAP_FUNC_EXPORT eap_status_e eapol_handle_tlv_message_data_c::add_parameter_data( |
|
569 |
const eapol_session_key_c * const session_key) |
|
570 |
{ |
|
571 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
572 |
||
573 |
EAP_TRACE_DEBUG( |
|
574 |
m_am_tools, |
|
575 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
576 |
(EAPL("eapol_handle_tlv_message_data_c::add_parameter_data(): type=%s\n"), |
|
577 |
get_type_string(eapol_tlv_message_type_session_key))); |
|
578 |
||
579 |
if (session_key == 0 |
|
580 |
|| session_key->get_is_valid() == false) |
|
581 |
{ |
|
582 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
583 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
584 |
} |
|
585 |
||
586 |
const u32_t size_of_session_key(get_payload_size(session_key)); |
|
587 |
||
588 |
eap_status_e status = add_structured_parameter_header( |
|
589 |
eapol_tlv_message_type_session_key, |
|
590 |
size_of_session_key); |
|
591 |
if (status != eap_status_ok) |
|
592 |
{ |
|
593 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
594 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
595 |
} |
|
596 |
||
597 |
status = add_parameter_data( |
|
598 |
session_key->get_key()); |
|
599 |
if (status != eap_status_ok) |
|
600 |
{ |
|
601 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
602 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
603 |
} |
|
604 |
||
605 |
status = add_parameter_data( |
|
606 |
session_key->get_sequence_number()); |
|
607 |
if (status != eap_status_ok) |
|
608 |
{ |
|
609 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
610 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
611 |
} |
|
612 |
||
613 |
status = add_parameter_data( |
|
614 |
eapol_tlv_message_type_eapol_key_type, |
|
615 |
static_cast<u32_t>(session_key->get_key_type())); |
|
616 |
if (status != eap_status_ok) |
|
617 |
{ |
|
618 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
619 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
620 |
} |
|
621 |
||
622 |
status = add_parameter_data(session_key->get_key_index()); |
|
623 |
if (status != eap_status_ok) |
|
624 |
{ |
|
625 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
626 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
627 |
} |
|
628 |
||
629 |
status = add_parameter_data(session_key->get_key_tx_bit()); |
|
630 |
if (status != eap_status_ok) |
|
631 |
{ |
|
632 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
633 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
634 |
} |
|
635 |
||
636 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
637 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
638 |
} |
|
639 |
||
640 |
//-------------------------------------------------- |
|
641 |
||
642 |
EAP_FUNC_EXPORT eap_status_e eapol_handle_tlv_message_data_c::add_parameter_data( |
|
643 |
const abs_eap_state_notification_c * const state) |
|
644 |
{ |
|
645 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
646 |
||
647 |
EAP_TRACE_DEBUG( |
|
648 |
m_am_tools, |
|
649 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
650 |
(EAPL("eapol_handle_tlv_message_data_c::add_parameter_data(): type=%s\n"), |
|
651 |
get_type_string(eapol_tlv_message_type_eap_state_notification))); |
|
652 |
||
653 |
if (state == 0) |
|
654 |
{ |
|
655 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
656 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
657 |
} |
|
658 |
||
659 |
const u32_t size_of_state(get_payload_size(state)); |
|
660 |
||
661 |
eap_status_e status = add_structured_parameter_header( |
|
662 |
eapol_tlv_message_type_eap_state_notification, |
|
663 |
size_of_state); |
|
664 |
if (status != eap_status_ok) |
|
665 |
{ |
|
666 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
667 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
668 |
} |
|
669 |
||
670 |
status = add_parameter_data(state->get_send_network_id()); |
|
671 |
if (status != eap_status_ok) |
|
672 |
{ |
|
673 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
674 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
675 |
} |
|
676 |
||
677 |
status = add_parameter_data( |
|
678 |
eapol_tlv_message_type_eap_protocol_layer, |
|
679 |
static_cast<u32_t>(state->get_protocol_layer())); |
|
680 |
if (status != eap_status_ok) |
|
681 |
{ |
|
682 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
683 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
684 |
} |
|
685 |
||
686 |
status = add_parameter_data(state->get_protocol()); |
|
687 |
if (status != eap_status_ok) |
|
688 |
{ |
|
689 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
690 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
691 |
} |
|
692 |
||
693 |
status = add_parameter_data(state->get_eap_type()); |
|
694 |
if (status != eap_status_ok) |
|
695 |
{ |
|
696 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
697 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
698 |
} |
|
699 |
||
700 |
status = add_parameter_data(state->get_current_state()); |
|
701 |
if (status != eap_status_ok) |
|
702 |
{ |
|
703 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
704 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
705 |
} |
|
706 |
||
707 |
status = add_parameter_data(state->get_is_client()); |
|
708 |
if (status != eap_status_ok) |
|
709 |
{ |
|
710 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
711 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
712 |
} |
|
713 |
||
714 |
status = add_parameter_data(state->get_authentication_error()); |
|
715 |
if (status != eap_status_ok) |
|
716 |
{ |
|
717 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
718 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
719 |
} |
|
720 |
||
721 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
722 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
723 |
} |
|
724 |
||
725 |
//-------------------------------------------------- |
|
726 |
||
727 |
EAP_FUNC_EXPORT eap_status_e eapol_handle_tlv_message_data_c::add_parameter_data( |
|
728 |
const eap_type_value_e eap_type) |
|
729 |
{ |
|
730 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
731 |
||
732 |
EAP_TRACE_DEBUG( |
|
733 |
m_am_tools, |
|
734 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
735 |
(EAPL("eapol_handle_tlv_message_data_c::add_parameter_data(): type=%s\n"), |
|
736 |
get_type_string(eapol_tlv_message_type_eap_type))); |
|
737 |
||
738 |
void * type_buffer = 0; |
|
739 |
||
740 |
eap_status_e status = allocate_message_buffer( |
|
741 |
eapol_tlv_message_type_eap_type, |
|
742 |
eap_expanded_type_c::get_eap_expanded_type_size(), |
|
743 |
&type_buffer); |
|
744 |
if (status != eap_status_ok) |
|
745 |
{ |
|
746 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
747 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
748 |
} |
|
749 |
||
750 |
status = eap_expanded_type_c::write_type( |
|
751 |
m_am_tools, |
|
752 |
0ul, ///< Index is from 0 to n. Index 0 is the first EAP type field after base EAP header. |
|
753 |
type_buffer, |
|
754 |
eap_expanded_type_c::get_eap_expanded_type_size(), |
|
755 |
true, ///< True value writes always Extented Type. |
|
756 |
eap_type ///< The EAP type to be written. |
|
757 |
); |
|
758 |
||
759 |
EAP_TRACE_DEBUG( |
|
760 |
m_am_tools, |
|
761 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
762 |
(EAPL("eap_tlv_message_data_c::add_message_data(): type %2d=0x%08x, length %3d=0x%08x\n"), |
|
763 |
eapol_tlv_message_type_eap_type, |
|
764 |
eapol_tlv_message_type_eap_type, |
|
765 |
eap_expanded_type_c::get_eap_expanded_type_size(), |
|
766 |
eap_expanded_type_c::get_eap_expanded_type_size())); |
|
767 |
||
768 |
EAP_TRACE_DATA_DEBUG( |
|
769 |
m_am_tools, |
|
770 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
771 |
(EAPL("add_message_data()"), |
|
772 |
type_buffer, |
|
773 |
eap_expanded_type_c::get_eap_expanded_type_size())); |
|
774 |
||
775 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
776 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
777 |
} |
|
778 |
||
779 |
//-------------------------------------------------- |
|
780 |
||
781 |
EAP_FUNC_EXPORT eap_status_e eapol_handle_tlv_message_data_c::add_parameter_data( |
|
782 |
const eap_general_header_base_c * const packet_data) |
|
783 |
{ |
|
784 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
785 |
||
786 |
EAP_TRACE_DEBUG( |
|
787 |
m_am_tools, |
|
788 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
789 |
(EAPL("eapol_handle_tlv_message_data_c::add_parameter_data(): type=%s\n"), |
|
790 |
get_type_string(eapol_tlv_message_type_variable_data))); |
|
791 |
||
792 |
if (packet_data == 0 |
|
793 |
|| packet_data->get_is_valid() == false) |
|
794 |
{ |
|
795 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
796 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
797 |
} |
|
798 |
||
799 |
eap_status_e status = add_message_data( |
|
800 |
eapol_tlv_message_type_variable_data, |
|
801 |
packet_data->get_header_buffer_length(), |
|
802 |
packet_data->get_header_buffer(packet_data->get_header_buffer_length())); |
|
803 |
||
804 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
805 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
806 |
} |
|
807 |
||
808 |
//-------------------------------------------------- |
|
809 |
||
810 |
#if defined(USE_EAP_SIMPLE_CONFIG) |
|
811 |
||
812 |
EAP_FUNC_EXPORT eap_status_e eapol_handle_tlv_message_data_c::add_parameter_data( |
|
813 |
EAP_TEMPLATE_CONST eap_array_c<simple_config_credential_c> * const credential_array) |
|
814 |
{ |
|
815 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
816 |
||
817 |
EAP_TRACE_DEBUG( |
|
818 |
m_am_tools, |
|
819 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
820 |
(EAPL("eapol_handle_tlv_message_data_c::add_parameter_data(): type=%s\n"), |
|
821 |
get_type_string(eapol_tlv_message_type_protected_setup_credential))); |
|
822 |
||
823 |
if (credential_array == 0) |
|
824 |
{ |
|
825 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
826 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
827 |
} |
|
828 |
||
829 |
const u32_t size_of_credential_array(get_payload_size(credential_array)); |
|
830 |
||
831 |
eap_status_e status = add_structured_parameter_header( |
|
832 |
eapol_tlv_message_type_array, |
|
833 |
size_of_credential_array); |
|
834 |
if (status != eap_status_ok) |
|
835 |
{ |
|
836 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
837 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
838 |
} |
|
839 |
||
840 |
||
841 |
for (u32_t ind_credential = 0ul; ind_credential < credential_array->get_object_count(); ind_credential++) |
|
842 |
{ |
|
843 |
simple_config_credential_c * const credential = credential_array->get_object(ind_credential); |
|
844 |
if (credential != 0) |
|
845 |
{ |
|
846 |
const u32_t size_of_credential(get_payload_size(credential)); |
|
847 |
||
848 |
eap_status_e status = add_structured_parameter_header( |
|
849 |
eapol_tlv_message_type_protected_setup_credential, |
|
850 |
size_of_credential); |
|
851 |
if (status != eap_status_ok) |
|
852 |
{ |
|
853 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
854 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
855 |
} |
|
856 |
||
857 |
status = add_parameter_data(credential->get_network_index()); |
|
858 |
if (status != eap_status_ok) |
|
859 |
{ |
|
860 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
861 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
862 |
} |
|
863 |
||
864 |
status = add_parameter_data(credential->get_SSID()); |
|
865 |
if (status != eap_status_ok) |
|
866 |
{ |
|
867 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
868 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
869 |
} |
|
870 |
||
871 |
status = add_parameter_data(static_cast<u16_t>(credential->get_Authentication_Type())); |
|
872 |
if (status != eap_status_ok) |
|
873 |
{ |
|
874 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
875 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
876 |
} |
|
877 |
||
878 |
status = add_parameter_data(static_cast<u16_t>(credential->get_Encryption_Type())); |
|
879 |
if (status != eap_status_ok) |
|
880 |
{ |
|
881 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
882 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
883 |
} |
|
884 |
||
885 |
const u32_t size_of_network_key_array(get_payload_size(credential->get_network_keys())); |
|
886 |
||
887 |
status = add_structured_parameter_header( |
|
888 |
eapol_tlv_message_type_array, |
|
889 |
size_of_network_key_array); |
|
890 |
if (status != eap_status_ok) |
|
891 |
{ |
|
892 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
893 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
894 |
} |
|
895 |
||
896 |
for (u32_t ind_network_key = 0ul; ind_network_key < credential->get_network_keys()->get_object_count(); ind_network_key++) |
|
897 |
{ |
|
898 |
network_key_and_index_c * const network_key = credential->get_network_keys()->get_object(ind_network_key); |
|
899 |
if (network_key != 0) |
|
900 |
{ |
|
901 |
const u32_t size_of_network_key(get_payload_size(network_key)); |
|
902 |
||
903 |
status = add_structured_parameter_header( |
|
904 |
eapol_tlv_message_type_network_key, |
|
905 |
size_of_network_key); |
|
906 |
if (status != eap_status_ok) |
|
907 |
{ |
|
908 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
909 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
910 |
} |
|
911 |
||
912 |
status = add_parameter_data(network_key->get_network_key_index()); |
|
913 |
if (status != eap_status_ok) |
|
914 |
{ |
|
915 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
916 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
917 |
} |
|
918 |
||
919 |
status = add_parameter_data(network_key->get_network_key()); |
|
920 |
if (status != eap_status_ok) |
|
921 |
{ |
|
922 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
923 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
924 |
} |
|
925 |
} |
|
926 |
} // for () |
|
927 |
||
928 |
status = add_parameter_data(credential->get_MAC_address()); |
|
929 |
if (status != eap_status_ok) |
|
930 |
{ |
|
931 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
932 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
933 |
} |
|
934 |
} |
|
935 |
} // for () |
|
936 |
||
937 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
938 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
939 |
} |
|
940 |
||
941 |
#endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
|
942 |
||
943 |
//-------------------------------------------------- |
|
944 |
||
945 |
EAP_FUNC_EXPORT eap_status_e eapol_handle_tlv_message_data_c::get_parameter_data( |
|
946 |
const eap_tlv_header_c * const integer_header, |
|
947 |
u64_t * const value) |
|
948 |
{ |
|
949 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
950 |
||
951 |
EAP_TRACE_DEBUG( |
|
952 |
m_am_tools, |
|
953 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
954 |
(EAPL("eapol_handle_tlv_message_data_c::get_parameter_data(): type=%s\n"), |
|
955 |
get_type_string(static_cast<eapol_tlv_message_type_e>(integer_header->get_type())))); |
|
956 |
||
957 |
EAP_TRACE_DATA_DEBUG( |
|
958 |
m_am_tools, |
|
959 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
960 |
(EAPL("get_parameter_data(u64_t *)"), |
|
961 |
integer_header->get_header_buffer(integer_header->get_header_buffer_length()), |
|
962 |
integer_header->get_header_buffer_length())); |
|
963 |
||
964 |
if (static_cast<eapol_tlv_message_type_e>(integer_header->get_type()) |
|
965 |
!= eapol_tlv_message_type_u64_t) |
|
966 |
{ |
|
967 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
968 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
969 |
} |
|
970 |
||
971 |
const u8_t * const data = integer_header->get_value(sizeof(u64_t)); |
|
972 |
if (data == 0) |
|
973 |
{ |
|
974 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
975 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
976 |
} |
|
977 |
||
978 |
*value = |
|
979 |
eap_read_u64_t_network_order( |
|
980 |
data, |
|
981 |
sizeof(u64_t)); |
|
982 |
||
983 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
984 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
985 |
} |
|
986 |
||
987 |
//-------------------------------------------------- |
|
988 |
||
989 |
EAP_FUNC_EXPORT eap_status_e eapol_handle_tlv_message_data_c::get_parameter_data( |
|
990 |
const eap_tlv_header_c * const integer_header, |
|
991 |
u32_t * const value) |
|
992 |
{ |
|
993 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
994 |
||
995 |
EAP_TRACE_DEBUG( |
|
996 |
m_am_tools, |
|
997 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
998 |
(EAPL("eapol_handle_tlv_message_data_c::get_parameter_data(): type=%s\n"), |
|
999 |
get_type_string(static_cast<eapol_tlv_message_type_e>(integer_header->get_type())))); |
|
1000 |
||
1001 |
EAP_TRACE_DATA_DEBUG( |
|
1002 |
m_am_tools, |
|
1003 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1004 |
(EAPL("get_parameter_data(u32_t *)"), |
|
1005 |
integer_header->get_header_buffer(integer_header->get_header_buffer_length()), |
|
1006 |
integer_header->get_header_buffer_length())); |
|
1007 |
||
1008 |
if (static_cast<eapol_tlv_message_type_e>(integer_header->get_type()) |
|
1009 |
!= eapol_tlv_message_type_boolean |
|
1010 |
&& static_cast<eapol_tlv_message_type_e>(integer_header->get_type()) |
|
1011 |
!= eapol_tlv_message_type_eap_protocol_layer |
|
1012 |
&& static_cast<eapol_tlv_message_type_e>(integer_header->get_type()) |
|
1013 |
!= eapol_tlv_message_type_eapol_key_802_11_authentication_mode |
|
1014 |
&& static_cast<eapol_tlv_message_type_e>(integer_header->get_type()) |
|
1015 |
!= eapol_tlv_message_type_eapol_key_authentication_type |
|
1016 |
&& static_cast<eapol_tlv_message_type_e>(integer_header->get_type()) |
|
1017 |
!= eapol_tlv_message_type_eapol_key_type |
|
1018 |
&& static_cast<eapol_tlv_message_type_e>(integer_header->get_type()) |
|
1019 |
!= eapol_tlv_message_type_eapol_tkip_mic_failure_type |
|
1020 |
&& static_cast<eapol_tlv_message_type_e>(integer_header->get_type()) |
|
1021 |
!= eapol_tlv_message_type_eapol_wlan_authentication_state |
|
1022 |
&& static_cast<eapol_tlv_message_type_e>(integer_header->get_type()) |
|
1023 |
!= eapol_tlv_message_type_error |
|
1024 |
&& static_cast<eapol_tlv_message_type_e>(integer_header->get_type()) |
|
1025 |
!= eapol_tlv_message_type_function |
|
1026 |
&& static_cast<eapol_tlv_message_type_e>(integer_header->get_type()) |
|
1027 |
!= eapol_tlv_message_type_RSNA_cipher |
|
1028 |
&& static_cast<eapol_tlv_message_type_e>(integer_header->get_type()) |
|
1029 |
!= eapol_tlv_message_type_u32_t |
|
1030 |
&& static_cast<eapol_tlv_message_type_e>(integer_header->get_type()) |
|
1031 |
!= eapol_tlv_message_type_eap_status |
|
1032 |
) |
|
1033 |
{ |
|
1034 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1035 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
1036 |
} |
|
1037 |
||
1038 |
const u8_t * const data = integer_header->get_value(sizeof(u32_t)); |
|
1039 |
if (data == 0) |
|
1040 |
{ |
|
1041 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1042 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
1043 |
} |
|
1044 |
||
1045 |
*value = |
|
1046 |
eap_read_u32_t_network_order( |
|
1047 |
data, |
|
1048 |
sizeof(u32_t)); |
|
1049 |
||
1050 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1051 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
1052 |
} |
|
1053 |
||
1054 |
//-------------------------------------------------- |
|
1055 |
||
1056 |
EAP_FUNC_EXPORT eap_status_e eapol_handle_tlv_message_data_c::get_parameter_data( |
|
1057 |
const eap_tlv_header_c * const integer_header, |
|
1058 |
u16_t * const value) |
|
1059 |
{ |
|
1060 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1061 |
||
1062 |
EAP_TRACE_DEBUG( |
|
1063 |
m_am_tools, |
|
1064 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1065 |
(EAPL("eapol_handle_tlv_message_data_c::get_parameter_data(): type=%s\n"), |
|
1066 |
get_type_string(static_cast<eapol_tlv_message_type_e>(integer_header->get_type())))); |
|
1067 |
||
1068 |
EAP_TRACE_DATA_DEBUG( |
|
1069 |
m_am_tools, |
|
1070 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1071 |
(EAPL("get_parameter_data(u16_t *)"), |
|
1072 |
integer_header->get_header_buffer(integer_header->get_header_buffer_length()), |
|
1073 |
integer_header->get_header_buffer_length())); |
|
1074 |
||
1075 |
if (static_cast<eapol_tlv_message_type_e>(integer_header->get_type()) |
|
1076 |
!= eapol_tlv_message_type_u16_t) |
|
1077 |
{ |
|
1078 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1079 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
1080 |
} |
|
1081 |
||
1082 |
const u8_t * const data = integer_header->get_value(sizeof(u16_t)); |
|
1083 |
if (data == 0) |
|
1084 |
{ |
|
1085 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1086 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
1087 |
} |
|
1088 |
||
1089 |
*value = |
|
1090 |
eap_read_u16_t_network_order( |
|
1091 |
data, |
|
1092 |
sizeof(u16_t)); |
|
1093 |
||
1094 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1095 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
1096 |
} |
|
1097 |
||
1098 |
//-------------------------------------------------- |
|
1099 |
||
1100 |
EAP_FUNC_EXPORT eap_status_e eapol_handle_tlv_message_data_c::get_parameter_data( |
|
1101 |
const eap_tlv_header_c * const integer_header, |
|
1102 |
u8_t * const value) |
|
1103 |
{ |
|
1104 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1105 |
||
1106 |
EAP_TRACE_DEBUG( |
|
1107 |
m_am_tools, |
|
1108 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1109 |
(EAPL("eapol_handle_tlv_message_data_c::get_parameter_data(): type=%s\n"), |
|
1110 |
get_type_string(static_cast<eapol_tlv_message_type_e>(integer_header->get_type())))); |
|
1111 |
||
1112 |
EAP_TRACE_DATA_DEBUG( |
|
1113 |
m_am_tools, |
|
1114 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1115 |
(EAPL("get_parameter_data(u8_t *)"), |
|
1116 |
integer_header->get_header_buffer(integer_header->get_header_buffer_length()), |
|
1117 |
integer_header->get_header_buffer_length())); |
|
1118 |
||
1119 |
if (static_cast<eapol_tlv_message_type_e>(integer_header->get_type()) |
|
1120 |
!= eapol_tlv_message_type_u8_t) |
|
1121 |
{ |
|
1122 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1123 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
1124 |
} |
|
1125 |
||
1126 |
const u8_t * const data = integer_header->get_value(sizeof(u8_t)); |
|
1127 |
if (data == 0) |
|
1128 |
{ |
|
1129 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1130 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
1131 |
} |
|
1132 |
||
1133 |
*value = *data; |
|
1134 |
||
1135 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1136 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
1137 |
} |
|
1138 |
||
1139 |
//-------------------------------------------------- |
|
1140 |
||
1141 |
EAP_FUNC_EXPORT eap_status_e eapol_handle_tlv_message_data_c::get_parameter_data( |
|
1142 |
const eap_tlv_header_c * const function_header, |
|
1143 |
eapol_tlv_message_type_function_e * const function) |
|
1144 |
{ |
|
1145 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1146 |
||
1147 |
EAP_TRACE_DEBUG( |
|
1148 |
m_am_tools, |
|
1149 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1150 |
(EAPL("eapol_handle_tlv_message_data_c::get_parameter_data(): type=%s\n"), |
|
1151 |
get_type_string(static_cast<eapol_tlv_message_type_e>(function_header->get_type())))); |
|
1152 |
||
1153 |
EAP_TRACE_DATA_DEBUG( |
|
1154 |
m_am_tools, |
|
1155 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1156 |
(EAPL("get_parameter_data(eapol_tlv_message_type_function_e *)"), |
|
1157 |
function_header->get_header_buffer(function_header->get_header_buffer_length()), |
|
1158 |
function_header->get_header_buffer_length())); |
|
1159 |
||
1160 |
if (static_cast<eapol_tlv_message_type_e>(function_header->get_type()) |
|
1161 |
!= eapol_tlv_message_type_function) |
|
1162 |
{ |
|
1163 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1164 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
1165 |
} |
|
1166 |
||
1167 |
u32_t host_order(0ul); |
|
1168 |
||
1169 |
eap_status_e status = get_parameter_data( |
|
1170 |
function_header, |
|
1171 |
&host_order); |
|
1172 |
if (status != eap_status_ok) |
|
1173 |
{ |
|
1174 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1175 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
1176 |
} |
|
1177 |
||
1178 |
*function = static_cast<eapol_tlv_message_type_function_e>(host_order); |
|
1179 |
||
1180 |
EAP_TRACE_DEBUG( |
|
1181 |
m_am_tools, |
|
1182 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1183 |
(EAPL("eapol_handle_tlv_message_data_c::get_parameter_data(): type=%s, function=%s\n"), |
|
1184 |
get_type_string(eapol_tlv_message_type_function), |
|
1185 |
get_function_string(*function) |
|
1186 |
)); |
|
1187 |
||
1188 |
if (*function < eapol_tlv_message_type_function_none |
|
1189 |
|| eapol_tlv_message_type_function_illegal_value <= *function) |
|
1190 |
{ |
|
1191 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1192 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
1193 |
} |
|
1194 |
||
1195 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1196 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1197 |
} |
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1198 |
|
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1199 |
//-------------------------------------------------- |
46 | 1200 |
|
1201 |
EAP_FUNC_EXPORT eap_status_e eapol_handle_tlv_message_data_c::get_parameter_data( |
|
1202 |
const eap_tlv_header_c * const network_id_header, |
|
1203 |
eap_am_network_id_c * const new_network_id) |
|
1204 |
{ |
|
1205 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1206 |
||
1207 |
EAP_TRACE_DEBUG( |
|
1208 |
m_am_tools, |
|
1209 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1210 |
(EAPL("eapol_handle_tlv_message_data_c::get_parameter_data(): type=%s\n"), |
|
1211 |
get_type_string(static_cast<eapol_tlv_message_type_e>(network_id_header->get_type())))); |
|
1212 |
||
1213 |
EAP_TRACE_DATA_DEBUG( |
|
1214 |
m_am_tools, |
|
1215 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1216 |
(EAPL("get_parameter_data(eap_am_network_id_c *)"), |
|
1217 |
network_id_header->get_header_buffer(network_id_header->get_header_buffer_length()), |
|
1218 |
network_id_header->get_header_buffer_length())); |
|
1219 |
||
1220 |
if (static_cast<eapol_tlv_message_type_e>(network_id_header->get_type()) |
|
1221 |
!= eapol_tlv_message_type_network_id) |
|
1222 |
{ |
|
1223 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1224 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
1225 |
} |
|
1226 |
||
1227 |
eapol_handle_tlv_message_data_c network_id_data(m_am_tools); |
|
1228 |
||
1229 |
if (network_id_data.get_is_valid() == false) |
|
1230 |
{ |
|
1231 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1232 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
1233 |
} |
|
1234 |
||
1235 |
eap_status_e status = network_id_data.set_message_data( |
|
1236 |
network_id_header->get_value_length(), |
|
1237 |
network_id_header->get_value(network_id_header->get_value_length())); |
|
1238 |
||
1239 |
if (status != eap_status_ok) |
|
1240 |
{ |
|
1241 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1242 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
1243 |
} |
|
1244 |
||
1245 |
eap_array_c<eap_tlv_header_c> network_id_members(m_am_tools); |
|
1246 |
||
1247 |
status = network_id_data.parse_message_data(&network_id_members); |
|
1248 |
||
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 |
||
1256 |
u32_t member_index(0ul); |
|
1257 |
||
1258 |
eap_variable_data_c source_id( |
|
1259 |
m_am_tools); |
|
1260 |
||
1261 |
if (source_id.get_is_valid() == false) |
|
1262 |
{ |
|
1263 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1264 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
1265 |
} |
|
1266 |
||
1267 |
{ |
|
1268 |
const eap_tlv_header_c * const source_id_header = network_id_members.get_object(member_index); |
|
1269 |
if (source_id_header == 0) |
|
1270 |
{ |
|
1271 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1272 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
1273 |
} |
|
1274 |
||
1275 |
status = network_id_data.get_parameter_data(source_id_header, &source_id); |
|
1276 |
if (status != eap_status_ok) |
|
1277 |
{ |
|
1278 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1279 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
1280 |
} |
|
1281 |
} |
|
1282 |
||
1283 |
||
1284 |
++member_index; |
|
1285 |
||
1286 |
eap_variable_data_c destination_id( |
|
1287 |
m_am_tools); |
|
1288 |
||
1289 |
if (destination_id.get_is_valid() == false) |
|
1290 |
{ |
|
1291 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1292 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
1293 |
} |
|
1294 |
||
1295 |
{ |
|
1296 |
const eap_tlv_header_c * const destination_id_header = network_id_members.get_object(member_index); |
|
1297 |
if (destination_id_header == 0) |
|
1298 |
{ |
|
1299 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1300 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
1301 |
} |
|
1302 |
||
1303 |
status = network_id_data.get_parameter_data(destination_id_header, &destination_id); |
|
1304 |
if (status != eap_status_ok) |
|
1305 |
{ |
|
1306 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1307 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
1308 |
} |
|
1309 |
} |
|
1310 |
||
1311 |
||
1312 |
++member_index; |
|
1313 |
||
1314 |
u16_t type_value(0ul); |
|
1315 |
||
1316 |
{ |
|
1317 |
const eap_tlv_header_c * const type_header = network_id_members.get_object(member_index); |
|
1318 |
if (type_header == 0) |
|
1319 |
{ |
|
1320 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1321 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
1322 |
} |
|
1323 |
||
1324 |
status = network_id_data.get_parameter_data(type_header, &type_value); |
|
1325 |
if (status != eap_status_ok) |
|
1326 |
{ |
|
1327 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1328 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
1329 |
} |
|
1330 |
} |
|
1331 |
||
1332 |
||
1333 |
status = new_network_id->set_copy_of_am_network_id( |
|
1334 |
source_id.get_data(), |
|
1335 |
source_id.get_data_length(), |
|
1336 |
destination_id.get_data(), |
|
1337 |
destination_id.get_data_length(), |
|
1338 |
type_value); |
|
1339 |
if (status != eap_status_ok) |
|
1340 |
{ |
|
1341 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1342 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
1343 |
} |
|
1344 |
||
1345 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1346 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
1347 |
} |
|
1348 |
||
1349 |
//-------------------------------------------------- |
|
1350 |
||
1351 |
EAP_FUNC_EXPORT eap_status_e eapol_handle_tlv_message_data_c::get_parameter_data( |
|
1352 |
const eap_tlv_header_c * const variable_data_header, |
|
1353 |
eap_variable_data_c * const variable_data) |
|
1354 |
{ |
|
1355 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1356 |
||
1357 |
EAP_TRACE_DEBUG( |
|
1358 |
m_am_tools, |
|
1359 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1360 |
(EAPL("eapol_handle_tlv_message_data_c::get_parameter_data(): type=%s\n"), |
|
1361 |
get_type_string(static_cast<eapol_tlv_message_type_e>(variable_data_header->get_type())))); |
|
1362 |
||
1363 |
EAP_TRACE_DATA_DEBUG( |
|
1364 |
m_am_tools, |
|
1365 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1366 |
(EAPL("get_parameter_data(eap_variable_data_c *)"), |
|
1367 |
variable_data_header->get_header_buffer(variable_data_header->get_header_buffer_length()), |
|
1368 |
variable_data_header->get_header_buffer_length())); |
|
1369 |
||
1370 |
if (static_cast<eapol_tlv_message_type_e>(variable_data_header->get_type()) |
|
1371 |
!= eapol_tlv_message_type_variable_data) |
|
1372 |
{ |
|
1373 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1374 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
1375 |
} |
|
1376 |
||
1377 |
eap_status_e status = variable_data->set_copy_of_buffer( |
|
1378 |
variable_data_header->get_value(variable_data_header->get_value_length()), |
|
1379 |
variable_data_header->get_value_length()); |
|
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 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1387 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
1388 |
} |
|
1389 |
||
1390 |
//-------------------------------------------------- |
|
1391 |
||
1392 |
EAP_FUNC_EXPORT eap_status_e eapol_handle_tlv_message_data_c::get_parameter_data( |
|
1393 |
const eap_tlv_header_c * const session_key_header, |
|
1394 |
eapol_session_key_c * const session_key) |
|
1395 |
{ |
|
1396 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1397 |
||
1398 |
EAP_TRACE_DEBUG( |
|
1399 |
m_am_tools, |
|
1400 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1401 |
(EAPL("eapol_handle_tlv_message_data_c::get_parameter_data(): type=%s\n"), |
|
1402 |
get_type_string(static_cast<eapol_tlv_message_type_e>(session_key_header->get_type())))); |
|
1403 |
||
1404 |
EAP_TRACE_DATA_DEBUG( |
|
1405 |
m_am_tools, |
|
1406 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1407 |
(EAPL("get_parameter_data(eapol_session_key_c *)"), |
|
1408 |
session_key_header->get_header_buffer(session_key_header->get_header_buffer_length()), |
|
1409 |
session_key_header->get_header_buffer_length())); |
|
1410 |
||
1411 |
if (static_cast<eapol_tlv_message_type_e>(session_key_header->get_type()) |
|
1412 |
!= eapol_tlv_message_type_session_key) |
|
1413 |
{ |
|
1414 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1415 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
1416 |
} |
|
1417 |
||
1418 |
eapol_handle_tlv_message_data_c session_key_data(m_am_tools); |
|
1419 |
||
1420 |
if (session_key_data.get_is_valid() == false) |
|
1421 |
{ |
|
1422 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1423 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
1424 |
} |
|
1425 |
||
1426 |
eap_status_e status = session_key_data.set_message_data( |
|
1427 |
session_key_header->get_value_length(), |
|
1428 |
session_key_header->get_value(session_key_header->get_value_length())); |
|
1429 |
||
1430 |
if (status != eap_status_ok) |
|
1431 |
{ |
|
1432 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1433 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
1434 |
} |
|
1435 |
||
1436 |
eap_array_c<eap_tlv_header_c> session_key_members(m_am_tools); |
|
1437 |
||
1438 |
status = session_key_data.parse_message_data(&session_key_members); |
|
1439 |
||
1440 |
if (status != eap_status_ok) |
|
1441 |
{ |
|
1442 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1443 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
1444 |
} |
|
1445 |
||
1446 |
u32_t member_index(0ul); |
|
1447 |
||
1448 |
{ |
|
1449 |
const eap_tlv_header_c * const tmp_session_key_header = session_key_members.get_object(member_index); |
|
1450 |
if (tmp_session_key_header == 0) |
|
1451 |
{ |
|
1452 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1453 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
1454 |
} |
|
1455 |
||
1456 |
eap_variable_data_c key( |
|
1457 |
m_am_tools); |
|
1458 |
||
1459 |
if (key.get_is_valid() == false) |
|
1460 |
{ |
|
1461 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1462 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
1463 |
} |
|
1464 |
||
1465 |
status = session_key_data.get_parameter_data(tmp_session_key_header, &key); |
|
1466 |
if (status != eap_status_ok) |
|
1467 |
{ |
|
1468 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1469 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
1470 |
} |
|
1471 |
||
1472 |
status = session_key->set_key(&key); |
|
1473 |
if (status != eap_status_ok) |
|
1474 |
{ |
|
1475 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1476 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
1477 |
} |
|
1478 |
} |
|
1479 |
||
1480 |
++member_index; |
|
1481 |
||
1482 |
{ |
|
1483 |
const eap_tlv_header_c * const sequence_number_header = session_key_members.get_object(member_index); |
|
1484 |
if (sequence_number_header == 0) |
|
1485 |
{ |
|
1486 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1487 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
1488 |
} |
|
1489 |
||
1490 |
eap_variable_data_c sequence_number( |
|
1491 |
m_am_tools); |
|
1492 |
||
1493 |
if (sequence_number.get_is_valid() == false) |
|
1494 |
{ |
|
1495 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1496 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
1497 |
} |
|
1498 |
||
1499 |
status = session_key_data.get_parameter_data(sequence_number_header, &sequence_number); |
|
1500 |
if (status != eap_status_ok) |
|
1501 |
{ |
|
1502 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1503 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
1504 |
} |
|
1505 |
||
1506 |
status = session_key->set_sequence_number(&sequence_number); |
|
1507 |
if (status != eap_status_ok) |
|
1508 |
{ |
|
1509 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1510 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
1511 |
} |
|
1512 |
} |
|
1513 |
||
1514 |
++member_index; |
|
1515 |
||
1516 |
{ |
|
1517 |
const eap_tlv_header_c * const key_type_header = session_key_members.get_object(member_index); |
|
1518 |
if (key_type_header == 0) |
|
1519 |
{ |
|
1520 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1521 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
1522 |
} |
|
1523 |
||
1524 |
u32_t value(0ul); |
|
1525 |
||
1526 |
status = session_key_data.get_parameter_data(key_type_header, &value); |
|
1527 |
if (status != eap_status_ok) |
|
1528 |
{ |
|
1529 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1530 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
1531 |
} |
|
1532 |
||
1533 |
session_key->set_key_type(static_cast<eapol_key_type_e>(value)); |
|
1534 |
} |
|
1535 |
||
1536 |
++member_index; |
|
1537 |
||
1538 |
{ |
|
1539 |
const eap_tlv_header_c * const key_index_header = session_key_members.get_object(member_index); |
|
1540 |
if (key_index_header == 0) |
|
1541 |
{ |
|
1542 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1543 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
1544 |
} |
|
1545 |
||
1546 |
u32_t value(0ul); |
|
1547 |
||
1548 |
status = session_key_data.get_parameter_data(key_index_header, &value); |
|
1549 |
if (status != eap_status_ok) |
|
1550 |
{ |
|
1551 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1552 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
1553 |
} |
|
1554 |
||
1555 |
session_key->set_key_index(value); |
|
1556 |
} |
|
1557 |
||
1558 |
++member_index; |
|
1559 |
||
1560 |
{ |
|
1561 |
const eap_tlv_header_c * const key_tx_bit_header = session_key_members.get_object(member_index); |
|
1562 |
if (key_tx_bit_header == 0) |
|
1563 |
{ |
|
1564 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1565 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
1566 |
} |
|
1567 |
||
1568 |
u32_t value(0ul); |
|
1569 |
||
1570 |
status = session_key_data.get_parameter_data(key_tx_bit_header, &value); |
|
1571 |
if (status != eap_status_ok) |
|
1572 |
{ |
|
1573 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1574 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
1575 |
} |
|
1576 |
||
1577 |
session_key->set_key_tx_bit((value == 0) ? false : true); |
|
1578 |
} |
|
1579 |
||
1580 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1581 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
1582 |
} |
|
1583 |
||
1584 |
//-------------------------------------------------- |
|
1585 |
||
1586 |
EAP_FUNC_EXPORT eap_status_e eapol_handle_tlv_message_data_c::get_parameter_data( |
|
1587 |
const eap_tlv_header_c * const state_header, |
|
1588 |
eap_state_notification_c * * const state) |
|
1589 |
||
1590 |
{ |
|
1591 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1592 |
||
1593 |
EAP_TRACE_DEBUG( |
|
1594 |
m_am_tools, |
|
1595 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1596 |
(EAPL("eapol_handle_tlv_message_data_c::get_parameter_data(): type=%s\n"), |
|
1597 |
get_type_string(static_cast<eapol_tlv_message_type_e>(state_header->get_type())))); |
|
1598 |
||
1599 |
EAP_TRACE_DATA_DEBUG( |
|
1600 |
m_am_tools, |
|
1601 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1602 |
(EAPL("get_parameter_data(eap_state_notification_c *)"), |
|
1603 |
state_header->get_header_buffer(state_header->get_header_buffer_length()), |
|
1604 |
state_header->get_header_buffer_length())); |
|
1605 |
||
1606 |
if (static_cast<eapol_tlv_message_type_e>(state_header->get_type()) |
|
1607 |
!= eapol_tlv_message_type_eap_state_notification) |
|
1608 |
{ |
|
1609 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1610 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
1611 |
} |
|
1612 |
||
1613 |
eapol_handle_tlv_message_data_c session_key_data(m_am_tools); |
|
1614 |
||
1615 |
if (session_key_data.get_is_valid() == false) |
|
1616 |
{ |
|
1617 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1618 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
1619 |
} |
|
1620 |
||
1621 |
eap_status_e status = session_key_data.set_message_data( |
|
1622 |
state_header->get_value_length(), |
|
1623 |
state_header->get_value(state_header->get_value_length())); |
|
1624 |
||
1625 |
if (status != eap_status_ok) |
|
1626 |
{ |
|
1627 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1628 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
1629 |
} |
|
1630 |
||
1631 |
eap_array_c<eap_tlv_header_c> session_key_members(m_am_tools); |
|
1632 |
||
1633 |
status = session_key_data.parse_message_data(&session_key_members); |
|
1634 |
if (status != eap_status_ok) |
|
1635 |
{ |
|
1636 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1637 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
1638 |
} |
|
1639 |
||
1640 |
||
1641 |
u32_t member_index(0ul); |
|
1642 |
||
1643 |
eap_am_network_id_c send_network_id(m_am_tools); |
|
1644 |
||
1645 |
{ |
|
1646 |
const eap_tlv_header_c * const send_network_id_header = session_key_members.get_object(member_index); |
|
1647 |
if (send_network_id_header == 0) |
|
1648 |
{ |
|
1649 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1650 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
1651 |
} |
|
1652 |
||
1653 |
status = get_parameter_data(send_network_id_header, &send_network_id); |
|
1654 |
if (status != eap_status_ok) |
|
1655 |
{ |
|
1656 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1657 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
1658 |
} |
|
1659 |
} |
|
1660 |
||
1661 |
||
1662 |
++member_index; |
|
1663 |
||
1664 |
eap_protocol_layer_e protocol_layer(eap_protocol_layer_none); |
|
1665 |
||
1666 |
{ |
|
1667 |
const eap_tlv_header_c * const protocol_layer_header = session_key_members.get_object(member_index); |
|
1668 |
if (protocol_layer_header == 0) |
|
1669 |
{ |
|
1670 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1671 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
1672 |
} |
|
1673 |
||
1674 |
u32_t value(0ul); |
|
1675 |
||
1676 |
status = session_key_data.get_parameter_data(protocol_layer_header, &value); |
|
1677 |
if (status != eap_status_ok) |
|
1678 |
{ |
|
1679 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1680 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
1681 |
} |
|
1682 |
||
1683 |
protocol_layer = static_cast<eap_protocol_layer_e>(value); |
|
1684 |
} |
|
1685 |
||
1686 |
||
1687 |
++member_index; |
|
1688 |
||
1689 |
u32_t protocol(0ul); |
|
1690 |
||
1691 |
{ |
|
1692 |
const eap_tlv_header_c * const protocol_header = session_key_members.get_object(member_index); |
|
1693 |
if (protocol_header == 0) |
|
1694 |
{ |
|
1695 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1696 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
1697 |
} |
|
1698 |
||
1699 |
status = session_key_data.get_parameter_data(protocol_header, &protocol); |
|
1700 |
if (status != eap_status_ok) |
|
1701 |
{ |
|
1702 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1703 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
1704 |
} |
|
1705 |
} |
|
1706 |
||
1707 |
||
1708 |
++member_index; |
|
1709 |
||
1710 |
eap_type_value_e eap_type(eap_type_none); |
|
1711 |
||
1712 |
{ |
|
1713 |
const eap_tlv_header_c * const eap_type_header = session_key_members.get_object(member_index); |
|
1714 |
if (eap_type_header == 0) |
|
1715 |
{ |
|
1716 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1717 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
1718 |
} |
|
1719 |
||
1720 |
status = session_key_data.get_parameter_data(eap_type_header, &eap_type); |
|
1721 |
if (status != eap_status_ok) |
|
1722 |
{ |
|
1723 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1724 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
1725 |
} |
|
1726 |
} |
|
1727 |
||
1728 |
||
1729 |
++member_index; |
|
1730 |
||
1731 |
u32_t current_state(0ul); |
|
1732 |
||
1733 |
{ |
|
1734 |
const eap_tlv_header_c * const current_state_header = session_key_members.get_object(member_index); |
|
1735 |
if (current_state_header == 0) |
|
1736 |
{ |
|
1737 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1738 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
1739 |
} |
|
1740 |
||
1741 |
status = session_key_data.get_parameter_data(current_state_header, ¤t_state); |
|
1742 |
if (status != eap_status_ok) |
|
1743 |
{ |
|
1744 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1745 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
1746 |
} |
|
1747 |
} |
|
1748 |
||
1749 |
||
1750 |
++member_index; |
|
1751 |
||
1752 |
bool is_client(true); |
|
1753 |
||
1754 |
{ |
|
1755 |
const eap_tlv_header_c * const is_client_header = session_key_members.get_object(member_index); |
|
1756 |
if (is_client_header == 0) |
|
1757 |
{ |
|
1758 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1759 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
1760 |
} |
|
1761 |
||
1762 |
u32_t value(0ul); |
|
1763 |
||
1764 |
status = session_key_data.get_parameter_data(is_client_header, &value); |
|
1765 |
if (status != eap_status_ok) |
|
1766 |
{ |
|
1767 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1768 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
1769 |
} |
|
1770 |
||
1771 |
is_client = (value == 0ul) ? false : true; |
|
1772 |
} |
|
1773 |
||
1774 |
||
1775 |
++member_index; |
|
1776 |
||
1777 |
eap_status_e authentication_error(eap_status_ok); |
|
1778 |
||
1779 |
{ |
|
1780 |
const eap_tlv_header_c * const authentication_error_header = session_key_members.get_object(member_index); |
|
1781 |
if (authentication_error_header == 0) |
|
1782 |
{ |
|
1783 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1784 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
1785 |
} |
|
1786 |
||
1787 |
u32_t value(0ul); |
|
1788 |
||
1789 |
status = session_key_data.get_parameter_data(authentication_error_header, &value); |
|
1790 |
if (status != eap_status_ok) |
|
1791 |
{ |
|
1792 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1793 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
1794 |
} |
|
1795 |
||
1796 |
authentication_error = static_cast<eap_status_e>(value); |
|
1797 |
} |
|
1798 |
||
1799 |
||
1800 |
if (eap_type != eap_type_none) |
|
1801 |
{ |
|
1802 |
*state = new eap_state_notification_c( |
|
1803 |
m_am_tools, |
|
1804 |
&send_network_id, |
|
1805 |
is_client, |
|
1806 |
eap_state_notification_eap, |
|
1807 |
protocol_layer, |
|
1808 |
eap_type, |
|
1809 |
current_state, |
|
1810 |
current_state, |
|
1811 |
0ul, |
|
1812 |
false); |
|
1813 |
} |
|
1814 |
else |
|
1815 |
{ |
|
1816 |
||
1817 |
||
1818 |
*state = new eap_state_notification_c( |
|
1819 |
m_am_tools, |
|
1820 |
&send_network_id, |
|
1821 |
is_client, |
|
1822 |
eap_state_notification_generic, |
|
1823 |
protocol_layer, |
|
1824 |
protocol, |
|
1825 |
current_state, |
|
1826 |
current_state, |
|
1827 |
0ul, |
|
1828 |
false); |
|
1829 |
} |
|
1830 |
||
1831 |
if ((*state) == 0) |
|
1832 |
{ |
|
1833 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1834 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
1835 |
} |
|
1836 |
||
1837 |
(*state)->set_authentication_error(authentication_error); |
|
1838 |
||
1839 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1840 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
1841 |
} |
|
1842 |
||
1843 |
//-------------------------------------------------- |
|
1844 |
||
1845 |
EAP_FUNC_EXPORT eap_status_e eapol_handle_tlv_message_data_c::get_parameter_data( |
|
1846 |
const eap_tlv_header_c * const eap_type_header, |
|
1847 |
eap_type_value_e * const eap_type) |
|
1848 |
{ |
|
1849 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1850 |
||
1851 |
EAP_TRACE_DEBUG( |
|
1852 |
m_am_tools, |
|
1853 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1854 |
(EAPL("eapol_handle_tlv_message_data_c::get_parameter_data(): type=%s\n"), |
|
1855 |
get_type_string(static_cast<eapol_tlv_message_type_e>(eap_type_header->get_type())))); |
|
1856 |
||
1857 |
EAP_TRACE_DATA_DEBUG( |
|
1858 |
m_am_tools, |
|
1859 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1860 |
(EAPL("get_parameter_data(eap_type_value_e *)"), |
|
1861 |
eap_type_header->get_header_buffer(eap_type_header->get_header_buffer_length()), |
|
1862 |
eap_type_header->get_header_buffer_length())); |
|
1863 |
||
1864 |
if (static_cast<eapol_tlv_message_type_e>(eap_type_header->get_type()) |
|
1865 |
!= eapol_tlv_message_type_eap_type) |
|
1866 |
{ |
|
1867 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1868 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
1869 |
} |
|
1870 |
||
1871 |
eap_status_e status = eap_expanded_type_c::read_type( |
|
1872 |
m_am_tools, |
|
1873 |
0ul, |
|
1874 |
eap_type_header->get_value(eap_type_header->get_value_length()), |
|
1875 |
eap_type_header->get_value_length(), |
|
1876 |
eap_type); |
|
1877 |
||
1878 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1879 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
1880 |
} |
|
1881 |
||
1882 |
//-------------------------------------------------- |
|
1883 |
||
1884 |
#if defined(USE_EAP_SIMPLE_CONFIG) |
|
1885 |
||
1886 |
EAP_FUNC_EXPORT eap_status_e eapol_handle_tlv_message_data_c::get_parameter_data( |
|
1887 |
const eap_tlv_header_c * const network_key_header, |
|
1888 |
network_key_and_index_c * const network_key) |
|
1889 |
{ |
|
1890 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1891 |
||
1892 |
EAP_TRACE_DEBUG( |
|
1893 |
m_am_tools, |
|
1894 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1895 |
(EAPL("eapol_handle_tlv_message_data_c::get_parameter_data(): type=%s\n"), |
|
1896 |
get_type_string(static_cast<eapol_tlv_message_type_e>(network_key_header->get_type())))); |
|
1897 |
||
1898 |
EAP_TRACE_DATA_DEBUG( |
|
1899 |
m_am_tools, |
|
1900 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
1901 |
(EAPL("get_parameter_data(simple_config_credential_c *)"), |
|
1902 |
network_key_header->get_header_buffer(network_key_header->get_header_buffer_length()), |
|
1903 |
network_key_header->get_header_buffer_length())); |
|
1904 |
||
1905 |
if (static_cast<eapol_tlv_message_type_e>(network_key_header->get_type()) |
|
1906 |
!= eapol_tlv_message_type_network_key) |
|
1907 |
{ |
|
1908 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1909 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
1910 |
} |
|
1911 |
||
1912 |
eapol_handle_tlv_message_data_c credential_data(m_am_tools); |
|
1913 |
||
1914 |
if (credential_data.get_is_valid() == false) |
|
1915 |
{ |
|
1916 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1917 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
1918 |
} |
|
1919 |
||
1920 |
eap_status_e status = credential_data.set_message_data( |
|
1921 |
network_key_header->get_value_length(), |
|
1922 |
network_key_header->get_value(network_key_header->get_value_length())); |
|
1923 |
||
1924 |
if (status != eap_status_ok) |
|
1925 |
{ |
|
1926 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1927 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
1928 |
} |
|
1929 |
||
1930 |
eap_array_c<eap_tlv_header_c> credential_members(m_am_tools); |
|
1931 |
||
1932 |
status = credential_data.parse_message_data(&credential_members); |
|
1933 |
||
1934 |
if (status != eap_status_ok) |
|
1935 |
{ |
|
1936 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1937 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
1938 |
} |
|
1939 |
||
1940 |
u32_t member_index(0ul); |
|
1941 |
||
1942 |
u8_t network_key_index(0ul); |
|
1943 |
||
1944 |
{ |
|
1945 |
const eap_tlv_header_c * const network_key_index_header = credential_members.get_object(member_index); |
|
1946 |
if (network_key_index_header == 0) |
|
1947 |
{ |
|
1948 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1949 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
1950 |
} |
|
1951 |
||
1952 |
status = credential_data.get_parameter_data(network_key_index_header, &network_key_index); |
|
1953 |
if (status != eap_status_ok) |
|
1954 |
{ |
|
1955 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1956 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
1957 |
} |
|
1958 |
} |
|
1959 |
||
1960 |
++member_index; |
|
1961 |
||
1962 |
eap_variable_data_c key(m_am_tools); |
|
1963 |
||
1964 |
{ |
|
1965 |
const eap_tlv_header_c * const key_header = credential_members.get_object(member_index); |
|
1966 |
if (key_header == 0) |
|
1967 |
{ |
|
1968 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1969 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
1970 |
} |
|
1971 |
||
1972 |
status = credential_data.get_parameter_data(key_header, &key); |
|
1973 |
if (status != eap_status_ok) |
|
1974 |
{ |
|
1975 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1976 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
1977 |
} |
|
1978 |
} |
|
1979 |
||
1980 |
++member_index; |
|
1981 |
||
1982 |
network_key->set_network_key_index(network_key_index); |
|
1983 |
||
1984 |
status = network_key->get_network_key()->set_copy_of_buffer(&key); |
|
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 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1992 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
1993 |
} |
|
1994 |
||
1995 |
#endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
|
1996 |
||
1997 |
//-------------------------------------------------- |
|
1998 |
||
1999 |
#if defined(USE_EAP_SIMPLE_CONFIG) |
|
2000 |
||
2001 |
EAP_FUNC_EXPORT eap_status_e eapol_handle_tlv_message_data_c::get_parameter_data( |
|
2002 |
const eap_tlv_header_c * const network_keys_array_header, |
|
2003 |
eap_array_c<network_key_and_index_c> * const network_keys_array) |
|
2004 |
{ |
|
2005 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2006 |
||
2007 |
EAP_TRACE_DEBUG( |
|
2008 |
m_am_tools, |
|
2009 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2010 |
(EAPL("eapol_handle_tlv_message_data_c::get_parameter_data(): type=%s\n"), |
|
2011 |
get_type_string(static_cast<eapol_tlv_message_type_e>(network_keys_array_header->get_type())))); |
|
2012 |
||
2013 |
EAP_TRACE_DATA_DEBUG( |
|
2014 |
m_am_tools, |
|
2015 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2016 |
(EAPL("get_parameter_data(eap_array_c<simple_config_credential_c> *)"), |
|
2017 |
network_keys_array_header->get_header_buffer(network_keys_array_header->get_header_buffer_length()), |
|
2018 |
network_keys_array_header->get_header_buffer_length())); |
|
2019 |
||
2020 |
if (static_cast<eapol_tlv_message_type_e>(network_keys_array_header->get_type()) |
|
2021 |
!= eapol_tlv_message_type_array) |
|
2022 |
{ |
|
2023 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2024 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
2025 |
} |
|
2026 |
||
2027 |
eapol_handle_tlv_message_data_c credential_array_data(m_am_tools); |
|
2028 |
||
2029 |
if (credential_array_data.get_is_valid() == false) |
|
2030 |
{ |
|
2031 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2032 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
2033 |
} |
|
2034 |
||
2035 |
eap_status_e status = credential_array_data.set_message_data( |
|
2036 |
network_keys_array_header->get_value_length(), |
|
2037 |
network_keys_array_header->get_value(network_keys_array_header->get_value_length())); |
|
2038 |
||
2039 |
if (status != eap_status_ok) |
|
2040 |
{ |
|
2041 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2042 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
2043 |
} |
|
2044 |
||
2045 |
eap_array_c<eap_tlv_header_c> credential_array_members(m_am_tools); |
|
2046 |
||
2047 |
status = credential_array_data.parse_message_data(&credential_array_members); |
|
2048 |
||
2049 |
if (status != eap_status_ok) |
|
2050 |
{ |
|
2051 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2052 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
2053 |
} |
|
2054 |
||
2055 |
||
2056 |
for (u32_t ind_member = 0ul; ind_member < credential_array_members.get_object_count(); ind_member++) |
|
2057 |
{ |
|
2058 |
network_key_and_index_c * const network_key = new network_key_and_index_c(m_am_tools); |
|
2059 |
||
2060 |
eap_automatic_variable_c<network_key_and_index_c> automatic_network_key(m_am_tools, network_key); |
|
2061 |
||
2062 |
if (network_key == 0 |
|
2063 |
|| network_key->get_is_valid() == false) |
|
2064 |
{ |
|
2065 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2066 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
2067 |
} |
|
2068 |
||
2069 |
{ |
|
2070 |
const eap_tlv_header_c * const simple_config_credential_header = credential_array_members.get_object(ind_member); |
|
2071 |
if (simple_config_credential_header == 0) |
|
2072 |
{ |
|
2073 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2074 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
2075 |
} |
|
2076 |
||
2077 |
status = credential_array_data.get_parameter_data(simple_config_credential_header, network_key); |
|
2078 |
if (status != eap_status_ok) |
|
2079 |
{ |
|
2080 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2081 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
2082 |
} |
|
2083 |
||
2084 |
automatic_network_key.do_not_free_variable(); |
|
2085 |
||
2086 |
status = network_keys_array->add_object(network_key, true); |
|
2087 |
if (status != eap_status_ok) |
|
2088 |
{ |
|
2089 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2090 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
2091 |
} |
|
2092 |
} |
|
2093 |
} // for () |
|
2094 |
||
2095 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2096 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
2097 |
} |
|
2098 |
||
2099 |
#endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
|
2100 |
||
2101 |
//-------------------------------------------------- |
|
2102 |
||
2103 |
#if defined(USE_EAP_SIMPLE_CONFIG) |
|
2104 |
||
2105 |
EAP_FUNC_EXPORT eap_status_e eapol_handle_tlv_message_data_c::get_parameter_data( |
|
2106 |
const eap_tlv_header_c * const credential_header, |
|
2107 |
simple_config_credential_c * const credential) |
|
2108 |
{ |
|
2109 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2110 |
||
2111 |
EAP_TRACE_DEBUG( |
|
2112 |
m_am_tools, |
|
2113 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2114 |
(EAPL("eapol_handle_tlv_message_data_c::get_parameter_data(): type=%s\n"), |
|
2115 |
get_type_string(static_cast<eapol_tlv_message_type_e>(credential_header->get_type())))); |
|
2116 |
||
2117 |
EAP_TRACE_DATA_DEBUG( |
|
2118 |
m_am_tools, |
|
2119 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2120 |
(EAPL("get_parameter_data(simple_config_credential_c *)"), |
|
2121 |
credential_header->get_header_buffer(credential_header->get_header_buffer_length()), |
|
2122 |
credential_header->get_header_buffer_length())); |
|
2123 |
||
2124 |
if (static_cast<eapol_tlv_message_type_e>(credential_header->get_type()) |
|
2125 |
!= eapol_tlv_message_type_protected_setup_credential) |
|
2126 |
{ |
|
2127 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2128 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
2129 |
} |
|
2130 |
||
2131 |
eapol_handle_tlv_message_data_c credential_data(m_am_tools); |
|
2132 |
||
2133 |
if (credential_data.get_is_valid() == false) |
|
2134 |
{ |
|
2135 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2136 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
2137 |
} |
|
2138 |
||
2139 |
eap_status_e status = credential_data.set_message_data( |
|
2140 |
credential_header->get_value_length(), |
|
2141 |
credential_header->get_value(credential_header->get_value_length())); |
|
2142 |
||
2143 |
if (status != eap_status_ok) |
|
2144 |
{ |
|
2145 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2146 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
2147 |
} |
|
2148 |
||
2149 |
eap_array_c<eap_tlv_header_c> credential_members(m_am_tools); |
|
2150 |
||
2151 |
status = credential_data.parse_message_data(&credential_members); |
|
2152 |
||
2153 |
if (status != eap_status_ok) |
|
2154 |
{ |
|
2155 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2156 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
2157 |
} |
|
2158 |
||
2159 |
u32_t member_index(0ul); |
|
2160 |
||
2161 |
u8_t network_index(0ul); |
|
2162 |
||
2163 |
{ |
|
2164 |
const eap_tlv_header_c * const network_index_header = credential_members.get_object(member_index); |
|
2165 |
if (network_index_header == 0) |
|
2166 |
{ |
|
2167 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2168 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
2169 |
} |
|
2170 |
||
2171 |
status = credential_data.get_parameter_data(network_index_header, &network_index); |
|
2172 |
if (status != eap_status_ok) |
|
2173 |
{ |
|
2174 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2175 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
2176 |
} |
|
2177 |
} |
|
2178 |
||
2179 |
++member_index; |
|
2180 |
||
2181 |
eap_variable_data_c SSID(m_am_tools); |
|
2182 |
||
2183 |
{ |
|
2184 |
const eap_tlv_header_c * const SSID_header = credential_members.get_object(member_index); |
|
2185 |
if (SSID_header == 0) |
|
2186 |
{ |
|
2187 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2188 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
2189 |
} |
|
2190 |
||
2191 |
status = credential_data.get_parameter_data(SSID_header, &SSID); |
|
2192 |
if (status != eap_status_ok) |
|
2193 |
{ |
|
2194 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2195 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
2196 |
} |
|
2197 |
} |
|
2198 |
||
2199 |
++member_index; |
|
2200 |
||
2201 |
simple_config_Authentication_Type_e authentication_type(simple_config_Authentication_Type_None); |
|
2202 |
||
2203 |
{ |
|
2204 |
const eap_tlv_header_c * const authentication_type_header = credential_members.get_object(member_index); |
|
2205 |
if (authentication_type_header == 0) |
|
2206 |
{ |
|
2207 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2208 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
2209 |
} |
|
2210 |
||
2211 |
u16_t integer_value(0ul); |
|
2212 |
||
2213 |
status = credential_data.get_parameter_data(authentication_type_header, &integer_value); |
|
2214 |
if (status != eap_status_ok) |
|
2215 |
{ |
|
2216 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2217 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
2218 |
} |
|
2219 |
||
2220 |
authentication_type = static_cast<simple_config_Authentication_Type_e>(integer_value); |
|
2221 |
} |
|
2222 |
||
2223 |
++member_index; |
|
2224 |
||
2225 |
simple_config_Encryption_Type_e encryption_type(simple_config_Encryption_Type_None); |
|
2226 |
||
2227 |
{ |
|
2228 |
const eap_tlv_header_c * const encryption_type_header = credential_members.get_object(member_index); |
|
2229 |
if (encryption_type_header == 0) |
|
2230 |
{ |
|
2231 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2232 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
2233 |
} |
|
2234 |
||
2235 |
u16_t integer_value(0ul); |
|
2236 |
||
2237 |
status = credential_data.get_parameter_data(encryption_type_header, &integer_value); |
|
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 |
encryption_type = static_cast<simple_config_Encryption_Type_e>(integer_value); |
|
2245 |
} |
|
2246 |
||
2247 |
++member_index; |
|
2248 |
||
2249 |
eap_array_c<network_key_and_index_c> network_keys_array(m_am_tools); |
|
2250 |
||
2251 |
{ |
|
2252 |
const eap_tlv_header_c * const network_keys_array_header = credential_members.get_object(member_index); |
|
2253 |
if (network_keys_array_header == 0) |
|
2254 |
{ |
|
2255 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2256 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
2257 |
} |
|
2258 |
||
2259 |
status = credential_data.get_parameter_data(network_keys_array_header, &network_keys_array); |
|
2260 |
if (status != eap_status_ok) |
|
2261 |
{ |
|
2262 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2263 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
2264 |
} |
|
2265 |
} |
|
2266 |
||
2267 |
++member_index; |
|
2268 |
||
2269 |
eap_variable_data_c MAC_address(m_am_tools); |
|
2270 |
||
2271 |
{ |
|
2272 |
const eap_tlv_header_c * const MAC_address_header = credential_members.get_object(member_index); |
|
2273 |
if (MAC_address_header == 0) |
|
2274 |
{ |
|
2275 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2276 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
2277 |
} |
|
2278 |
||
2279 |
status = credential_data.get_parameter_data(MAC_address_header, &MAC_address); |
|
2280 |
if (status != eap_status_ok) |
|
2281 |
{ |
|
2282 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2283 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
2284 |
} |
|
2285 |
} |
|
2286 |
||
2287 |
++member_index; |
|
2288 |
||
2289 |
||
2290 |
credential->set_network_index(network_index); |
|
2291 |
||
2292 |
status = credential->get_SSID()->set_copy_of_buffer(&SSID); |
|
2293 |
if (status != eap_status_ok) |
|
2294 |
{ |
|
2295 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2296 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
2297 |
} |
|
2298 |
||
2299 |
credential->set_Authentication_Type(authentication_type); |
|
2300 |
||
2301 |
credential->set_Encryption_Type(encryption_type); |
|
2302 |
||
2303 |
status = copy( |
|
2304 |
&network_keys_array, |
|
2305 |
credential->get_network_keys(), |
|
2306 |
m_am_tools, |
|
2307 |
false); |
|
2308 |
if (status != eap_status_ok) |
|
2309 |
{ |
|
2310 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2311 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
2312 |
} |
|
2313 |
||
2314 |
status = credential->get_MAC_address()->set_copy_of_buffer(&MAC_address); |
|
2315 |
if (status != eap_status_ok) |
|
2316 |
{ |
|
2317 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2318 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
2319 |
} |
|
2320 |
||
2321 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2322 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
2323 |
} |
|
2324 |
||
2325 |
#endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
|
2326 |
||
2327 |
//-------------------------------------------------- |
|
2328 |
||
2329 |
#if defined(USE_EAP_SIMPLE_CONFIG) |
|
2330 |
||
2331 |
EAP_FUNC_EXPORT eap_status_e eapol_handle_tlv_message_data_c::get_parameter_data( |
|
2332 |
const eap_tlv_header_c * const credential_array_header, |
|
2333 |
eap_array_c<simple_config_credential_c> * const credential_array) |
|
2334 |
{ |
|
2335 |
EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2336 |
||
2337 |
EAP_TRACE_DEBUG( |
|
2338 |
m_am_tools, |
|
2339 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2340 |
(EAPL("eapol_handle_tlv_message_data_c::get_parameter_data(): type=%s\n"), |
|
2341 |
get_type_string(static_cast<eapol_tlv_message_type_e>(credential_array_header->get_type())))); |
|
2342 |
||
2343 |
EAP_TRACE_DATA_DEBUG( |
|
2344 |
m_am_tools, |
|
2345 |
EAP_TRACE_FLAGS_MESSAGE_DATA, |
|
2346 |
(EAPL("get_parameter_data(eap_array_c<simple_config_credential_c> *)"), |
|
2347 |
credential_array_header->get_header_buffer(credential_array_header->get_header_buffer_length()), |
|
2348 |
credential_array_header->get_header_buffer_length())); |
|
2349 |
||
2350 |
if (static_cast<eapol_tlv_message_type_e>(credential_array_header->get_type()) |
|
2351 |
!= eapol_tlv_message_type_array) |
|
2352 |
{ |
|
2353 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2354 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_payload); |
|
2355 |
} |
|
2356 |
||
2357 |
eapol_handle_tlv_message_data_c credential_array_data(m_am_tools); |
|
2358 |
||
2359 |
if (credential_array_data.get_is_valid() == false) |
|
2360 |
{ |
|
2361 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2362 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
2363 |
} |
|
2364 |
||
2365 |
eap_status_e status = credential_array_data.set_message_data( |
|
2366 |
credential_array_header->get_value_length(), |
|
2367 |
credential_array_header->get_value(credential_array_header->get_value_length())); |
|
2368 |
||
2369 |
if (status != eap_status_ok) |
|
2370 |
{ |
|
2371 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2372 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
2373 |
} |
|
2374 |
||
2375 |
eap_array_c<eap_tlv_header_c> credential_array_members(m_am_tools); |
|
2376 |
||
2377 |
status = credential_array_data.parse_message_data(&credential_array_members); |
|
2378 |
||
2379 |
if (status != eap_status_ok) |
|
2380 |
{ |
|
2381 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2382 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
2383 |
} |
|
2384 |
||
2385 |
||
2386 |
for (u32_t ind_member = 0ul; ind_member < credential_array_members.get_object_count(); ind_member++) |
|
2387 |
{ |
|
2388 |
simple_config_credential_c * const simple_config_credential = new simple_config_credential_c(m_am_tools); |
|
2389 |
||
2390 |
eap_automatic_variable_c<simple_config_credential_c> automatic_simple_config_credential(m_am_tools, simple_config_credential); |
|
2391 |
||
2392 |
if (simple_config_credential == 0 |
|
2393 |
|| simple_config_credential->get_is_valid() == false) |
|
2394 |
{ |
|
2395 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2396 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
2397 |
} |
|
2398 |
||
2399 |
{ |
|
2400 |
const eap_tlv_header_c * const simple_config_credential_header = credential_array_members.get_object(ind_member); |
|
2401 |
if (simple_config_credential_header == 0) |
|
2402 |
{ |
|
2403 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2404 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter); |
|
2405 |
} |
|
2406 |
||
2407 |
status = credential_array_data.get_parameter_data(simple_config_credential_header, simple_config_credential); |
|
2408 |
if (status != eap_status_ok) |
|
2409 |
{ |
|
2410 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2411 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
2412 |
} |
|
2413 |
||
2414 |
automatic_simple_config_credential.do_not_free_variable(); |
|
2415 |
||
2416 |
status = credential_array->add_object(simple_config_credential, true); |
|
2417 |
if (status != eap_status_ok) |
|
2418 |
{ |
|
2419 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2420 |
return EAP_STATUS_RETURN(m_am_tools, status); |
|
2421 |
} |
|
2422 |
} |
|
2423 |
} // for () |
|
2424 |
||
2425 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2426 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
2427 |
} |
|
2428 |
||
2429 |
#endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
|
2430 |
||
2431 |
//-------------------------------------------------- |
|
2432 |
||
2433 |
EAP_FUNC_EXPORT eap_const_string eapol_handle_tlv_message_data_c::get_type_string(const eapol_tlv_message_type_e type) |
|
2434 |
{ |
|
2435 |
#if defined(USE_EAP_TRACE_STRINGS) |
|
2436 |
EAP_IF_RETURN_STRING(type, eapol_tlv_message_type_none) |
|
2437 |
else EAP_IF_RETURN_STRING(type, eapol_tlv_message_type_array) |
|
2438 |
else EAP_IF_RETURN_STRING(type, eapol_tlv_message_type_boolean) |
|
2439 |
else EAP_IF_RETURN_STRING(type, eapol_tlv_message_type_eap_protocol_layer) |
|
2440 |
else EAP_IF_RETURN_STRING(type, eapol_tlv_message_type_eap_state_notification) |
|
2441 |
else EAP_IF_RETURN_STRING(type, eapol_tlv_message_type_eap_type) |
|
2442 |
else EAP_IF_RETURN_STRING(type, eapol_tlv_message_type_eapol_key_802_11_authentication_mode) |
|
2443 |
else EAP_IF_RETURN_STRING(type, eapol_tlv_message_type_eapol_key_authentication_type) |
|
2444 |
else EAP_IF_RETURN_STRING(type, eapol_tlv_message_type_eapol_key_type) |
|
2445 |
else EAP_IF_RETURN_STRING(type, eapol_tlv_message_type_eapol_tkip_mic_failure_type) |
|
2446 |
else EAP_IF_RETURN_STRING(type, eapol_tlv_message_type_eapol_wlan_authentication_state) |
|
2447 |
else EAP_IF_RETURN_STRING(type, eapol_tlv_message_type_error) |
|
2448 |
else EAP_IF_RETURN_STRING(type, eapol_tlv_message_type_function) |
|
2449 |
else EAP_IF_RETURN_STRING(type, eapol_tlv_message_type_network_id) |
|
2450 |
else EAP_IF_RETURN_STRING(type, eapol_tlv_message_type_RSNA_cipher) |
|
2451 |
else EAP_IF_RETURN_STRING(type, eapol_tlv_message_type_session_key) |
|
2452 |
else EAP_IF_RETURN_STRING(type, eapol_tlv_message_type_u8_t) |
|
2453 |
else EAP_IF_RETURN_STRING(type, eapol_tlv_message_type_u16_t) |
|
2454 |
else EAP_IF_RETURN_STRING(type, eapol_tlv_message_type_u32_t) |
|
2455 |
else EAP_IF_RETURN_STRING(type, eapol_tlv_message_type_u64_t) |
|
2456 |
else EAP_IF_RETURN_STRING(type, eapol_tlv_message_type_variable_data) |
|
2457 |
else EAP_IF_RETURN_STRING(type, eapol_tlv_message_type_network_key) |
|
2458 |
else EAP_IF_RETURN_STRING(type, eapol_tlv_message_type_protected_setup_credential) |
|
2459 |
else |
|
2460 |
#endif // #if defined(USE_EAP_TRACE_STRINGS) |
|
2461 |
{ |
|
2462 |
EAP_UNREFERENCED_PARAMETER(type); |
|
2463 |
||
2464 |
return EAPL("Unknown EAPOL-TLV message type"); |
|
2465 |
} |
|
2466 |
} |
|
2467 |
||
2468 |
//-------------------------------------------------- |
|
2469 |
||
2470 |
EAP_FUNC_EXPORT eap_const_string eapol_handle_tlv_message_data_c::get_function_string(const eapol_tlv_message_type_function_e function) |
|
2471 |
{ |
|
2472 |
#if defined(USE_EAP_TRACE_STRINGS) |
|
2473 |
EAP_IF_RETURN_STRING(function, eapol_tlv_message_type_function_none) |
|
2474 |
else EAP_IF_RETURN_STRING(function, eapol_tlv_message_type_function_check_pmksa_cache) |
|
2475 |
else EAP_IF_RETURN_STRING(function, eapol_tlv_message_type_function_start_authentication) |
|
2476 |
else EAP_IF_RETURN_STRING(function, eapol_tlv_message_type_function_complete_association) |
|
2477 |
else EAP_IF_RETURN_STRING(function, eapol_tlv_message_type_function_disassociation) |
|
2478 |
else EAP_IF_RETURN_STRING(function, eapol_tlv_message_type_function_start_preauthentication) |
|
2479 |
else EAP_IF_RETURN_STRING(function, eapol_tlv_message_type_function_start_reassociation) |
|
2480 |
else EAP_IF_RETURN_STRING(function, eapol_tlv_message_type_function_complete_reassociation) |
|
2481 |
else EAP_IF_RETURN_STRING(function, eapol_tlv_message_type_function_start_WPXM_reassociation) |
|
2482 |
else EAP_IF_RETURN_STRING(function, eapol_tlv_message_type_function_complete_WPXM_reassociation) |
|
2483 |
else EAP_IF_RETURN_STRING(function, eapol_tlv_message_type_function_packet_process) |
|
2484 |
else EAP_IF_RETURN_STRING(function, eapol_tlv_message_type_function_tkip_mic_failure) |
|
2485 |
else EAP_IF_RETURN_STRING(function, eapol_tlv_message_type_function_eap_acknowledge) |
|
2486 |
else EAP_IF_RETURN_STRING(function, eapol_tlv_message_type_function_update_header_offset) |
|
2487 |
else EAP_IF_RETURN_STRING(function, eapol_tlv_message_type_function_complete_check_pmksa_cache) |
|
2488 |
else EAP_IF_RETURN_STRING(function, eapol_tlv_message_type_function_packet_send) |
|
2489 |
else EAP_IF_RETURN_STRING(function, eapol_tlv_message_type_function_associate) |
|
2490 |
else EAP_IF_RETURN_STRING(function, eapol_tlv_message_type_function_disassociate) |
|
2491 |
else EAP_IF_RETURN_STRING(function, eapol_tlv_message_type_function_packet_data_session_key) |
|
2492 |
else EAP_IF_RETURN_STRING(function, eapol_tlv_message_type_function_state_notification) |
|
2493 |
else EAP_IF_RETURN_STRING(function, eapol_tlv_message_type_function_reassociate) |
|
2494 |
else EAP_IF_RETURN_STRING(function, eapol_tlv_message_type_function_update_wlan_database_reference_values) |
|
2495 |
else EAP_IF_RETURN_STRING(function, eapol_tlv_message_type_function_complete_start_WPXM_reassociation) |
|
2496 |
else EAP_IF_RETURN_STRING(function, eapol_tlv_message_type_function_new_protected_setup_credentials) |
|
2497 |
else EAP_IF_RETURN_STRING(function, eapol_tlv_message_type_function_illegal_value) |
|
2498 |
else |
|
2499 |
#endif // #if defined(USE_EAP_TRACE_STRINGS) |
|
2500 |
{ |
|
2501 |
EAP_UNREFERENCED_PARAMETER(function); |
|
2502 |
||
2503 |
return EAPL("Unknown EAPOL-TLV message function"); |
|
2504 |
} |
|
2505 |
} |
|
2506 |
||
2507 |
//-------------------------------------------------- |
|
2508 |
||
0
c8830336c852
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2509 |
// End. |