26
|
1 |
/*
|
49
|
2 |
* Copyright (c) 2001-2010 Nokia Corporation and/or its subsidiary(-ies).
|
26
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description: EAP and WLAN authentication protocols.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
/*
|
49
|
19 |
* %version: 30 %
|
26
|
20 |
*/
|
|
21 |
|
|
22 |
#include <e32base.h>
|
|
23 |
#include <ecom/implementationproxy.h>
|
|
24 |
#include "EapolUID.h"
|
|
25 |
#include "EapTraceSymbian.h"
|
|
26 |
#include "EapFastPacStoreImpl.h"
|
|
27 |
#include "eap_automatic_variable.h"
|
|
28 |
|
|
29 |
// ----------------------------------------------------------
|
|
30 |
|
|
31 |
const TImplementationProxy ImplementationTable[] =
|
|
32 |
{
|
|
33 |
{{0x2002BC93}, reinterpret_cast<TProxyNewLPtr> (CEapFastPacStoreImpl::NewL)}
|
|
34 |
};
|
|
35 |
|
|
36 |
// ----------------------------------------------------------
|
|
37 |
|
|
38 |
EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
|
|
39 |
{
|
|
40 |
aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
|
|
41 |
|
|
42 |
return ImplementationTable;
|
|
43 |
}
|
|
44 |
|
|
45 |
// ----------------------------------------------------------
|
|
46 |
|
|
47 |
CEapFastPacStore* CEapFastPacStoreImpl::NewL()
|
|
48 |
{
|
|
49 |
EAP_TRACE_DEBUG_SYMBIAN(
|
|
50 |
(_L("CEapFastPacStoreImpl::NewL")));
|
|
51 |
|
|
52 |
CEapFastPacStoreImpl* self = new (ELeave) CEapFastPacStoreImpl();
|
|
53 |
|
49
|
54 |
CleanupStack::PushL(self);
|
|
55 |
|
|
56 |
self->ConstructL();
|
26
|
57 |
|
49
|
58 |
CleanupStack::Pop(self);
|
|
59 |
|
26
|
60 |
EAP_TRACE_DEBUG_SYMBIAN(
|
|
61 |
(_L("CEapFastPacStoreImpl::NewL end")));
|
|
62 |
return self;
|
|
63 |
|
|
64 |
}
|
|
65 |
|
|
66 |
// ----------------------------------------------------------
|
|
67 |
|
|
68 |
CEapFastPacStoreImpl::CEapFastPacStoreImpl():
|
|
69 |
iTools(abs_eap_am_tools_c::new_abs_eap_am_tools_c())
|
|
70 |
,iPartner(eap_pac_store_message_base_c::new_eap_pac_store_client_message_if_c(
|
|
71 |
iTools,
|
|
72 |
this))
|
|
73 |
,iIsValid (EFalse)
|
|
74 |
,iWaitState(eap_fast_pac_store_impl_wait_state_none)
|
|
75 |
,iPacStorePassword (new eap_variable_data_c(iTools))
|
|
76 |
,iIsPresent(EFalse)
|
|
77 |
,iIsMatching(EFalse)
|
|
78 |
{
|
|
79 |
EAP_TRACE_DEBUG_SYMBIAN(
|
|
80 |
(_L("CEapFastPacStoreImpl::CEapFastPacStoreImpl")));
|
|
81 |
|
|
82 |
|
|
83 |
EAP_TRACE_DEBUG_SYMBIAN(
|
|
84 |
(_L("CEapFastPacStoreImpl::CEapFastPacStoreImpl end")));
|
|
85 |
}
|
|
86 |
|
|
87 |
// ----------------------------------------------------------
|
|
88 |
|
|
89 |
void CEapFastPacStoreImpl::ConstructL()
|
|
90 |
{
|
|
91 |
EAP_TRACE_DEBUG_SYMBIAN(
|
|
92 |
(_L("CEapFastPacStoreImpl::ConstructL")));
|
|
93 |
|
|
94 |
eap_status_e status = iPartner->configure();
|
|
95 |
if (status != eap_status_ok)
|
|
96 |
{
|
|
97 |
TInt aError = iTools->convert_eapol_error_to_am_error(status);
|
|
98 |
|
|
99 |
abs_eap_am_tools_c::delete_abs_eap_am_tools_c(iTools);
|
|
100 |
delete iPartner;
|
|
101 |
iPartner = NULL;
|
|
102 |
User::Leave(aError);
|
|
103 |
}
|
|
104 |
|
|
105 |
EAP_TRACE_DEBUG_SYMBIAN(
|
|
106 |
(_L("CEapFastPacStoreImpl::ConstructL end")));
|
|
107 |
|
|
108 |
}
|
|
109 |
|
|
110 |
// ----------------------------------------------------------
|
|
111 |
|
|
112 |
CEapFastPacStoreImpl::~CEapFastPacStoreImpl()
|
|
113 |
{
|
|
114 |
EAP_TRACE_DEBUG_SYMBIAN(
|
|
115 |
(_L("CEapFastPacStoreImpl::~CEapFastPacStoreImpl")));
|
|
116 |
|
|
117 |
if ( iPacStorePassword != NULL )
|
|
118 |
{
|
|
119 |
delete iPacStorePassword;
|
|
120 |
}
|
|
121 |
|
|
122 |
if (iPartner != 0)
|
|
123 |
{
|
|
124 |
iPartner->shutdown();
|
|
125 |
}
|
|
126 |
delete iPartner;
|
|
127 |
|
|
128 |
EAP_TRACE_DEBUG_SYMBIAN(
|
|
129 |
(_L("CEapFastPacStoreImpl::~CEapFastPacStoreImpl end")));
|
|
130 |
|
|
131 |
abs_eap_am_tools_c::delete_abs_eap_am_tools_c(iTools);
|
|
132 |
iTools = NULL;
|
|
133 |
}
|
|
134 |
|
|
135 |
|
|
136 |
// ----------------------------------------------------------
|
|
137 |
|
|
138 |
void CEapFastPacStoreImpl::Activate()
|
|
139 |
{
|
|
140 |
EAP_TRACE_DEBUG(
|
|
141 |
iTools,
|
|
142 |
TRACE_FLAGS_DEFAULT,
|
|
143 |
(EAPL("CEapFastPacStoreImpl::Activate(): iAsyncronousStatus=%u\n"),
|
|
144 |
iAsyncronousStatus.Int()));
|
|
145 |
|
|
146 |
EAP_TRACE_RETURN_STRING(iTools, "returns: CEapFastPacStoreImpl::Activate()");
|
|
147 |
|
|
148 |
iAsyncronousStatus = KRequestPending;
|
|
149 |
}
|
|
150 |
|
|
151 |
//----------------------------------------------------------------
|
|
152 |
|
|
153 |
void CEapFastPacStoreImpl::Complete()
|
|
154 |
{
|
|
155 |
EAP_TRACE_DEBUG(
|
|
156 |
iTools,
|
|
157 |
TRACE_FLAGS_DEFAULT,
|
|
158 |
(EAPL("CEapFastPacStoreImpl::Complete(): iAsyncronousStatus=%u\n"),
|
|
159 |
iAsyncronousStatus.Int()));
|
|
160 |
|
|
161 |
EAP_TRACE_RETURN_STRING(iTools, "returns: CEapFastPacStoreImpl::Complete()");
|
|
162 |
|
|
163 |
iAsyncronousStatus = KErrNone;
|
|
164 |
|
|
165 |
// This is needed to continue the execution after Wait.Start();
|
|
166 |
iWait.AsyncStop();
|
|
167 |
}
|
|
168 |
|
|
169 |
//----------------------------------------------------------------
|
|
170 |
|
|
171 |
void CEapFastPacStoreImpl::WaitCompletion()
|
|
172 |
{
|
|
173 |
EAP_TRACE_DEBUG(
|
|
174 |
iTools,
|
|
175 |
TRACE_FLAGS_DEFAULT,
|
|
176 |
(EAPL("CEapFastPacStoreImpl::WaitCompletion(): iAsyncronousStatus=%u\n"),
|
|
177 |
iAsyncronousStatus.Int()));
|
|
178 |
|
|
179 |
EAP_TRACE_RETURN_STRING(iTools, "returns: CEapFastPacStoreImpl::WaitCompletion()");
|
|
180 |
|
|
181 |
while (iAsyncronousStatus == KRequestPending)
|
|
182 |
{
|
|
183 |
EAP_TRACE_DEBUG(
|
|
184 |
iTools,
|
|
185 |
TRACE_FLAGS_DEFAULT,
|
|
186 |
(EAPL("CEapFastPacStoreImpl::WaitCompletion(): calls iWait.Start()\n")));
|
|
187 |
|
|
188 |
iWait.Start();
|
|
189 |
|
|
190 |
EAP_TRACE_DEBUG(
|
|
191 |
iTools,
|
|
192 |
TRACE_FLAGS_DEFAULT,
|
|
193 |
(EAPL("CEapFastPacStoreImpl::WaitCompletion(): iWait.Start() returns, iAsyncronousStatus=%u\n"),
|
|
194 |
iAsyncronousStatus.Int()));
|
|
195 |
}
|
|
196 |
}
|
|
197 |
|
|
198 |
// ----------------------------------------------------------
|
|
199 |
|
|
200 |
TBool CEapFastPacStoreImpl::IsMasterKeyPresentL()
|
|
201 |
{
|
|
202 |
EAP_TRACE_DEBUG_SYMBIAN(
|
|
203 |
(_L("CEapFastPacStoreImpl::IsMasterKeyPresentL")));
|
|
204 |
|
|
205 |
eap_status_e status = iPartner->is_master_key_present(
|
|
206 |
iCompletionStatus);
|
|
207 |
|
|
208 |
if (status != eap_status_ok)
|
|
209 |
{
|
|
210 |
User::Leave(iTools->convert_eapol_error_to_am_error(
|
|
211 |
EAP_STATUS_RETURN(iTools, status)));
|
|
212 |
}
|
|
213 |
|
|
214 |
iWaitState = eap_fast_pac_store_impl_wait_state_complete_is_master_key_present;
|
|
215 |
Activate();
|
|
216 |
WaitCompletion();
|
|
217 |
|
|
218 |
if (iCompletionStatus != eap_status_ok)
|
|
219 |
{
|
|
220 |
User::Leave(iTools->convert_eapol_error_to_am_error(
|
|
221 |
EAP_STATUS_RETURN(iTools, iCompletionStatus)));
|
|
222 |
}
|
|
223 |
|
|
224 |
EAP_TRACE_DEBUG_SYMBIAN(
|
|
225 |
(_L("CEapFastPacStoreImpl::IsMasterKeyPresentL end")));
|
|
226 |
|
|
227 |
return iIsPresent;
|
|
228 |
|
|
229 |
}
|
|
230 |
|
|
231 |
// ----------------------------------------------------------
|
|
232 |
|
|
233 |
TBool CEapFastPacStoreImpl::IsMasterKeyAndPasswordMatchingL(
|
|
234 |
const TDesC8 & aPassword8)
|
|
235 |
{
|
|
236 |
EAP_TRACE_DEBUG_SYMBIAN(
|
|
237 |
(_L("CEapFastPacStoreImpl::IsMasterKeyAndPasswordMatchingL")));
|
|
238 |
|
34
|
239 |
(void)iPacStorePassword->set_copy_of_buffer(aPassword8.Ptr(), aPassword8.Size());
|
26
|
240 |
|
|
241 |
eap_status_e status = iPartner->is_master_key_and_password_matching(
|
|
242 |
iPacStorePassword
|
|
243 |
,iCompletionStatus);
|
|
244 |
|
|
245 |
if (status != eap_status_ok)
|
|
246 |
{
|
|
247 |
User::Leave(iTools->convert_eapol_error_to_am_error(
|
|
248 |
EAP_STATUS_RETURN(iTools, status)));
|
|
249 |
}
|
|
250 |
|
|
251 |
iWaitState = eap_fast_pac_store_impl_wait_state_complete_is_master_key_and_password_matching;
|
|
252 |
Activate();
|
|
253 |
WaitCompletion();
|
|
254 |
|
|
255 |
if (iCompletionStatus != eap_status_ok)
|
|
256 |
{
|
|
257 |
User::Leave(iTools->convert_eapol_error_to_am_error(
|
|
258 |
EAP_STATUS_RETURN(iTools, iCompletionStatus)));
|
|
259 |
}
|
|
260 |
|
|
261 |
EAP_TRACE_DEBUG_SYMBIAN(
|
|
262 |
(_L("CEapFastPacStoreImpl::IsMasterKeyAndPasswordMatchingL end")));
|
|
263 |
|
|
264 |
return iIsMatching;
|
|
265 |
|
|
266 |
}
|
|
267 |
|
|
268 |
// ----------------------------------------------------------
|
|
269 |
|
|
270 |
TInt CEapFastPacStoreImpl::CreateAndSaveMasterKeyL(
|
|
271 |
const TDesC8 & aPassword8)
|
|
272 |
{
|
|
273 |
EAP_TRACE_DEBUG_SYMBIAN(
|
|
274 |
(_L("CEapFastPacStoreImpl::CreateAndSaveMasterKeyL")));
|
|
275 |
|
|
276 |
|
34
|
277 |
(void)iPacStorePassword->set_copy_of_buffer(aPassword8.Ptr(), aPassword8.Size());
|
26
|
278 |
|
|
279 |
eap_status_e status = iPartner->create_and_save_master_key(
|
|
280 |
iPacStorePassword
|
|
281 |
,iCompletionStatus);
|
|
282 |
|
|
283 |
if (status != eap_status_ok)
|
|
284 |
{
|
|
285 |
User::Leave(iTools->convert_eapol_error_to_am_error(
|
|
286 |
EAP_STATUS_RETURN(iTools, status)));
|
|
287 |
}
|
|
288 |
|
|
289 |
iWaitState = eap_fast_pac_store_impl_wait_state_complete_create_and_save_master_key;
|
|
290 |
Activate();
|
|
291 |
WaitCompletion();
|
|
292 |
|
|
293 |
if (iCompletionStatus != eap_status_ok)
|
|
294 |
{
|
|
295 |
User::Leave(iTools->convert_eapol_error_to_am_error(
|
|
296 |
EAP_STATUS_RETURN(iTools, iCompletionStatus)));
|
|
297 |
}
|
|
298 |
|
|
299 |
EAP_TRACE_DEBUG_SYMBIAN(
|
|
300 |
(_L("CEapFastPacStoreImpl::CreateAndSaveMasterKeyL end")));
|
|
301 |
|
49
|
302 |
return iTools->convert_eapol_error_to_am_error(
|
|
303 |
EAP_STATUS_RETURN(iTools, iCompletionStatus));
|
26
|
304 |
|
|
305 |
}
|
|
306 |
|
|
307 |
// ----------------------------------------------------------
|
|
308 |
|
|
309 |
TBool CEapFastPacStoreImpl::ComparePacStorePasswordL(
|
|
310 |
TDes8 & aPassword8)
|
|
311 |
{
|
|
312 |
EAP_TRACE_DEBUG_SYMBIAN(
|
|
313 |
(_L("CEapFastPacStoreImpl::ComparePacStorePasswordL")));
|
|
314 |
|
34
|
315 |
(void)iPacStorePassword->set_copy_of_buffer(aPassword8.Ptr(), aPassword8.Size());
|
26
|
316 |
|
|
317 |
eap_status_e status = iPartner->compare_pac_store_password(
|
|
318 |
iPacStorePassword);
|
|
319 |
|
|
320 |
if (status != eap_status_ok)
|
|
321 |
{
|
|
322 |
User::Leave(iTools->convert_eapol_error_to_am_error(
|
|
323 |
EAP_STATUS_RETURN(iTools, status)));
|
|
324 |
}
|
|
325 |
|
|
326 |
iWaitState = eap_fast_pac_store_impl_wait_state_complete_compare_pac_store_password;
|
|
327 |
Activate();
|
|
328 |
WaitCompletion();
|
|
329 |
|
|
330 |
if (iCompletionStatus != eap_status_ok)
|
|
331 |
{
|
|
332 |
User::Leave(iTools->convert_eapol_error_to_am_error(
|
|
333 |
EAP_STATUS_RETURN(iTools, iCompletionStatus)));
|
|
334 |
}
|
|
335 |
|
|
336 |
EAP_TRACE_DEBUG_SYMBIAN(
|
|
337 |
(_L("CEapFastPacStoreImpl::ComparePacStorePasswordL end")));
|
|
338 |
|
|
339 |
return iIsPwMatching;
|
|
340 |
|
|
341 |
}
|
|
342 |
|
|
343 |
TBool CEapFastPacStoreImpl::IsPacStorePasswordPresentL()
|
|
344 |
{
|
|
345 |
EAP_TRACE_DEBUG_SYMBIAN(
|
|
346 |
(_L("CEapFastPacStoreImpl::IsPacStorePasswordPresentL")));
|
|
347 |
|
|
348 |
eap_status_e status = iPartner->is_pacstore_password_present();
|
|
349 |
|
|
350 |
if (status != eap_status_ok)
|
|
351 |
{
|
|
352 |
User::Leave(iTools->convert_eapol_error_to_am_error(
|
|
353 |
EAP_STATUS_RETURN(iTools, status)));
|
|
354 |
}
|
|
355 |
|
|
356 |
iWaitState = eap_fast_pac_store_impl_wait_state_complete_is_pacstore_password_present;
|
|
357 |
Activate();
|
|
358 |
WaitCompletion();
|
|
359 |
|
|
360 |
if (iCompletionStatus != eap_status_ok)
|
|
361 |
{
|
|
362 |
User::Leave(iTools->convert_eapol_error_to_am_error(
|
|
363 |
EAP_STATUS_RETURN(iTools, iCompletionStatus)));
|
|
364 |
}
|
|
365 |
|
|
366 |
EAP_TRACE_DEBUG_SYMBIAN(
|
|
367 |
(_L("CEapFastPacStoreImpl::IsPacStorePasswordPresentL end")));
|
|
368 |
|
|
369 |
return iIsPwPresent;
|
|
370 |
|
|
371 |
}
|
|
372 |
|
|
373 |
// ----------------------------------------------------------
|
|
374 |
|
|
375 |
TInt CEapFastPacStoreImpl::SetPacStorePasswordL(
|
|
376 |
const TDesC8 & aPassword8)
|
|
377 |
{
|
|
378 |
EAP_TRACE_DEBUG_SYMBIAN(
|
|
379 |
(_L("CEapFastPacStoreImpl::SetPacStorePasswordL")));
|
|
380 |
|
34
|
381 |
(void)iPacStorePassword->set_copy_of_buffer(aPassword8.Ptr(), aPassword8.Size());
|
26
|
382 |
|
|
383 |
eap_status_e status = iPartner->set_pac_store_password(
|
|
384 |
iPacStorePassword
|
|
385 |
,iCompletionStatus);
|
|
386 |
|
|
387 |
if (status != eap_status_ok)
|
|
388 |
{
|
|
389 |
User::Leave(iTools->convert_eapol_error_to_am_error(
|
|
390 |
EAP_STATUS_RETURN(iTools, status)));
|
|
391 |
}
|
|
392 |
|
|
393 |
iWaitState = eap_fast_pac_store_impl_wait_state_complete_set_pac_store_password;
|
|
394 |
Activate();
|
|
395 |
WaitCompletion();
|
|
396 |
|
|
397 |
if (iCompletionStatus != eap_status_ok)
|
|
398 |
{
|
|
399 |
User::Leave(iTools->convert_eapol_error_to_am_error(
|
|
400 |
EAP_STATUS_RETURN(iTools, iCompletionStatus)));
|
|
401 |
}
|
|
402 |
|
|
403 |
EAP_TRACE_DEBUG_SYMBIAN(
|
|
404 |
(_L("CEapFastPacStoreImpl::SetPacStorePasswordL end")));
|
|
405 |
|
49
|
406 |
return iTools->convert_eapol_error_to_am_error(
|
|
407 |
EAP_STATUS_RETURN(iTools, iCompletionStatus));
|
26
|
408 |
|
|
409 |
|
|
410 |
}
|
|
411 |
|
|
412 |
// ----------------------------------------------------------
|
|
413 |
|
|
414 |
TInt CEapFastPacStoreImpl::DestroyPacStore()
|
|
415 |
{
|
|
416 |
EAP_TRACE_DEBUG_SYMBIAN(
|
|
417 |
(_L("CEapFastPacStoreImpl::DestroyPacStore")));
|
|
418 |
|
|
419 |
eap_status_e status = iPartner->destroy_pac_store(
|
|
420 |
iCompletionStatus);
|
|
421 |
|
|
422 |
if (status != eap_status_ok)
|
|
423 |
{
|
|
424 |
return iTools->convert_eapol_error_to_am_error(status);
|
|
425 |
}
|
|
426 |
|
|
427 |
iWaitState = eap_fast_pac_store_impl_wait_state_complete_destroy_pac_store;
|
|
428 |
Activate();
|
|
429 |
WaitCompletion();
|
|
430 |
|
|
431 |
EAP_TRACE_DEBUG_SYMBIAN(
|
|
432 |
(_L("CEapFastPacStoreImpl::DestroyPacStore end")));
|
|
433 |
|
49
|
434 |
return iTools->convert_eapol_error_to_am_error(
|
|
435 |
EAP_STATUS_RETURN(iTools, iCompletionStatus));
|
26
|
436 |
|
|
437 |
|
|
438 |
}
|
|
439 |
|
|
440 |
// ----------------------------------------------------------
|
|
441 |
|
|
442 |
eap_status_e CEapFastPacStoreImpl::complete_is_master_key_present(
|
|
443 |
bool is_present
|
|
444 |
,const eap_status_e completion_status)
|
|
445 |
{
|
|
446 |
EAP_TRACE_DEBUG(
|
|
447 |
iTools,
|
|
448 |
TRACE_FLAGS_DEFAULT,
|
|
449 |
(EAPL("CEapFastPacStoreImpl::complete_is_master_key_present(): this=0x%08x, iWaitState=%d\n"),
|
|
450 |
this,
|
|
451 |
iWaitState));
|
|
452 |
|
|
453 |
iIsPresent = is_present;
|
|
454 |
iCompletionStatus = completion_status;
|
|
455 |
|
|
456 |
if (iWaitState != eap_fast_pac_store_impl_wait_state_complete_is_master_key_present
|
|
457 |
&& iCompletionStatus == eap_status_ok)
|
|
458 |
{
|
|
459 |
// ERROR wrong state.
|
|
460 |
iCompletionStatus = eap_status_wrong_eap_type_state;
|
|
461 |
}
|
|
462 |
|
|
463 |
iIsPresent = is_present;
|
|
464 |
Complete();
|
|
465 |
|
|
466 |
EAP_TRACE_DEBUG_SYMBIAN(
|
|
467 |
(_L("CEapFastPacStoreImpl::complete_is_master_key_present end")));
|
|
468 |
|
|
469 |
return iCompletionStatus;
|
|
470 |
|
|
471 |
}
|
|
472 |
|
|
473 |
// ----------------------------------------------------------
|
|
474 |
|
|
475 |
eap_status_e CEapFastPacStoreImpl::complete_is_master_key_and_password_matching(
|
|
476 |
bool is_matching
|
|
477 |
,const eap_status_e completion_status)
|
|
478 |
{
|
|
479 |
EAP_TRACE_DEBUG(
|
|
480 |
iTools,
|
|
481 |
TRACE_FLAGS_DEFAULT,
|
|
482 |
(EAPL("CEapFastPacStoreImpl::complete_is_master_key_and_password_matching(): this=0x%08x, iWaitState=%d\n"),
|
|
483 |
this,
|
|
484 |
iWaitState));
|
|
485 |
|
|
486 |
iCompletionStatus = completion_status;
|
|
487 |
|
|
488 |
iIsMatching = is_matching;
|
|
489 |
if (iWaitState != eap_fast_pac_store_impl_wait_state_complete_is_master_key_and_password_matching
|
|
490 |
&& iCompletionStatus == eap_status_ok)
|
|
491 |
{
|
|
492 |
// ERROR wrong state.
|
|
493 |
iCompletionStatus = eap_status_wrong_eap_type_state;
|
|
494 |
}
|
|
495 |
iIsMatching = is_matching;
|
|
496 |
|
|
497 |
Complete();
|
|
498 |
|
|
499 |
EAP_TRACE_DEBUG_SYMBIAN(
|
|
500 |
(_L("CEapFastPacStoreImpl::complete_is_master_key_and_password_matching end")));
|
|
501 |
|
|
502 |
return iCompletionStatus;
|
|
503 |
|
|
504 |
}
|
|
505 |
|
|
506 |
// ----------------------------------------------------------
|
|
507 |
|
|
508 |
eap_status_e CEapFastPacStoreImpl::complete_create_and_save_master_key(
|
|
509 |
const eap_status_e completion_status)
|
|
510 |
{
|
|
511 |
EAP_TRACE_DEBUG(
|
|
512 |
iTools,
|
|
513 |
TRACE_FLAGS_DEFAULT,
|
|
514 |
(EAPL("CEapFastPacStoreImpl::complete_create_and_save_master_key(): this=0x%08x, iWaitState=%d\n"),
|
|
515 |
this,
|
|
516 |
iWaitState));
|
|
517 |
|
|
518 |
iCompletionStatus = completion_status;
|
|
519 |
|
|
520 |
if (iWaitState != eap_fast_pac_store_impl_wait_state_complete_create_and_save_master_key
|
|
521 |
&& iCompletionStatus == eap_status_ok)
|
|
522 |
{
|
|
523 |
// ERROR wrong state.
|
|
524 |
iCompletionStatus = eap_status_wrong_eap_type_state;
|
|
525 |
}
|
|
526 |
|
|
527 |
Complete();
|
|
528 |
|
|
529 |
EAP_TRACE_DEBUG_SYMBIAN(
|
|
530 |
(_L("CEapFastPacStoreImpl::complete_create_and_save_master_key end")));
|
|
531 |
|
|
532 |
return iCompletionStatus;
|
|
533 |
|
|
534 |
}
|
|
535 |
|
|
536 |
// ----------------------------------------------------------
|
|
537 |
|
|
538 |
eap_status_e CEapFastPacStoreImpl::complete_compare_pac_store_password(
|
|
539 |
bool is_matching)
|
|
540 |
{
|
|
541 |
EAP_TRACE_DEBUG(
|
|
542 |
iTools,
|
|
543 |
TRACE_FLAGS_DEFAULT,
|
|
544 |
(EAPL("CEapFastPacStoreImpl::complete_compare_pac_store_password(): this=0x%08x, iWaitState=%d\n"),
|
|
545 |
this,
|
|
546 |
iWaitState));
|
|
547 |
|
|
548 |
iCompletionStatus = eap_status_ok;
|
|
549 |
|
|
550 |
if (iWaitState != eap_fast_pac_store_impl_wait_state_complete_compare_pac_store_password)
|
|
551 |
{
|
|
552 |
// ERROR wrong state.
|
|
553 |
iCompletionStatus = eap_status_wrong_eap_type_state;
|
|
554 |
}
|
|
555 |
|
|
556 |
iIsPwMatching = is_matching;
|
|
557 |
Complete();
|
|
558 |
|
|
559 |
EAP_TRACE_DEBUG_SYMBIAN(
|
|
560 |
(_L("CEapFastPacStoreImpl::complete_compare_pac_store_password end")));
|
|
561 |
|
|
562 |
return iCompletionStatus;
|
|
563 |
|
|
564 |
}
|
|
565 |
|
|
566 |
// ----------------------------------------------------------
|
|
567 |
|
|
568 |
eap_status_e CEapFastPacStoreImpl::complete_is_pacstore_password_present(
|
|
569 |
bool is_present)
|
|
570 |
{
|
|
571 |
EAP_TRACE_DEBUG(
|
|
572 |
iTools,
|
|
573 |
TRACE_FLAGS_DEFAULT,
|
|
574 |
(EAPL("CEapFastPacStoreImpl::complete_is_pacstore_password_present(): this=0x%08x, iWaitState=%d\n"),
|
|
575 |
this,
|
|
576 |
iWaitState));
|
|
577 |
|
|
578 |
iCompletionStatus = eap_status_ok;
|
|
579 |
|
|
580 |
if (iWaitState != eap_fast_pac_store_impl_wait_state_complete_is_pacstore_password_present)
|
|
581 |
{
|
|
582 |
// ERROR wrong state.
|
|
583 |
iCompletionStatus = eap_status_wrong_eap_type_state;
|
|
584 |
}
|
|
585 |
|
|
586 |
iIsPwPresent = is_present;
|
|
587 |
Complete();
|
|
588 |
|
|
589 |
EAP_TRACE_DEBUG_SYMBIAN(
|
|
590 |
(_L("CEapFastPacStoreImpl::complete_is_pacstore_password_present end")));
|
|
591 |
|
|
592 |
return iCompletionStatus;
|
|
593 |
|
|
594 |
}
|
|
595 |
// ----------------------------------------------------------
|
|
596 |
|
|
597 |
eap_status_e CEapFastPacStoreImpl::complete_set_pac_store_password(
|
|
598 |
const eap_status_e completion_status)
|
|
599 |
{
|
|
600 |
EAP_TRACE_DEBUG(
|
|
601 |
iTools,
|
|
602 |
TRACE_FLAGS_DEFAULT,
|
|
603 |
(EAPL("CEapFastPacStoreImpl::complete_set_pac_store_password(): this=0x%08x, iWaitState=%d\n"),
|
|
604 |
this,
|
|
605 |
iWaitState));
|
|
606 |
|
|
607 |
iCompletionStatus = completion_status;
|
|
608 |
|
|
609 |
if (iWaitState != eap_fast_pac_store_impl_wait_state_complete_set_pac_store_password
|
|
610 |
&& iCompletionStatus == eap_status_ok)
|
|
611 |
{
|
|
612 |
// ERROR wrong state.
|
|
613 |
iCompletionStatus = eap_status_wrong_eap_type_state;
|
|
614 |
}
|
|
615 |
|
|
616 |
Complete();
|
|
617 |
|
|
618 |
EAP_TRACE_DEBUG_SYMBIAN(
|
|
619 |
(_L("CEapFastPacStoreImpl::complete_set_pac_store_password end")));
|
|
620 |
|
|
621 |
return iCompletionStatus;
|
|
622 |
|
|
623 |
}
|
|
624 |
|
|
625 |
// ----------------------------------------------------------
|
|
626 |
|
|
627 |
eap_status_e CEapFastPacStoreImpl::complete_destroy_pac_store(
|
|
628 |
const eap_status_e completion_status)
|
|
629 |
{
|
|
630 |
EAP_TRACE_DEBUG(
|
|
631 |
iTools,
|
|
632 |
TRACE_FLAGS_DEFAULT,
|
|
633 |
(EAPL("CEapFastPacStoreImpl::complete_destroy_pac_store(): this=0x%08x, iWaitState=%d\n"),
|
|
634 |
this,
|
|
635 |
iWaitState));
|
|
636 |
|
|
637 |
iCompletionStatus = completion_status;
|
|
638 |
|
|
639 |
if (iWaitState != eap_fast_pac_store_impl_wait_state_complete_destroy_pac_store
|
|
640 |
&& iCompletionStatus == eap_status_ok)
|
|
641 |
{
|
|
642 |
// ERROR wrong state.
|
|
643 |
iCompletionStatus = eap_status_wrong_eap_type_state;
|
|
644 |
}
|
|
645 |
|
|
646 |
Complete();
|
|
647 |
|
|
648 |
EAP_TRACE_DEBUG_SYMBIAN(
|
|
649 |
(_L("CEapFastPacStoreImpl::complete_destroy_pac_store end")));
|
|
650 |
|
|
651 |
return iCompletionStatus;
|
|
652 |
|
|
653 |
}
|
|
654 |
|
|
655 |
// ----------------------------------------------------------
|
|
656 |
|
|
657 |
eap_am_message_if_c * eap_am_message_if_c::new_eap_am_message_if_c(
|
|
658 |
abs_eap_am_tools_c * const tools)
|
|
659 |
{
|
|
660 |
EAP_TRACE_DEBUG(
|
|
661 |
tools,
|
|
662 |
TRACE_FLAGS_DEFAULT,
|
|
663 |
(EAPL("eap_am_message_if_c::new_eap_am_server_pac_store_message_c()\n")));
|
|
664 |
|
|
665 |
eap_am_message_if_c *client_if = new eap_am_message_if_symbian_c(tools, EEapPacStoreNew);
|
|
666 |
|
|
667 |
eap_automatic_variable_c<eap_am_message_if_c> automatic_client_if(
|
|
668 |
tools,
|
|
669 |
client_if);
|
|
670 |
|
|
671 |
if (client_if == 0
|
|
672 |
|| client_if->get_is_valid() == false)
|
|
673 |
{
|
|
674 |
// ERROR.
|
|
675 |
if (client_if != 0)
|
|
676 |
{
|
|
677 |
EAP_TRACE_DEBUG(
|
|
678 |
tools,
|
|
679 |
TRACE_FLAGS_ALWAYS|TRACE_FLAGS_DEFAULT,
|
|
680 |
(EAPL("ERROR: calls: eap_am_message_if_c::new_eap_am_server_general_settings_c(): client_if->shutdown()\n")));
|
|
681 |
|
|
682 |
client_if->shutdown();
|
|
683 |
}
|
|
684 |
return 0;
|
|
685 |
}
|
|
686 |
|
|
687 |
automatic_client_if.do_not_free_variable();
|
|
688 |
|
|
689 |
return client_if;
|
|
690 |
|
|
691 |
}
|
|
692 |
|
|
693 |
// ----------------------------------------------------------
|
|
694 |
|
|
695 |
EAP_FUNC_EXPORT eap_pac_store_message_base_c * eap_pac_store_message_base_c::new_eap_pac_store_client_message_if_c(
|
|
696 |
abs_eap_am_tools_c * const tools,
|
|
697 |
abs_eap_pac_store_message_c * const partner)
|
|
698 |
{
|
|
699 |
EAP_TRACE_DEBUG(
|
|
700 |
tools,
|
|
701 |
TRACE_FLAGS_DEFAULT,
|
|
702 |
(EAPL("eap_pac_store_message_base_c::new_eap_pac_store_client_message_if_c()\n")));
|
|
703 |
|
|
704 |
eap_am_message_if_c *client_if = eap_am_message_if_c::new_eap_am_message_if_c(
|
|
705 |
tools);
|
|
706 |
|
|
707 |
eap_automatic_variable_c<eap_am_message_if_c> automatic_client_if(
|
|
708 |
tools,
|
|
709 |
client_if);
|
|
710 |
|
|
711 |
if (client_if == 0
|
|
712 |
|| client_if->get_is_valid() == false)
|
|
713 |
{
|
|
714 |
// ERROR.
|
|
715 |
if (client_if != 0)
|
|
716 |
{
|
|
717 |
EAP_TRACE_DEBUG(
|
|
718 |
tools,
|
|
719 |
TRACE_FLAGS_ALWAYS|TRACE_FLAGS_DEFAULT,
|
|
720 |
(EAPL("ERROR: calls: eap_pac_store_message_base_c::new_eap_pac_store_client_message_if_c(): client_if->shutdown()\n")));
|
|
721 |
|
|
722 |
(void) client_if->shutdown();
|
|
723 |
}
|
|
724 |
return 0;
|
|
725 |
}
|
|
726 |
|
|
727 |
eap_pac_store_client_message_if_c * new_session_core = new eap_pac_store_client_message_if_c(tools, client_if, partner);
|
|
728 |
|
|
729 |
eap_automatic_variable_c<eap_pac_store_client_message_if_c> automatic_new_session_core(
|
|
730 |
tools,
|
|
731 |
new_session_core);
|
|
732 |
|
|
733 |
if (new_session_core == 0
|
|
734 |
|| new_session_core->get_is_valid() == false)
|
|
735 |
{
|
|
736 |
// ERROR.
|
|
737 |
if (new_session_core != 0)
|
|
738 |
{
|
|
739 |
EAP_TRACE_DEBUG(
|
|
740 |
tools,
|
|
741 |
TRACE_FLAGS_ALWAYS|TRACE_FLAGS_DEFAULT,
|
|
742 |
(EAPL("ERROR: calls: eap_pac_store_message_base_c::new_eap_pac_store_client_message_if_c(): new_session_core->shutdown()\n")));
|
|
743 |
|
|
744 |
new_session_core->shutdown();
|
|
745 |
}
|
|
746 |
return 0;
|
|
747 |
}
|
|
748 |
|
|
749 |
client_if->set_partner(new_session_core);
|
|
750 |
|
|
751 |
automatic_client_if.do_not_free_variable();
|
|
752 |
automatic_new_session_core.do_not_free_variable();
|
|
753 |
|
|
754 |
return new_session_core;
|
|
755 |
}
|
|
756 |
|
|
757 |
|
|
758 |
// ----------------------------------------------------------
|
|
759 |
|
|
760 |
|