26
|
1 |
/*
|
|
2 |
* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: EAP-plugin adaptation.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
/*
|
49
|
19 |
* %version: 34 %
|
26
|
20 |
*/
|
|
21 |
|
|
22 |
#include "eap_tools.h"
|
|
23 |
#include "eap_status.h"
|
|
24 |
#include "eap_am_export.h"
|
|
25 |
#include "eap_expanded_type.h"
|
|
26 |
#include "eap_array.h"
|
|
27 |
#include "eap_database_reference_if.h"
|
|
28 |
#include "eap_am_plugin_symbian.h"
|
|
29 |
#include "eap_automatic_variable.h"
|
|
30 |
#include <EapTypePlugin.h>
|
|
31 |
#include <EapSettings.h>
|
|
32 |
#include <EapTypeInfo.h>
|
|
33 |
#include "EapConversion.h"
|
|
34 |
#include "abs_eap_am_plugin.h"
|
49
|
35 |
#include "AbsPacStoreInitializer.h"
|
26
|
36 |
|
|
37 |
/** @file */
|
|
38 |
|
|
39 |
// ----------------------------------------------------------------------
|
|
40 |
|
|
41 |
eap_am_plugin_symbian_c::eap_am_plugin_symbian_c(
|
|
42 |
abs_eap_am_tools_c * const tools,
|
|
43 |
abs_eap_am_plugin_c * const partner)
|
|
44 |
: m_am_tools(tools)
|
|
45 |
, m_partner(partner)
|
|
46 |
, m_loaded_types(tools)
|
49
|
47 |
, m_internal_settings(0)
|
|
48 |
, m_completion_function(eap_tlv_message_type_function_none)
|
26
|
49 |
, m_is_valid(false)
|
|
50 |
, m_shutdown_was_called(false)
|
|
51 |
{
|
|
52 |
if (m_am_tools == 0
|
|
53 |
|| m_am_tools->get_is_valid() == false
|
|
54 |
|| m_partner == 0)
|
|
55 |
{
|
|
56 |
return;
|
|
57 |
}
|
|
58 |
|
|
59 |
m_is_valid = true;
|
|
60 |
|
|
61 |
EAP_TRACE_DEBUG(
|
|
62 |
m_am_tools,
|
|
63 |
TRACE_FLAGS_DEFAULT,
|
|
64 |
(EAPL("eap_am_plugin_symbian_c::eap_am_plugin_symbian_c(): this=0x%08x.\n"),
|
|
65 |
this));
|
|
66 |
}
|
|
67 |
|
|
68 |
// ----------------------------------------------------------------------
|
|
69 |
|
|
70 |
eap_am_plugin_symbian_c::~eap_am_plugin_symbian_c()
|
|
71 |
{
|
|
72 |
EAP_TRACE_DEBUG(
|
|
73 |
m_am_tools,
|
|
74 |
TRACE_FLAGS_DEFAULT,
|
|
75 |
(EAPL("eap_am_plugin_symbian_c::~eap_am_plugin_symbian_c(): this=0x%08x.\n"),
|
|
76 |
this));
|
|
77 |
|
|
78 |
EAP_TRACE_RETURN_STRING(m_am_tools, "returns: eap_am_plugin_symbian_c::~eap_am_plugin_symbian_c()");
|
|
79 |
|
|
80 |
EAP_ASSERT(m_shutdown_was_called == true);
|
49
|
81 |
|
|
82 |
delete m_internal_settings;
|
|
83 |
m_internal_settings = 0;
|
26
|
84 |
}
|
|
85 |
|
|
86 |
// ----------------------------------------------------------------------
|
|
87 |
|
|
88 |
bool eap_am_plugin_symbian_c::get_is_valid()
|
|
89 |
{
|
|
90 |
EAP_TRACE_DEBUG(
|
|
91 |
m_am_tools,
|
|
92 |
TRACE_FLAGS_DEFAULT,
|
|
93 |
(EAPL("eap_am_plugin_symbian_c::get_is_valid(): this=0x%08x, m_is_valid=%d.\n"),
|
|
94 |
this,
|
|
95 |
m_is_valid));
|
|
96 |
|
|
97 |
EAP_TRACE_RETURN_STRING(m_am_tools, "returns: eap_am_plugin_symbian_c::get_is_valid()");
|
|
98 |
|
|
99 |
return m_is_valid;
|
|
100 |
}
|
|
101 |
|
|
102 |
// ----------------------------------------------------------------------
|
|
103 |
|
|
104 |
// This is documented in abs_eap_stack_interface_c::configure().
|
|
105 |
eap_status_e eap_am_plugin_symbian_c::configure()
|
|
106 |
{
|
|
107 |
EAP_TRACE_DEBUG(
|
|
108 |
m_am_tools,
|
|
109 |
TRACE_FLAGS_DEFAULT,
|
|
110 |
(EAPL("eap_am_plugin_symbian_c::configure(): this=0x%08x.\n"),
|
|
111 |
this));
|
|
112 |
|
|
113 |
EAP_TRACE_RETURN_STRING(m_am_tools, "returns: eap_am_plugin_symbian_c::configure()");
|
|
114 |
|
|
115 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_ok);
|
|
116 |
}
|
|
117 |
|
|
118 |
// ----------------------------------------------------------------------
|
|
119 |
|
|
120 |
// This is documented in abs_eap_stack_interface_c::shutdown().
|
|
121 |
eap_status_e eap_am_plugin_symbian_c::shutdown()
|
|
122 |
{
|
|
123 |
EAP_TRACE_DEBUG(
|
|
124 |
m_am_tools,
|
|
125 |
TRACE_FLAGS_DEFAULT,
|
|
126 |
(EAPL("eap_am_plugin_symbian_c::shutdown(): this=0x%08x.\n"),
|
|
127 |
this));
|
|
128 |
|
|
129 |
EAP_TRACE_RETURN_STRING(m_am_tools, "returns: eap_am_plugin_symbian_c::shutdown()");
|
|
130 |
|
|
131 |
m_shutdown_was_called = true;
|
|
132 |
|
49
|
133 |
delete m_internal_settings;
|
|
134 |
m_internal_settings = 0;
|
|
135 |
|
26
|
136 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_ok);
|
|
137 |
}
|
|
138 |
|
|
139 |
// ----------------------------------------------------------------------
|
|
140 |
|
|
141 |
eap_status_e eap_am_plugin_symbian_c::error_complete(
|
|
142 |
const eap_status_e completion_status,
|
|
143 |
const eap_method_settings_c * const internal_settings,
|
|
144 |
const eap_tlv_message_type_function_e error_completion_function)
|
|
145 |
{
|
|
146 |
EAP_TRACE_DEBUG(
|
|
147 |
m_am_tools,
|
|
148 |
TRACE_FLAGS_DEFAULT,
|
|
149 |
(EAPL("eap_am_plugin_symbian_c::error_complete(): this=0x%08x.\n"),
|
|
150 |
this));
|
|
151 |
|
|
152 |
EAP_TRACE_RETURN_STRING(m_am_tools, "returns: eap_am_plugin_symbian_c::error_complete()");
|
|
153 |
|
|
154 |
eap_method_settings_c * const complete_settings = new eap_method_settings_c(m_am_tools, internal_settings);
|
|
155 |
|
|
156 |
eap_automatic_variable_c<eap_method_settings_c> automatic_complete_settings(
|
|
157 |
m_am_tools,
|
|
158 |
complete_settings);
|
|
159 |
|
|
160 |
if (complete_settings == 0)
|
|
161 |
{
|
|
162 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
163 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
|
|
164 |
}
|
|
165 |
|
|
166 |
complete_settings->m_completion_status = completion_status;
|
|
167 |
|
|
168 |
eap_status_e status(eap_status_not_supported);
|
|
169 |
|
|
170 |
switch(error_completion_function)
|
|
171 |
{
|
|
172 |
case eap_tlv_message_type_function_plugin_complete_get_configuration:
|
|
173 |
status = m_partner->complete_get_configuration(complete_settings);
|
|
174 |
break;
|
|
175 |
case eap_tlv_message_type_function_plugin_complete_set_configuration:
|
|
176 |
status = m_partner->complete_set_configuration(complete_settings);
|
|
177 |
break;
|
|
178 |
case eap_tlv_message_type_function_plugin_complete_copy_configuration:
|
|
179 |
status = m_partner->complete_copy_configuration(complete_settings);
|
|
180 |
break;
|
|
181 |
case eap_tlv_message_type_function_plugin_complete_delete_configuration:
|
|
182 |
status = m_partner->complete_delete_configuration(complete_settings);
|
|
183 |
break;
|
|
184 |
case eap_tlv_message_type_function_plugin_complete_set_index:
|
|
185 |
status = m_partner->complete_set_index(complete_settings);
|
|
186 |
break;
|
|
187 |
case eap_tlv_message_type_function_plugin_complete_get_type_info:
|
|
188 |
status = m_partner->complete_get_type_info(complete_settings);
|
|
189 |
break;
|
|
190 |
|
|
191 |
default:
|
|
192 |
EAP_TRACE_ERROR(
|
|
193 |
m_am_tools,
|
|
194 |
TRACE_FLAGS_DEFAULT,
|
|
195 |
(EAPL("ERROR: eap_am_plugin_symbian_c::error_complete(): unknown function %d.\n"),
|
|
196 |
error_completion_function));
|
|
197 |
|
|
198 |
EAP_ASSERT_ANYWAY_TOOLS(m_am_tools);
|
|
199 |
|
|
200 |
EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT);
|
|
201 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_parameter);
|
|
202 |
}
|
|
203 |
|
|
204 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
205 |
}
|
|
206 |
|
|
207 |
// ----------------------------------------------------------------------
|
|
208 |
|
|
209 |
CEapTypePlugin * eap_am_plugin_symbian_c::get_eap_type(
|
|
210 |
const eap_type_value_e eap_type,
|
|
211 |
u32_t index_type,
|
|
212 |
u32_t index)
|
|
213 |
{
|
|
214 |
EAP_TRACE_DEBUG(
|
|
215 |
m_am_tools,
|
|
216 |
TRACE_FLAGS_DEFAULT,
|
|
217 |
(EAPL("eap_am_plugin_symbian_c::get_eap_type(): this=0x%08x, index_type=%d, index=%d, EAP-type=0xfe%06x%08x.\n"),
|
|
218 |
this,
|
|
219 |
index_type,
|
|
220 |
index,
|
|
221 |
eap_type.get_vendor_id(),
|
|
222 |
eap_type.get_vendor_type()));
|
|
223 |
|
|
224 |
EAP_TRACE_RETURN_STRING(m_am_tools, "returns: eap_am_plugin_symbian_c::get_eap_type()");
|
|
225 |
|
|
226 |
CEapTypePlugin *eap_plugin = 0;
|
|
227 |
|
|
228 |
eap_loaded_type_c search(
|
|
229 |
m_am_tools,
|
|
230 |
0,
|
|
231 |
eap_type,
|
|
232 |
index_type,
|
|
233 |
index);
|
|
234 |
|
|
235 |
i32_t found_index = find<eap_loaded_type_c>(&m_loaded_types, &search, m_am_tools);
|
|
236 |
|
|
237 |
EAP_TRACE_DEBUG(
|
|
238 |
m_am_tools,
|
|
239 |
TRACE_FLAGS_DEFAULT,
|
|
240 |
(EAPL("eap_am_plugin_symbian_c::get_eap_type(): this=0x%08x, found_index=%d.\n"),
|
|
241 |
this,
|
|
242 |
found_index));
|
|
243 |
|
|
244 |
if (found_index >= 0)
|
|
245 |
{
|
|
246 |
// OK, EAP-type for index_type and index is already loaded.
|
|
247 |
eap_loaded_type_c * const loaded_type = m_loaded_types.get_object(found_index);
|
|
248 |
if (loaded_type == 0)
|
|
249 |
{
|
|
250 |
(void) EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
|
|
251 |
return 0;
|
|
252 |
}
|
|
253 |
|
|
254 |
eap_plugin = loaded_type->get_type_plugin();
|
|
255 |
|
|
256 |
return eap_plugin;
|
|
257 |
}
|
|
258 |
else
|
|
259 |
{
|
|
260 |
// Load a new instance of EAP-type.
|
|
261 |
|
|
262 |
TEapExpandedType expanded_type;
|
|
263 |
|
|
264 |
eap_variable_data_c eap_data(m_am_tools);
|
|
265 |
|
|
266 |
eap_status_e status = eap_type.get_expanded_type_data(
|
|
267 |
m_am_tools,
|
|
268 |
&eap_data);
|
|
269 |
if (status != eap_status_ok)
|
|
270 |
{
|
|
271 |
(void) EAP_STATUS_RETURN(m_am_tools, status);
|
|
272 |
return 0;
|
|
273 |
}
|
|
274 |
|
|
275 |
EAP_TRACE_DATA_DEBUG(
|
|
276 |
m_am_tools,
|
|
277 |
TRACE_FLAGS_DEFAULT,
|
|
278 |
(EAPL("eap_data"),
|
|
279 |
eap_data.get_data(),
|
|
280 |
eap_data.get_data_length()));
|
|
281 |
|
|
282 |
TInt error = expanded_type.SetValue(
|
|
283 |
eap_data.get_data(),
|
|
284 |
eap_data.get_data_length());
|
|
285 |
if (error != KErrNone)
|
|
286 |
{
|
|
287 |
(void) EAP_STATUS_RETURN(m_am_tools, m_am_tools->convert_am_error_to_eapol_error(error));
|
|
288 |
return 0;
|
|
289 |
}
|
|
290 |
|
|
291 |
EAP_TRACE_DATA_DEBUG(
|
|
292 |
m_am_tools,
|
|
293 |
TRACE_FLAGS_DEFAULT,
|
|
294 |
(EAPL("expanded_type.GetValue()"),
|
|
295 |
expanded_type.GetValue().Ptr(),
|
|
296 |
expanded_type.GetValue().Length()));
|
|
297 |
|
|
298 |
TIndexType IndexType(static_cast<TIndexType>(index_type));
|
|
299 |
TUint Index(static_cast<TUint>(index));
|
|
300 |
|
|
301 |
TRAP(error, (eap_plugin = CEapTypePlugin::NewL(
|
|
302 |
expanded_type.GetValue(),
|
|
303 |
IndexType,
|
49
|
304 |
Index,
|
|
305 |
m_am_tools)));
|
26
|
306 |
if (error != KErrNone
|
|
307 |
|| eap_plugin == 0)
|
|
308 |
{
|
|
309 |
// Interface not found or implementation creation function failed
|
|
310 |
EAP_TRACE_DEBUG(
|
|
311 |
m_am_tools,
|
|
312 |
TRACE_FLAGS_DEFAULT,
|
|
313 |
(EAPL("ERROR: ECom could not find/initiate implementation for EAP-type=0xfe%06x%08x, index_type=%d, index=%d, error = %d.\n"),
|
|
314 |
eap_type.get_vendor_id(),
|
|
315 |
eap_type.get_vendor_type(),
|
|
316 |
index_type,
|
|
317 |
index,
|
|
318 |
error));
|
|
319 |
(void) EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
|
|
320 |
return 0;
|
|
321 |
}
|
|
322 |
|
|
323 |
eap_loaded_type_c * const new_eap_plugin = new eap_loaded_type_c(
|
|
324 |
m_am_tools,
|
|
325 |
eap_plugin,
|
|
326 |
eap_type,
|
|
327 |
index_type,
|
|
328 |
index);
|
|
329 |
if (new_eap_plugin == 0)
|
|
330 |
{
|
|
331 |
EAP_TRACE_DEBUG(
|
|
332 |
m_am_tools,
|
|
333 |
TRACE_FLAGS_DEFAULT,
|
|
334 |
(EAPL("ERROR: Could not allocate EAP-type=0xfe%06x%08x, index_type=%d, index=%d.\n"),
|
|
335 |
eap_type.get_vendor_id(),
|
|
336 |
eap_type.get_vendor_type(),
|
|
337 |
index_type,
|
|
338 |
index));
|
|
339 |
(void) EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
|
|
340 |
delete eap_plugin;
|
|
341 |
return 0;
|
|
342 |
}
|
|
343 |
|
|
344 |
status = m_loaded_types.add_object(
|
|
345 |
new_eap_plugin,
|
|
346 |
true);
|
|
347 |
if (status != eap_status_ok)
|
|
348 |
{
|
|
349 |
EAP_TRACE_DEBUG(
|
|
350 |
m_am_tools,
|
|
351 |
TRACE_FLAGS_DEFAULT,
|
|
352 |
(EAPL("ERROR: Could not add EAP-type=0xfe%06x%08x, index_type=%d, index=%d to array.\n"),
|
|
353 |
eap_type.get_vendor_id(),
|
|
354 |
eap_type.get_vendor_type(),
|
|
355 |
index_type,
|
|
356 |
index));
|
|
357 |
(void) EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
|
|
358 |
return 0;
|
|
359 |
}
|
|
360 |
|
|
361 |
return eap_plugin;
|
|
362 |
}
|
|
363 |
}
|
|
364 |
|
|
365 |
// ----------------------------------------------------------------------
|
|
366 |
|
49
|
367 |
#if defined(USE_FAST_EAP_TYPE)
|
|
368 |
|
|
369 |
eap_status_e eap_am_plugin_symbian_c::initialize_pac_store(
|
|
370 |
const eap_method_settings_c * const internal_settings,
|
|
371 |
const eap_tlv_message_type_function_e completion_function)
|
|
372 |
{
|
|
373 |
EAP_TRACE_DEBUG(
|
|
374 |
m_am_tools,
|
|
375 |
TRACE_FLAGS_DEFAULT,
|
|
376 |
(EAPL("eap_am_plugin_symbian_c::initialize_pac_store(): this=0x%08x, completion_function=%d=%s.\n"),
|
|
377 |
this,
|
|
378 |
completion_function,
|
|
379 |
eap_process_tlv_message_data_c::get_function_string(completion_function)));
|
|
380 |
|
|
381 |
EAP_TRACE_RETURN_STRING(m_am_tools, "returns: eap_am_plugin_symbian_c::initialize_pac_store()");
|
|
382 |
|
|
383 |
if (m_completion_function != eap_tlv_message_type_function_none)
|
|
384 |
{
|
|
385 |
EAP_TRACE_DEBUG(
|
|
386 |
m_am_tools,
|
|
387 |
TRACE_FLAGS_DEFAULT,
|
|
388 |
(EAPL("ERROR: eap_am_plugin_symbian_c::initialize_pac_store(): this=0x%08x, m_completion_function=%d=%s\n"),
|
|
389 |
this,
|
|
390 |
m_completion_function,
|
|
391 |
eap_process_tlv_message_data_c::get_function_string(m_completion_function)));
|
|
392 |
EAP_ASSERT_ANYWAY_TOOLS(m_am_tools);
|
|
393 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
|
|
394 |
}
|
|
395 |
|
|
396 |
delete m_internal_settings;
|
|
397 |
|
|
398 |
m_internal_settings = new eap_method_settings_c(
|
|
399 |
m_am_tools,
|
|
400 |
internal_settings);
|
|
401 |
if (m_internal_settings == 0)
|
|
402 |
{
|
|
403 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
|
|
404 |
}
|
|
405 |
|
|
406 |
CEapTypePlugin* const eapType = get_eap_type(internal_settings->m_EAPType, internal_settings->m_IndexType, internal_settings->m_Index);
|
|
407 |
if (eapType == 0)
|
|
408 |
{
|
|
409 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error);
|
|
410 |
}
|
|
411 |
|
|
412 |
m_completion_function = completion_function;
|
|
413 |
|
|
414 |
TInt error = eapType->InitialisePacStore(this);
|
|
415 |
if (error == KErrCompletion)
|
|
416 |
{
|
|
417 |
// This is asynchronous call which will be completed by CompleteInitialisePacStore() function.
|
|
418 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_pending_request);
|
|
419 |
}
|
|
420 |
else if (error != KErrNone)
|
|
421 |
{
|
|
422 |
return EAP_STATUS_RETURN(
|
|
423 |
m_am_tools,
|
|
424 |
m_am_tools->convert_am_error_to_eapol_error(error));
|
|
425 |
}
|
|
426 |
else
|
|
427 |
{
|
|
428 |
return EAP_STATUS_RETURN(m_am_tools, eap_status_ok);
|
|
429 |
}
|
|
430 |
}
|
|
431 |
|
|
432 |
#endif //#if defined(USE_FAST_EAP_TYPE)
|
|
433 |
|
|
434 |
// ----------------------------------------------------------------------
|
|
435 |
|
26
|
436 |
eap_status_e eap_am_plugin_symbian_c::get_configuration(const eap_method_settings_c * const internal_settings)
|
|
437 |
{
|
|
438 |
EAP_TRACE_DEBUG(
|
|
439 |
m_am_tools,
|
|
440 |
TRACE_FLAGS_DEFAULT,
|
|
441 |
(EAPL("eap_am_plugin_symbian_c::get_configuration(): this=0x%08x.\n"),
|
|
442 |
this));
|
|
443 |
|
|
444 |
EAP_TRACE_RETURN_STRING(m_am_tools, "returns: eap_am_plugin_symbian_c::get_configuration()");
|
|
445 |
|
49
|
446 |
eap_status_e status(eap_status_ok);
|
|
447 |
|
|
448 |
delete m_internal_settings;
|
|
449 |
m_internal_settings = 0;
|
|
450 |
|
|
451 |
#if defined(USE_FAST_EAP_TYPE)
|
|
452 |
|
|
453 |
if (internal_settings->m_EAPType == eap_type_fast)
|
|
454 |
{
|
|
455 |
const eap_tlv_message_type_function_e error_completion_function(eap_tlv_message_type_function_plugin_complete_get_configuration);
|
|
456 |
|
|
457 |
status = initialize_pac_store(
|
|
458 |
internal_settings,
|
|
459 |
error_completion_function);
|
|
460 |
if (status == eap_status_pending_request)
|
|
461 |
{
|
|
462 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
463 |
}
|
|
464 |
else if (status != eap_status_ok)
|
|
465 |
{
|
|
466 |
return EAP_STATUS_RETURN(
|
|
467 |
m_am_tools,
|
|
468 |
error_complete(
|
|
469 |
eap_status_illegal_parameter,
|
|
470 |
internal_settings,
|
|
471 |
error_completion_function));
|
|
472 |
}
|
|
473 |
}
|
|
474 |
|
|
475 |
#endif //#if defined(USE_FAST_EAP_TYPE)
|
|
476 |
|
|
477 |
|
|
478 |
status = internal_complete_get_configuration(internal_settings);
|
|
479 |
|
|
480 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
481 |
}
|
|
482 |
|
|
483 |
// ----------------------------------------------------------------------
|
|
484 |
|
|
485 |
eap_status_e eap_am_plugin_symbian_c::internal_complete_get_configuration(const eap_method_settings_c * const internal_settings)
|
|
486 |
{
|
|
487 |
EAP_TRACE_DEBUG(
|
|
488 |
m_am_tools,
|
|
489 |
TRACE_FLAGS_DEFAULT,
|
|
490 |
(EAPL("eap_am_plugin_symbian_c::internal_complete_get_configuration(): this=0x%08x.\n"),
|
|
491 |
this));
|
|
492 |
|
|
493 |
EAP_TRACE_RETURN_STRING(m_am_tools, "returns: eap_am_plugin_symbian_c::internal_complete_get_configuration()");
|
|
494 |
|
26
|
495 |
const eap_tlv_message_type_function_e error_completion_function(eap_tlv_message_type_function_plugin_complete_get_configuration);
|
|
496 |
|
49
|
497 |
eap_status_e status(eap_status_ok);
|
|
498 |
TInt error(KErrNone);
|
|
499 |
|
26
|
500 |
CEapTypePlugin* const eapType = get_eap_type(internal_settings->m_EAPType, internal_settings->m_IndexType, internal_settings->m_Index);
|
|
501 |
if (eapType == 0)
|
|
502 |
{
|
|
503 |
return EAP_STATUS_RETURN(
|
|
504 |
m_am_tools,
|
|
505 |
error_complete(
|
|
506 |
eap_status_allocation_error,
|
|
507 |
internal_settings,
|
|
508 |
error_completion_function));
|
|
509 |
}
|
|
510 |
|
|
511 |
if (internal_settings->m_TunnelingTypePresent == true)
|
|
512 |
{
|
|
513 |
TEapExpandedType aExpandedType;
|
|
514 |
|
|
515 |
TInt err = CEapConversion::ConvertInternalTypeToExpandedEAPType(
|
|
516 |
&(internal_settings->m_TunnelingType),
|
|
517 |
&aExpandedType);
|
|
518 |
|
|
519 |
eapType->SetTunnelingType(aExpandedType);
|
|
520 |
}
|
|
521 |
|
|
522 |
EAPSettings * local_settings = new EAPSettings;
|
|
523 |
|
|
524 |
eap_automatic_variable_c<EAPSettings> automatic_aSettings(
|
|
525 |
m_am_tools,
|
|
526 |
local_settings);
|
|
527 |
|
|
528 |
if (local_settings == 0)
|
|
529 |
{
|
|
530 |
return EAP_STATUS_RETURN(
|
|
531 |
m_am_tools,
|
|
532 |
error_complete(
|
|
533 |
eap_status_allocation_error,
|
|
534 |
internal_settings,
|
|
535 |
error_completion_function));
|
|
536 |
}
|
|
537 |
|
|
538 |
TRAP(error, (eapType->GetConfigurationL(*local_settings)));
|
|
539 |
if (error != KErrNone)
|
|
540 |
{
|
|
541 |
EAP_TRACE_DEBUG(
|
|
542 |
m_am_tools,
|
|
543 |
TRACE_FLAGS_DEFAULT,
|
|
544 |
(EAPL("ERROR: Cannot read configuration from EAP-type=0xfe%06x%08x, index_type=%d, index=%d.\n"),
|
|
545 |
internal_settings->m_EAPType.get_vendor_id(),
|
|
546 |
internal_settings->m_EAPType.get_vendor_type(),
|
|
547 |
internal_settings->m_IndexType,
|
|
548 |
internal_settings->m_Index));
|
|
549 |
|
|
550 |
return EAP_STATUS_RETURN(
|
|
551 |
m_am_tools,
|
|
552 |
error_complete(
|
|
553 |
m_am_tools->convert_am_error_to_eapol_error(error),
|
|
554 |
internal_settings,
|
|
555 |
error_completion_function));
|
|
556 |
}
|
|
557 |
|
|
558 |
eap_method_settings_c * const complete_settings = new eap_method_settings_c(m_am_tools);
|
|
559 |
|
|
560 |
eap_automatic_variable_c<eap_method_settings_c> automatic_complete_settings(
|
|
561 |
m_am_tools,
|
|
562 |
complete_settings);
|
|
563 |
|
|
564 |
if (complete_settings == 0)
|
|
565 |
{
|
|
566 |
return EAP_STATUS_RETURN(
|
|
567 |
m_am_tools,
|
|
568 |
error_complete(
|
|
569 |
eap_status_allocation_error,
|
|
570 |
internal_settings,
|
|
571 |
error_completion_function));
|
|
572 |
}
|
|
573 |
|
34
|
574 |
complete_settings->m_EAPType = internal_settings->m_EAPType;
|
|
575 |
complete_settings->m_IndexType = internal_settings->m_IndexType;
|
|
576 |
complete_settings->m_Index = internal_settings->m_Index;
|
|
577 |
complete_settings->m_completion_status = eap_status_ok;
|
|
578 |
|
26
|
579 |
error = CEapConversion::ConvertEAPSettingsToInternalType(
|
|
580 |
m_am_tools,
|
|
581 |
local_settings,
|
|
582 |
complete_settings);
|
|
583 |
if (error != KErrNone)
|
|
584 |
{
|
34
|
585 |
complete_settings->m_completion_status = m_am_tools->convert_am_error_to_eapol_error(error);
|
|
586 |
|
26
|
587 |
return EAP_STATUS_RETURN(
|
|
588 |
m_am_tools,
|
|
589 |
error_complete(
|
|
590 |
m_am_tools->convert_am_error_to_eapol_error(error),
|
|
591 |
internal_settings,
|
|
592 |
error_completion_function));
|
|
593 |
}
|
|
594 |
|
49
|
595 |
status = m_partner->complete_get_configuration(complete_settings);
|
26
|
596 |
|
|
597 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
598 |
}
|
|
599 |
|
|
600 |
// ----------------------------------------------------------------------
|
|
601 |
|
|
602 |
eap_status_e eap_am_plugin_symbian_c::set_configuration(const eap_method_settings_c * const internal_settings)
|
|
603 |
{
|
|
604 |
EAP_TRACE_DEBUG(
|
|
605 |
m_am_tools,
|
|
606 |
TRACE_FLAGS_DEFAULT,
|
|
607 |
(EAPL("eap_am_plugin_symbian_c::set_configuration(): this=0x%08x.\n"),
|
|
608 |
this));
|
|
609 |
|
|
610 |
EAP_TRACE_RETURN_STRING(m_am_tools, "returns: eap_am_plugin_symbian_c::set_configuration()");
|
|
611 |
|
49
|
612 |
eap_status_e status(eap_status_ok);
|
|
613 |
|
|
614 |
delete m_internal_settings;
|
|
615 |
m_internal_settings = 0;
|
|
616 |
|
|
617 |
#if defined(USE_FAST_EAP_TYPE)
|
|
618 |
|
|
619 |
if (internal_settings->m_EAPType == eap_type_fast)
|
|
620 |
{
|
|
621 |
const eap_tlv_message_type_function_e error_completion_function(eap_tlv_message_type_function_plugin_complete_set_configuration);
|
|
622 |
|
|
623 |
status = initialize_pac_store(
|
|
624 |
internal_settings,
|
|
625 |
error_completion_function);
|
|
626 |
if (status == eap_status_pending_request)
|
|
627 |
{
|
|
628 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
629 |
}
|
|
630 |
else if (status != eap_status_ok)
|
|
631 |
{
|
|
632 |
return EAP_STATUS_RETURN(
|
|
633 |
m_am_tools,
|
|
634 |
error_complete(
|
|
635 |
eap_status_illegal_parameter,
|
|
636 |
internal_settings,
|
|
637 |
error_completion_function));
|
|
638 |
}
|
|
639 |
}
|
|
640 |
|
|
641 |
#endif //#if defined(USE_FAST_EAP_TYPE)
|
|
642 |
|
|
643 |
|
|
644 |
status = internal_complete_set_configuration(internal_settings);
|
|
645 |
|
|
646 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
647 |
}
|
|
648 |
|
|
649 |
// ----------------------------------------------------------------------
|
|
650 |
|
|
651 |
eap_status_e eap_am_plugin_symbian_c::internal_complete_set_configuration(const eap_method_settings_c * const internal_settings)
|
|
652 |
{
|
|
653 |
EAP_TRACE_DEBUG(
|
|
654 |
m_am_tools,
|
|
655 |
TRACE_FLAGS_DEFAULT,
|
|
656 |
(EAPL("eap_am_plugin_symbian_c::set_configuration(): this=0x%08x.\n"),
|
|
657 |
this));
|
|
658 |
|
|
659 |
EAP_TRACE_RETURN_STRING(m_am_tools, "returns: eap_am_plugin_symbian_c::set_configuration()");
|
|
660 |
|
26
|
661 |
const eap_tlv_message_type_function_e error_completion_function(eap_tlv_message_type_function_plugin_complete_set_configuration);
|
|
662 |
|
|
663 |
CEapTypePlugin* const eapType = get_eap_type(internal_settings->m_EAPType, internal_settings->m_IndexType, internal_settings->m_Index);
|
|
664 |
if (eapType == 0)
|
|
665 |
{
|
|
666 |
return EAP_STATUS_RETURN(
|
|
667 |
m_am_tools,
|
|
668 |
error_complete(
|
|
669 |
eap_status_allocation_error,
|
|
670 |
internal_settings,
|
|
671 |
error_completion_function));
|
|
672 |
}
|
|
673 |
|
|
674 |
if (internal_settings->m_TunnelingTypePresent == true)
|
|
675 |
{
|
|
676 |
TEapExpandedType aExpandedType;
|
|
677 |
|
|
678 |
TInt err = CEapConversion::ConvertInternalTypeToExpandedEAPType(
|
|
679 |
&(internal_settings->m_TunnelingType),
|
|
680 |
&aExpandedType);
|
|
681 |
|
|
682 |
eapType->SetTunnelingType(aExpandedType);
|
|
683 |
}
|
|
684 |
|
|
685 |
EAPSettings * local_settings = new EAPSettings;
|
|
686 |
|
|
687 |
eap_automatic_variable_c<EAPSettings> automatic_aSettings(
|
|
688 |
m_am_tools,
|
|
689 |
local_settings);
|
|
690 |
|
|
691 |
if (local_settings == 0)
|
|
692 |
{
|
|
693 |
return EAP_STATUS_RETURN(
|
|
694 |
m_am_tools,
|
|
695 |
error_complete(
|
|
696 |
eap_status_allocation_error,
|
|
697 |
internal_settings,
|
|
698 |
error_completion_function));
|
|
699 |
}
|
|
700 |
|
|
701 |
TInt error = CEapConversion::ConvertInternalTypeToEAPSettings(
|
|
702 |
m_am_tools,
|
|
703 |
internal_settings,
|
|
704 |
local_settings);
|
|
705 |
if (error != KErrNone)
|
|
706 |
{
|
|
707 |
return EAP_STATUS_RETURN(
|
|
708 |
m_am_tools,
|
|
709 |
error_complete(
|
|
710 |
m_am_tools->convert_am_error_to_eapol_error(error),
|
|
711 |
internal_settings,
|
|
712 |
error_completion_function));
|
|
713 |
}
|
|
714 |
|
|
715 |
TRAP(error, (eapType->SetConfigurationL(*local_settings)));
|
|
716 |
if (error != KErrNone)
|
|
717 |
{
|
|
718 |
EAP_TRACE_DEBUG(
|
|
719 |
m_am_tools,
|
|
720 |
TRACE_FLAGS_DEFAULT,
|
|
721 |
(EAPL("ERROR: Cannot write configuration to EAP-type=0xfe%06x%08x, index_type=%d, index=%d.\n"),
|
|
722 |
internal_settings->m_EAPType.get_vendor_id(),
|
|
723 |
internal_settings->m_EAPType.get_vendor_type(),
|
|
724 |
internal_settings->m_IndexType,
|
|
725 |
internal_settings->m_Index));
|
|
726 |
|
|
727 |
return EAP_STATUS_RETURN(
|
|
728 |
m_am_tools,
|
|
729 |
error_complete(
|
|
730 |
m_am_tools->convert_am_error_to_eapol_error(error),
|
|
731 |
internal_settings,
|
|
732 |
error_completion_function));
|
|
733 |
}
|
|
734 |
|
|
735 |
eap_method_settings_c * const complete_settings = new eap_method_settings_c(m_am_tools, internal_settings);
|
|
736 |
|
|
737 |
eap_automatic_variable_c<eap_method_settings_c> automatic_complete_settings(
|
|
738 |
m_am_tools,
|
|
739 |
complete_settings);
|
|
740 |
|
|
741 |
if (complete_settings == 0)
|
|
742 |
{
|
|
743 |
return EAP_STATUS_RETURN(
|
|
744 |
m_am_tools,
|
|
745 |
error_complete(
|
|
746 |
eap_status_allocation_error,
|
|
747 |
internal_settings,
|
|
748 |
error_completion_function));
|
|
749 |
}
|
|
750 |
|
|
751 |
complete_settings->m_completion_status = eap_status_ok;
|
|
752 |
|
|
753 |
eap_status_e status = m_partner->complete_set_configuration(complete_settings);
|
|
754 |
|
|
755 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
756 |
}
|
|
757 |
|
|
758 |
// ----------------------------------------------------------------------
|
|
759 |
|
|
760 |
eap_status_e eap_am_plugin_symbian_c::copy_configuration(const eap_method_settings_c * const internal_settings)
|
|
761 |
{
|
|
762 |
EAP_TRACE_DEBUG(
|
|
763 |
m_am_tools,
|
|
764 |
TRACE_FLAGS_DEFAULT,
|
|
765 |
(EAPL("eap_am_plugin_symbian_c::set_configuration(): this=0x%08x.\n"),
|
|
766 |
this));
|
|
767 |
|
|
768 |
EAP_TRACE_RETURN_STRING(m_am_tools, "returns: eap_am_plugin_symbian_c::set_configuration()");
|
|
769 |
|
|
770 |
const eap_tlv_message_type_function_e error_completion_function(eap_tlv_message_type_function_plugin_complete_copy_configuration);
|
|
771 |
|
|
772 |
CEapTypePlugin* const eapType = get_eap_type(internal_settings->m_EAPType, internal_settings->m_IndexType, internal_settings->m_Index);
|
|
773 |
if (eapType == 0)
|
|
774 |
{
|
|
775 |
return EAP_STATUS_RETURN(
|
|
776 |
m_am_tools,
|
|
777 |
error_complete(
|
|
778 |
eap_status_allocation_error,
|
|
779 |
internal_settings,
|
|
780 |
error_completion_function));
|
|
781 |
}
|
|
782 |
|
|
783 |
if (internal_settings->m_TunnelingTypePresent == true)
|
|
784 |
{
|
|
785 |
TEapExpandedType aExpandedType;
|
|
786 |
|
|
787 |
TInt err = CEapConversion::ConvertInternalTypeToExpandedEAPType(
|
|
788 |
&(internal_settings->m_TunnelingType),
|
|
789 |
&aExpandedType);
|
|
790 |
|
|
791 |
eapType->SetTunnelingType(aExpandedType);
|
|
792 |
}
|
|
793 |
|
|
794 |
EAPSettings * local_settings = new EAPSettings;
|
|
795 |
|
|
796 |
eap_automatic_variable_c<EAPSettings> automatic_aSettings(
|
|
797 |
m_am_tools,
|
|
798 |
local_settings);
|
|
799 |
|
|
800 |
if (local_settings == 0)
|
|
801 |
{
|
|
802 |
return EAP_STATUS_RETURN(
|
|
803 |
m_am_tools,
|
|
804 |
error_complete(
|
|
805 |
eap_status_allocation_error,
|
|
806 |
internal_settings,
|
|
807 |
error_completion_function));
|
|
808 |
}
|
|
809 |
|
|
810 |
TInt error = CEapConversion::ConvertInternalTypeToEAPSettings(
|
|
811 |
m_am_tools,
|
|
812 |
internal_settings,
|
|
813 |
local_settings);
|
|
814 |
if (error != KErrNone)
|
|
815 |
{
|
|
816 |
return EAP_STATUS_RETURN(
|
|
817 |
m_am_tools,
|
|
818 |
error_complete(
|
|
819 |
m_am_tools->convert_am_error_to_eapol_error(error),
|
|
820 |
internal_settings,
|
|
821 |
error_completion_function));
|
|
822 |
}
|
|
823 |
|
|
824 |
if (internal_settings->m_DestinationIndexAndTypePresent == false)
|
|
825 |
{
|
|
826 |
return EAP_STATUS_RETURN(
|
|
827 |
m_am_tools,
|
|
828 |
error_complete(
|
|
829 |
eap_status_illegal_parameter,
|
|
830 |
internal_settings,
|
|
831 |
error_completion_function));
|
|
832 |
}
|
|
833 |
|
|
834 |
TIndexType aDestinationIndexType(static_cast<TIndexType>(internal_settings->m_DestinationIndexType));
|
|
835 |
TUint aDestinationIndex(static_cast<TUint>(internal_settings->m_DestinationIndex));
|
|
836 |
|
|
837 |
TRAP(error, (eapType->CopySettingsL(
|
|
838 |
aDestinationIndexType,
|
|
839 |
aDestinationIndex)));
|
|
840 |
if (error != KErrNone)
|
|
841 |
{
|
|
842 |
EAP_TRACE_DEBUG(
|
|
843 |
m_am_tools,
|
|
844 |
TRACE_FLAGS_DEFAULT,
|
|
845 |
(EAPL("ERROR: Cannot copy configuration from EAP-type=0xfe%06x%08x, (index_type=%d, index=%d) to (index_type=%d, index=%d).\n"),
|
|
846 |
internal_settings->m_EAPType.get_vendor_id(),
|
|
847 |
internal_settings->m_EAPType.get_vendor_type(),
|
|
848 |
internal_settings->m_IndexType,
|
|
849 |
internal_settings->m_Index,
|
|
850 |
internal_settings->m_DestinationIndexType,
|
|
851 |
internal_settings->m_DestinationIndex));
|
|
852 |
|
|
853 |
return EAP_STATUS_RETURN(
|
|
854 |
m_am_tools,
|
|
855 |
error_complete(
|
|
856 |
m_am_tools->convert_am_error_to_eapol_error(error),
|
|
857 |
internal_settings,
|
|
858 |
error_completion_function));
|
|
859 |
}
|
|
860 |
|
|
861 |
eap_method_settings_c * const complete_settings = new eap_method_settings_c(m_am_tools, internal_settings);
|
|
862 |
|
|
863 |
eap_automatic_variable_c<eap_method_settings_c> automatic_complete_settings(
|
|
864 |
m_am_tools,
|
|
865 |
complete_settings);
|
|
866 |
|
|
867 |
if (complete_settings == 0)
|
|
868 |
{
|
|
869 |
return EAP_STATUS_RETURN(
|
|
870 |
m_am_tools,
|
|
871 |
error_complete(
|
|
872 |
eap_status_allocation_error,
|
|
873 |
internal_settings,
|
|
874 |
error_completion_function));
|
|
875 |
}
|
|
876 |
|
|
877 |
complete_settings->m_completion_status = eap_status_ok;
|
|
878 |
|
|
879 |
eap_status_e status = m_partner->complete_copy_configuration(complete_settings);
|
|
880 |
|
|
881 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
882 |
}
|
|
883 |
|
|
884 |
// ----------------------------------------------------------------------
|
|
885 |
|
|
886 |
eap_status_e eap_am_plugin_symbian_c::delete_configuration(const eap_method_settings_c * const internal_settings)
|
|
887 |
{
|
|
888 |
EAP_TRACE_DEBUG(
|
|
889 |
m_am_tools,
|
|
890 |
TRACE_FLAGS_DEFAULT,
|
|
891 |
(EAPL("eap_am_plugin_symbian_c::delete_configuration(): this=0x%08x.\n"),
|
|
892 |
this));
|
|
893 |
|
|
894 |
EAP_TRACE_RETURN_STRING(m_am_tools, "returns: eap_am_plugin_symbian_c::delete_configuration()");
|
|
895 |
|
|
896 |
const eap_tlv_message_type_function_e error_completion_function(eap_tlv_message_type_function_plugin_complete_delete_configuration);
|
|
897 |
|
|
898 |
CEapTypePlugin* const eapType = get_eap_type(internal_settings->m_EAPType, internal_settings->m_IndexType, internal_settings->m_Index);
|
|
899 |
if (eapType == 0)
|
|
900 |
{
|
|
901 |
return EAP_STATUS_RETURN(
|
|
902 |
m_am_tools,
|
|
903 |
error_complete(
|
|
904 |
eap_status_allocation_error,
|
|
905 |
internal_settings,
|
|
906 |
error_completion_function));
|
|
907 |
}
|
|
908 |
|
|
909 |
if (internal_settings->m_TunnelingTypePresent == true)
|
|
910 |
{
|
|
911 |
TEapExpandedType aExpandedType;
|
|
912 |
|
|
913 |
TInt err = CEapConversion::ConvertInternalTypeToExpandedEAPType(
|
|
914 |
&(internal_settings->m_TunnelingType),
|
|
915 |
&aExpandedType);
|
|
916 |
|
|
917 |
eapType->SetTunnelingType(aExpandedType);
|
|
918 |
}
|
|
919 |
|
|
920 |
EAPSettings * local_settings = new EAPSettings;
|
|
921 |
|
|
922 |
eap_automatic_variable_c<EAPSettings> automatic_aSettings(
|
|
923 |
m_am_tools,
|
|
924 |
local_settings);
|
|
925 |
|
|
926 |
if (local_settings == 0)
|
|
927 |
{
|
|
928 |
return EAP_STATUS_RETURN(
|
|
929 |
m_am_tools,
|
|
930 |
error_complete(
|
|
931 |
eap_status_allocation_error,
|
|
932 |
internal_settings,
|
|
933 |
error_completion_function));
|
|
934 |
}
|
|
935 |
|
|
936 |
TInt error = CEapConversion::ConvertInternalTypeToEAPSettings(
|
|
937 |
m_am_tools,
|
|
938 |
internal_settings,
|
|
939 |
local_settings);
|
|
940 |
if (error != KErrNone)
|
|
941 |
{
|
|
942 |
return EAP_STATUS_RETURN(
|
|
943 |
m_am_tools,
|
|
944 |
error_complete(
|
|
945 |
m_am_tools->convert_am_error_to_eapol_error(error),
|
|
946 |
internal_settings,
|
|
947 |
error_completion_function));
|
|
948 |
}
|
|
949 |
|
|
950 |
TRAP(error, (eapType->DeleteConfigurationL()));
|
|
951 |
if (error != KErrNone)
|
|
952 |
{
|
|
953 |
EAP_TRACE_DEBUG(
|
|
954 |
m_am_tools,
|
|
955 |
TRACE_FLAGS_DEFAULT,
|
|
956 |
(EAPL("ERROR: Cannot delete configuration from EAP-type=0xfe%06x%08x, (index_type=%d, index=%d).\n"),
|
|
957 |
internal_settings->m_EAPType.get_vendor_id(),
|
|
958 |
internal_settings->m_EAPType.get_vendor_type(),
|
|
959 |
internal_settings->m_IndexType,
|
|
960 |
internal_settings->m_Index));
|
|
961 |
|
|
962 |
return EAP_STATUS_RETURN(
|
|
963 |
m_am_tools,
|
|
964 |
error_complete(
|
|
965 |
m_am_tools->convert_am_error_to_eapol_error(error),
|
|
966 |
internal_settings,
|
|
967 |
error_completion_function));
|
|
968 |
}
|
|
969 |
|
|
970 |
eap_method_settings_c * const complete_settings = new eap_method_settings_c(m_am_tools, internal_settings);
|
|
971 |
|
|
972 |
eap_automatic_variable_c<eap_method_settings_c> automatic_complete_settings(
|
|
973 |
m_am_tools,
|
|
974 |
complete_settings);
|
|
975 |
|
|
976 |
if (complete_settings == 0)
|
|
977 |
{
|
|
978 |
return EAP_STATUS_RETURN(
|
|
979 |
m_am_tools,
|
|
980 |
error_complete(
|
|
981 |
eap_status_allocation_error,
|
|
982 |
internal_settings,
|
|
983 |
error_completion_function));
|
|
984 |
}
|
|
985 |
|
|
986 |
complete_settings->m_completion_status = eap_status_ok;
|
|
987 |
|
|
988 |
eap_status_e status = m_partner->complete_delete_configuration(complete_settings);
|
|
989 |
|
|
990 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
991 |
}
|
|
992 |
|
|
993 |
// ----------------------------------------------------------------------
|
|
994 |
|
|
995 |
eap_status_e eap_am_plugin_symbian_c::set_index(const eap_method_settings_c * const internal_settings)
|
|
996 |
{
|
|
997 |
EAP_TRACE_DEBUG(
|
|
998 |
m_am_tools,
|
|
999 |
TRACE_FLAGS_DEFAULT,
|
|
1000 |
(EAPL("eap_am_plugin_symbian_c::set_index(): this=0x%08x.\n"),
|
|
1001 |
this));
|
|
1002 |
|
|
1003 |
EAP_TRACE_RETURN_STRING(m_am_tools, "returns: eap_am_plugin_symbian_c::set_index()");
|
|
1004 |
|
|
1005 |
const eap_tlv_message_type_function_e error_completion_function(eap_tlv_message_type_function_plugin_complete_set_index);
|
|
1006 |
|
|
1007 |
CEapTypePlugin* const eapType = get_eap_type(internal_settings->m_EAPType, internal_settings->m_IndexType, internal_settings->m_Index);
|
|
1008 |
if (eapType == 0)
|
|
1009 |
{
|
|
1010 |
return EAP_STATUS_RETURN(
|
|
1011 |
m_am_tools,
|
|
1012 |
error_complete(
|
|
1013 |
eap_status_allocation_error,
|
|
1014 |
internal_settings,
|
|
1015 |
error_completion_function));
|
|
1016 |
}
|
|
1017 |
|
|
1018 |
if (internal_settings->m_TunnelingTypePresent == true)
|
|
1019 |
{
|
|
1020 |
TEapExpandedType aExpandedType;
|
|
1021 |
|
|
1022 |
TInt err = CEapConversion::ConvertInternalTypeToExpandedEAPType(
|
|
1023 |
&(internal_settings->m_TunnelingType),
|
|
1024 |
&aExpandedType);
|
|
1025 |
|
|
1026 |
eapType->SetTunnelingType(aExpandedType);
|
|
1027 |
}
|
|
1028 |
|
|
1029 |
EAPSettings * local_settings = new EAPSettings;
|
|
1030 |
|
|
1031 |
eap_automatic_variable_c<EAPSettings> automatic_aSettings(
|
|
1032 |
m_am_tools,
|
|
1033 |
local_settings);
|
|
1034 |
|
|
1035 |
if (local_settings == 0)
|
|
1036 |
{
|
|
1037 |
return EAP_STATUS_RETURN(
|
|
1038 |
m_am_tools,
|
|
1039 |
error_complete(
|
|
1040 |
eap_status_allocation_error,
|
|
1041 |
internal_settings,
|
|
1042 |
error_completion_function));
|
|
1043 |
}
|
|
1044 |
|
|
1045 |
TInt error = CEapConversion::ConvertInternalTypeToEAPSettings(
|
|
1046 |
m_am_tools,
|
|
1047 |
internal_settings,
|
|
1048 |
local_settings);
|
|
1049 |
if (error != KErrNone)
|
|
1050 |
{
|
|
1051 |
return EAP_STATUS_RETURN(
|
|
1052 |
m_am_tools,
|
|
1053 |
error_complete(
|
|
1054 |
m_am_tools->convert_am_error_to_eapol_error(error),
|
|
1055 |
internal_settings,
|
|
1056 |
error_completion_function));
|
|
1057 |
}
|
|
1058 |
|
|
1059 |
if (internal_settings->m_DestinationIndexAndTypePresent == false)
|
|
1060 |
{
|
|
1061 |
return EAP_STATUS_RETURN(
|
|
1062 |
m_am_tools,
|
|
1063 |
error_complete(
|
|
1064 |
eap_status_illegal_parameter,
|
|
1065 |
internal_settings,
|
|
1066 |
error_completion_function));
|
|
1067 |
}
|
|
1068 |
|
|
1069 |
TIndexType aDestinationIndexType(static_cast<TIndexType>(internal_settings->m_DestinationIndexType));
|
|
1070 |
TUint aDestinationIndex(static_cast<TUint>(internal_settings->m_DestinationIndex));
|
|
1071 |
|
|
1072 |
TRAP(error, (eapType->SetIndexL(
|
|
1073 |
aDestinationIndexType,
|
|
1074 |
aDestinationIndex)));
|
|
1075 |
if (error != KErrNone)
|
|
1076 |
{
|
|
1077 |
EAP_TRACE_DEBUG(
|
|
1078 |
m_am_tools,
|
|
1079 |
TRACE_FLAGS_DEFAULT,
|
|
1080 |
(EAPL("ERROR: Cannot copy configuration from EAP-type=0xfe%06x%08x, (index_type=%d, index=%d) to (index_type=%d, index=%d).\n"),
|
|
1081 |
internal_settings->m_EAPType.get_vendor_id(),
|
|
1082 |
internal_settings->m_EAPType.get_vendor_type(),
|
|
1083 |
internal_settings->m_IndexType,
|
|
1084 |
internal_settings->m_Index,
|
|
1085 |
internal_settings->m_DestinationIndexType,
|
|
1086 |
internal_settings->m_DestinationIndex));
|
|
1087 |
|
|
1088 |
return EAP_STATUS_RETURN(
|
|
1089 |
m_am_tools,
|
|
1090 |
error_complete(
|
|
1091 |
m_am_tools->convert_am_error_to_eapol_error(error),
|
|
1092 |
internal_settings,
|
|
1093 |
error_completion_function));
|
|
1094 |
}
|
|
1095 |
|
|
1096 |
eap_method_settings_c * const complete_settings = new eap_method_settings_c(m_am_tools, internal_settings);
|
|
1097 |
|
|
1098 |
eap_automatic_variable_c<eap_method_settings_c> automatic_complete_settings(
|
|
1099 |
m_am_tools,
|
|
1100 |
complete_settings);
|
|
1101 |
|
|
1102 |
if (complete_settings == 0)
|
|
1103 |
{
|
|
1104 |
return EAP_STATUS_RETURN(
|
|
1105 |
m_am_tools,
|
|
1106 |
error_complete(
|
|
1107 |
eap_status_allocation_error,
|
|
1108 |
internal_settings,
|
|
1109 |
error_completion_function));
|
|
1110 |
}
|
|
1111 |
|
|
1112 |
complete_settings->m_completion_status = eap_status_ok;
|
|
1113 |
|
|
1114 |
eap_status_e status = m_partner->complete_set_index(complete_settings);
|
|
1115 |
|
|
1116 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
1117 |
}
|
|
1118 |
|
|
1119 |
// ----------------------------------------------------------------------
|
|
1120 |
|
|
1121 |
eap_status_e eap_am_plugin_symbian_c::get_type_info(const eap_method_settings_c * const internal_settings)
|
|
1122 |
{
|
|
1123 |
EAP_TRACE_DEBUG(
|
|
1124 |
m_am_tools,
|
|
1125 |
TRACE_FLAGS_DEFAULT,
|
|
1126 |
(EAPL("eap_am_plugin_symbian_c::get_type_info(): this=0x%08x.\n"),
|
|
1127 |
this));
|
|
1128 |
|
|
1129 |
EAP_TRACE_RETURN_STRING(m_am_tools, "returns: eap_am_plugin_symbian_c::get_type_info()");
|
|
1130 |
|
|
1131 |
const eap_tlv_message_type_function_e error_completion_function(eap_tlv_message_type_function_plugin_complete_get_type_info);
|
|
1132 |
|
|
1133 |
CEapTypePlugin* const eapType = get_eap_type(internal_settings->m_EAPType, internal_settings->m_IndexType, internal_settings->m_Index);
|
|
1134 |
if (eapType == 0)
|
|
1135 |
{
|
|
1136 |
return EAP_STATUS_RETURN(
|
|
1137 |
m_am_tools,
|
|
1138 |
error_complete(
|
|
1139 |
eap_status_allocation_error,
|
|
1140 |
internal_settings,
|
|
1141 |
error_completion_function));
|
|
1142 |
}
|
|
1143 |
|
|
1144 |
if (internal_settings->m_TunnelingTypePresent == true)
|
|
1145 |
{
|
|
1146 |
TEapExpandedType aExpandedType;
|
|
1147 |
|
|
1148 |
TInt err = CEapConversion::ConvertInternalTypeToExpandedEAPType(
|
|
1149 |
&(internal_settings->m_TunnelingType),
|
|
1150 |
&aExpandedType);
|
|
1151 |
|
|
1152 |
eapType->SetTunnelingType(aExpandedType);
|
|
1153 |
}
|
|
1154 |
|
|
1155 |
EAPSettings * local_settings = new EAPSettings;
|
|
1156 |
|
|
1157 |
eap_automatic_variable_c<EAPSettings> automatic_aSettings(
|
|
1158 |
m_am_tools,
|
|
1159 |
local_settings);
|
|
1160 |
|
|
1161 |
if (local_settings == 0)
|
|
1162 |
{
|
|
1163 |
return EAP_STATUS_RETURN(
|
|
1164 |
m_am_tools,
|
|
1165 |
error_complete(
|
|
1166 |
eap_status_allocation_error,
|
|
1167 |
internal_settings,
|
|
1168 |
error_completion_function));
|
|
1169 |
}
|
|
1170 |
|
|
1171 |
TInt error = CEapConversion::ConvertInternalTypeToEAPSettings(
|
|
1172 |
m_am_tools,
|
|
1173 |
internal_settings,
|
|
1174 |
local_settings);
|
|
1175 |
if (error != KErrNone)
|
|
1176 |
{
|
|
1177 |
return EAP_STATUS_RETURN(
|
|
1178 |
m_am_tools,
|
|
1179 |
error_complete(
|
|
1180 |
m_am_tools->convert_am_error_to_eapol_error(error),
|
|
1181 |
internal_settings,
|
|
1182 |
error_completion_function));
|
|
1183 |
}
|
|
1184 |
|
|
1185 |
if (internal_settings->m_DestinationIndexAndTypePresent == false)
|
|
1186 |
{
|
|
1187 |
return EAP_STATUS_RETURN(
|
|
1188 |
m_am_tools,
|
|
1189 |
error_complete(
|
|
1190 |
eap_status_illegal_parameter,
|
|
1191 |
internal_settings,
|
|
1192 |
error_completion_function));
|
|
1193 |
}
|
|
1194 |
|
|
1195 |
CEapTypeInfo * type_info = 0;
|
|
1196 |
|
|
1197 |
TRAP(error, (type_info = eapType->GetInfoL()));
|
|
1198 |
if (error != KErrNone
|
|
1199 |
|| type_info == 0)
|
|
1200 |
{
|
|
1201 |
EAP_TRACE_DEBUG(
|
|
1202 |
m_am_tools,
|
|
1203 |
TRACE_FLAGS_DEFAULT,
|
|
1204 |
(EAPL("ERROR: Cannot get type info configuration from EAP-type=0xfe%06x%08x, (index_type=%d, index=%d).\n"),
|
|
1205 |
internal_settings->m_EAPType.get_vendor_id(),
|
|
1206 |
internal_settings->m_EAPType.get_vendor_type(),
|
|
1207 |
internal_settings->m_IndexType,
|
|
1208 |
internal_settings->m_Index));
|
|
1209 |
|
|
1210 |
if (type_info != 0)
|
|
1211 |
{
|
|
1212 |
delete type_info;
|
|
1213 |
type_info = 0;
|
|
1214 |
}
|
|
1215 |
|
|
1216 |
return EAP_STATUS_RETURN(
|
|
1217 |
m_am_tools,
|
|
1218 |
error_complete(
|
|
1219 |
m_am_tools->convert_am_error_to_eapol_error(error),
|
|
1220 |
internal_settings,
|
|
1221 |
error_completion_function));
|
|
1222 |
}
|
|
1223 |
|
|
1224 |
eap_method_settings_c * const complete_settings = new eap_method_settings_c(m_am_tools, internal_settings);
|
|
1225 |
|
|
1226 |
eap_automatic_variable_c<eap_method_settings_c> automatic_complete_settings(
|
|
1227 |
m_am_tools,
|
|
1228 |
complete_settings);
|
|
1229 |
|
|
1230 |
if (complete_settings == 0)
|
|
1231 |
{
|
|
1232 |
delete type_info;
|
|
1233 |
type_info = 0;
|
|
1234 |
return EAP_STATUS_RETURN(
|
|
1235 |
m_am_tools,
|
|
1236 |
error_complete(
|
|
1237 |
eap_status_allocation_error,
|
|
1238 |
internal_settings,
|
|
1239 |
error_completion_function));
|
|
1240 |
}
|
|
1241 |
|
|
1242 |
error = CEapConversion::ConvertFromTDesCToInternal(
|
|
1243 |
m_am_tools,
|
|
1244 |
type_info->ReleaseDate(),
|
|
1245 |
&(complete_settings->m_KReleaseDate));
|
|
1246 |
|
|
1247 |
if(error == KErrNone)
|
|
1248 |
{
|
|
1249 |
error = CEapConversion::ConvertFromTDesCToInternal(
|
|
1250 |
m_am_tools,
|
|
1251 |
type_info->Version(),
|
|
1252 |
&(complete_settings->m_KEapTypeVersion));
|
|
1253 |
}
|
|
1254 |
|
|
1255 |
if(error == KErrNone)
|
|
1256 |
{
|
|
1257 |
error = CEapConversion::ConvertFromTDesCToInternal(
|
|
1258 |
m_am_tools,
|
|
1259 |
type_info->Manufacturer(),
|
|
1260 |
&(complete_settings->m_KManufacturer));
|
|
1261 |
}
|
|
1262 |
|
|
1263 |
delete type_info;
|
|
1264 |
type_info = 0;
|
|
1265 |
|
|
1266 |
if(error != KErrNone)
|
|
1267 |
{
|
|
1268 |
return EAP_STATUS_RETURN(
|
|
1269 |
m_am_tools,
|
|
1270 |
error_complete(
|
|
1271 |
m_am_tools->convert_am_error_to_eapol_error(error),
|
|
1272 |
internal_settings,
|
|
1273 |
error_completion_function));
|
|
1274 |
}
|
|
1275 |
|
|
1276 |
complete_settings->m_completion_status = eap_status_ok;
|
|
1277 |
|
|
1278 |
eap_status_e status = m_partner->complete_get_type_info(complete_settings);
|
|
1279 |
|
|
1280 |
return EAP_STATUS_RETURN(m_am_tools, status);
|
|
1281 |
}
|
|
1282 |
|
49
|
1283 |
//--------------------------------------------------
|
|
1284 |
|
|
1285 |
#if defined(USE_FAST_EAP_TYPE)
|
|
1286 |
|
|
1287 |
TInt eap_am_plugin_symbian_c::CompleteInitialisePacStore()
|
|
1288 |
{
|
|
1289 |
EAP_TRACE_DEBUG(
|
|
1290 |
m_am_tools,
|
|
1291 |
TRACE_FLAGS_DEFAULT,
|
|
1292 |
(EAPL("this = 0x%08x, message_function: starts: eap_am_plugin_symbian_c::CompleteInitialisePacStore(), completion_function=%d=%s\n"),
|
|
1293 |
this,
|
|
1294 |
m_completion_function,
|
|
1295 |
eap_process_tlv_message_data_c::get_function_string(m_completion_function)));
|
|
1296 |
|
|
1297 |
EAP_TRACE_RETURN_STRING(m_am_tools, "returns: eap_am_plugin_symbian_c::CompleteInitialisePacStore()");
|
|
1298 |
|
|
1299 |
eap_status_e status(eap_status_process_general_error);
|
|
1300 |
|
|
1301 |
const eap_tlv_message_type_function_e completion_function = m_completion_function;
|
|
1302 |
m_completion_function = eap_tlv_message_type_function_none;
|
26
|
1303 |
|
49
|
1304 |
switch (completion_function)
|
|
1305 |
{
|
|
1306 |
case eap_tlv_message_type_function_plugin_complete_get_configuration:
|
|
1307 |
status = internal_complete_get_configuration(m_internal_settings);
|
|
1308 |
break;
|
|
1309 |
case eap_tlv_message_type_function_plugin_complete_set_configuration:
|
|
1310 |
status = internal_complete_set_configuration(m_internal_settings);
|
|
1311 |
break;
|
|
1312 |
default:
|
|
1313 |
EAP_TRACE_DEBUG(
|
|
1314 |
m_am_tools,
|
|
1315 |
TRACE_FLAGS_DEFAULT,
|
|
1316 |
(EAPL("ERROR: this = 0x%08x, message_function: starts: eap_am_plugin_symbian_c::CompleteInitialisePacStore(), Illegal completion_function=%d=%s\n"),
|
|
1317 |
this,
|
|
1318 |
completion_function,
|
|
1319 |
eap_process_tlv_message_data_c::get_function_string(completion_function)));
|
|
1320 |
EAP_ASSERT_ANYWAY_TOOLS(m_am_tools);
|
|
1321 |
break;
|
|
1322 |
}
|
26
|
1323 |
|
49
|
1324 |
delete m_internal_settings;
|
|
1325 |
m_internal_settings = 0;
|
|
1326 |
|
|
1327 |
return m_am_tools->convert_eapol_error_to_am_error(EAP_STATUS_RETURN(m_am_tools, status));
|
|
1328 |
}
|
|
1329 |
|
|
1330 |
#endif //#if defined(USE_FAST_EAP_TYPE)
|
26
|
1331 |
|
|
1332 |
// ----------------------------------------------------------------------
|
|
1333 |
// End
|