|
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 "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: IAP handler for VoIP XML processor |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <e32cmn.h> |
|
20 #include <coecntrl.h> |
|
21 #include <cmmanagerext.h> |
|
22 #include <cmdestinationext.h> |
|
23 #include <cmconnectionmethodext.h> |
|
24 #include <cmconnectionmethoddef.h> |
|
25 #include <cmpluginwlandef.h> |
|
26 #include <WPASecuritySettingsUI.h> |
|
27 #include <WEPSecuritySettingsUI.h> |
|
28 |
|
29 #include "voipxmlutils.h" |
|
30 #include "voipxmliaphandler.h" |
|
31 #include "voipxmlprocessorlogger.h" |
|
32 |
|
33 // --------------------------------------------------------------------------- |
|
34 // CVoipXmlIapHandler::CVoipXmlIapHandler |
|
35 // --------------------------------------------------------------------------- |
|
36 // |
|
37 CVoipXmlIapHandler::CVoipXmlIapHandler() |
|
38 { |
|
39 } |
|
40 |
|
41 // --------------------------------------------------------------------------- |
|
42 // CVoipXmlIapHandler::NewL |
|
43 // --------------------------------------------------------------------------- |
|
44 // |
|
45 CVoipXmlIapHandler* CVoipXmlIapHandler::NewL() |
|
46 { |
|
47 CVoipXmlIapHandler* self = new ( ELeave ) CVoipXmlIapHandler; |
|
48 CleanupStack::PushL( self ); |
|
49 self->ConstructL(); |
|
50 CleanupStack::Pop( self ); |
|
51 return self; |
|
52 } |
|
53 |
|
54 // --------------------------------------------------------------------------- |
|
55 // CVoipXmlIapHandler::ConstructL |
|
56 // --------------------------------------------------------------------------- |
|
57 // |
|
58 void CVoipXmlIapHandler::ConstructL() |
|
59 { |
|
60 iDestinationName = HBufC::NewL( 0 ); |
|
61 iDestinationId = 0; |
|
62 iCurrentIap.iSsid = NULL; |
|
63 iCurrentIap.iName = NULL; |
|
64 iCurrentIap.iPreSharedKey = NULL; |
|
65 iCurrentIap.iSecurityType = CMManager::EWlanSecModeOpen; |
|
66 iCurrentIap.iNetworkMode = CMManager::EInfra; |
|
67 iCurrentIap.iWepAuthMode = CWEPSecuritySettings::EAuthOpen; |
|
68 } |
|
69 |
|
70 // --------------------------------------------------------------------------- |
|
71 // CVoipXmlIapHandler::~CVoipXmlIapHandler |
|
72 // --------------------------------------------------------------------------- |
|
73 // |
|
74 CVoipXmlIapHandler::~CVoipXmlIapHandler() |
|
75 { |
|
76 if ( iDestinationName ) |
|
77 { |
|
78 delete iDestinationName; |
|
79 } |
|
80 ResetCurrentIap( ETrue ); |
|
81 ResetTempIapArray( ETrue ); |
|
82 } |
|
83 |
|
84 // --------------------------------------------------------------------------- |
|
85 // Sets SIP setting. |
|
86 // --------------------------------------------------------------------------- |
|
87 // |
|
88 void CVoipXmlIapHandler::SetSetting( TInt aType, TInt aParam, |
|
89 const TDesC& aValue ) |
|
90 { |
|
91 // Ignore too long descriptors. |
|
92 if ( KMaxNodeValueLength < aValue.Length() ) |
|
93 { |
|
94 return; |
|
95 } |
|
96 TInt intValue; |
|
97 |
|
98 switch ( aParam ) |
|
99 { |
|
100 case EName: |
|
101 { |
|
102 TInt err( KErrNotFound ); |
|
103 if ( EDestination == aType ) |
|
104 { |
|
105 delete iDestinationName; |
|
106 iDestinationName = NULL; |
|
107 TRAP( err, iDestinationName = aValue.AllocL() ); |
|
108 } |
|
109 else if ( EWlan == aType && !iCurrentIap.iName ) |
|
110 { |
|
111 TRAP( err, iCurrentIap.iName = aValue.AllocL() ); |
|
112 } |
|
113 if ( KErrNone == err ) |
|
114 { |
|
115 iSettingsSet = ETrue; |
|
116 } |
|
117 break; |
|
118 } |
|
119 case EType: |
|
120 { |
|
121 if ( EWlan != aType ) |
|
122 { |
|
123 break; |
|
124 } |
|
125 TBuf<KMaxNodeValueLength> value; |
|
126 value.Copy( aValue ); |
|
127 value.UpperCase(); |
|
128 if ( 0 == value.Compare( KSecurityTypeWep ) ) |
|
129 { |
|
130 iCurrentIap.iSecurityType = CMManager::EWlanSecModeWep; |
|
131 iSettingsSet = ETrue; |
|
132 } |
|
133 else if ( 0 == value.Compare( KSecurityTypeWpa ) ) |
|
134 { |
|
135 iCurrentIap.iSecurityType = CMManager::EWlanSecModeWpa; |
|
136 iSettingsSet = ETrue; |
|
137 } |
|
138 else if ( 0 == value.Compare( KSecurityTypeWpa2 ) ) |
|
139 { |
|
140 iCurrentIap.iSecurityType = CMManager::EWlanSecModeWpa2; |
|
141 iSettingsSet = ETrue; |
|
142 } |
|
143 else if ( 0 == value.Compare( KSecurityType8021x ) ) |
|
144 { |
|
145 iCurrentIap.iSecurityType = CMManager::EWlanSecMode802_1x; |
|
146 iSettingsSet = ETrue; |
|
147 } |
|
148 break; |
|
149 } |
|
150 case ESsid: |
|
151 { |
|
152 if ( EWlan == aType && !iCurrentIap.iSsid ) |
|
153 { |
|
154 TRAPD( err, iCurrentIap.iSsid = aValue.AllocL() ); |
|
155 if ( KErrNone == err ) |
|
156 { |
|
157 iSettingsSet = ETrue; |
|
158 } |
|
159 } |
|
160 break; |
|
161 } |
|
162 case EHidden: |
|
163 { |
|
164 if ( EWlan == aType && |
|
165 KErrNone == VoipXmlUtils::DesToInt( aValue, intValue ) ) |
|
166 { |
|
167 iCurrentIap.iHidden = intValue; |
|
168 iSettingsSet = ETrue; |
|
169 } |
|
170 break; |
|
171 } |
|
172 case ENetworkMode: |
|
173 { |
|
174 if ( EWlan != aType ) |
|
175 { |
|
176 break; |
|
177 } |
|
178 TBuf<KMaxNodeValueLength> value; |
|
179 value.Copy( aValue ); |
|
180 value.LowerCase(); |
|
181 if ( 0 == value.Compare( KNetworkModeInfra ) ) |
|
182 { |
|
183 iCurrentIap.iNetworkMode = CMManager::EInfra; |
|
184 iSettingsSet = ETrue; |
|
185 } |
|
186 else if ( 0 == value.Compare( KNetworkModeAdhoc ) ) |
|
187 { |
|
188 iCurrentIap.iNetworkMode = CMManager::EAdhoc; |
|
189 iSettingsSet = ETrue; |
|
190 } |
|
191 break; |
|
192 } |
|
193 case EPreSharedKey: |
|
194 { |
|
195 if ( EWlan == aType && !iCurrentIap.iPreSharedKey ) |
|
196 { |
|
197 TRAPD( err, iCurrentIap.iPreSharedKey = aValue.AllocL() ); |
|
198 if ( KErrNone == err ) |
|
199 { |
|
200 iSettingsSet = ETrue; |
|
201 } |
|
202 } |
|
203 break; |
|
204 } |
|
205 case EWepAuthMode: |
|
206 { |
|
207 if ( EWlan != aType ) |
|
208 { |
|
209 break; |
|
210 } |
|
211 TBuf<KMaxNodeValueLength> value; |
|
212 value.Copy( aValue ); |
|
213 value.LowerCase(); |
|
214 if ( 0 == value.Compare( KWepAuthModeOpen ) ) |
|
215 { |
|
216 iCurrentIap.iWepAuthMode = CWEPSecuritySettings::EAuthOpen; |
|
217 iSettingsSet = ETrue; |
|
218 } |
|
219 else if ( 0 == value.Compare( KWepAuthModeShared ) ) |
|
220 { |
|
221 iCurrentIap.iWepAuthMode = CWEPSecuritySettings::EAuthShared; |
|
222 iSettingsSet = ETrue; |
|
223 } |
|
224 break; |
|
225 } |
|
226 case ELength: |
|
227 { |
|
228 if ( EWepKey == aType && |
|
229 KErrNone == VoipXmlUtils::DesToInt( aValue, intValue )) |
|
230 { |
|
231 iCurrentIap.iCurrentWepKey.iLength = intValue; |
|
232 iSettingsSet = ETrue; |
|
233 } |
|
234 break; |
|
235 } |
|
236 case EData: |
|
237 { |
|
238 if ( EWepKey == aType && KMaxWepKeyDataLength >= aValue.Length() ) |
|
239 { |
|
240 iCurrentIap.iCurrentWepKey.iData.Copy( aValue ); |
|
241 iSettingsSet = ETrue; |
|
242 } |
|
243 break; |
|
244 } |
|
245 default: |
|
246 break; |
|
247 } |
|
248 } |
|
249 |
|
250 // --------------------------------------------------------------------------- |
|
251 // Stores settings. |
|
252 // --------------------------------------------------------------------------- |
|
253 // |
|
254 TInt CVoipXmlIapHandler::StoreSettings() |
|
255 { |
|
256 if ( !iSettingsSet ) |
|
257 { |
|
258 // No settings to be stored => method not supported. |
|
259 return KErrNotSupported; |
|
260 } |
|
261 TRAPD( err, StoreSettingsL() ); |
|
262 if ( KErrNone != err ) |
|
263 { |
|
264 err = KErrCompletion; |
|
265 } |
|
266 return err; |
|
267 } |
|
268 |
|
269 // --------------------------------------------------------------------------- |
|
270 // Returns Destination ID. |
|
271 // --------------------------------------------------------------------------- |
|
272 // |
|
273 TUint32 CVoipXmlIapHandler::SettingsId() |
|
274 { |
|
275 return iDestinationId; |
|
276 } |
|
277 |
|
278 // --------------------------------------------------------------------------- |
|
279 // Informs that currently deployed settings have ended. |
|
280 // --------------------------------------------------------------------------- |
|
281 // |
|
282 void CVoipXmlIapHandler::SettingsEnd( TInt aType ) |
|
283 { |
|
284 if ( EWepKey == aType && iCurrentIap.iWepKeys.Count() < KMaxWepKeyCount ) |
|
285 { |
|
286 TInt keyDataLength = iCurrentIap.iCurrentWepKey.iData.Length(); |
|
287 TBool okToAdd( EFalse ); |
|
288 switch ( keyDataLength ) |
|
289 { |
|
290 case EWepKey64Hex: |
|
291 { |
|
292 iCurrentIap.iCurrentWepKey.iHex = ETrue; |
|
293 okToAdd = ETrue; |
|
294 break; |
|
295 } |
|
296 case EWepKey64Ascii: |
|
297 { |
|
298 iCurrentIap.iCurrentWepKey.iHex = EFalse; |
|
299 okToAdd = ETrue; |
|
300 break; |
|
301 } |
|
302 case EWepKey128Hex: |
|
303 { |
|
304 iCurrentIap.iCurrentWepKey.iHex = ETrue; |
|
305 okToAdd = ETrue; |
|
306 break; |
|
307 } |
|
308 case EWepKey128Ascii: |
|
309 { |
|
310 iCurrentIap.iCurrentWepKey.iHex = EFalse; |
|
311 okToAdd = ETrue; |
|
312 break; |
|
313 } |
|
314 default: |
|
315 break; |
|
316 } |
|
317 if ( okToAdd ) |
|
318 { |
|
319 iCurrentIap.iWepKeys.Append( iCurrentIap.iCurrentWepKey ); |
|
320 } |
|
321 iCurrentIap.iCurrentWepKey.iLength = 0; |
|
322 iCurrentIap.iCurrentWepKey.iData.Zero(); |
|
323 } |
|
324 else if ( EWlan == aType ) |
|
325 { |
|
326 TRAP_IGNORE( AddCurrentIapL() ); |
|
327 ResetCurrentIap(); |
|
328 } |
|
329 } |
|
330 |
|
331 // --------------------------------------------------------------------------- |
|
332 // Resets iCurrentIap members. |
|
333 // --------------------------------------------------------------------------- |
|
334 // |
|
335 void CVoipXmlIapHandler::ResetCurrentIap( TBool aCloseArray ) |
|
336 { |
|
337 if ( iCurrentIap.iName ) |
|
338 { |
|
339 delete iCurrentIap.iName; |
|
340 iCurrentIap.iName = NULL; |
|
341 } |
|
342 if ( iCurrentIap.iPreSharedKey ) |
|
343 { |
|
344 delete iCurrentIap.iPreSharedKey; |
|
345 iCurrentIap.iPreSharedKey = NULL; |
|
346 } |
|
347 if ( iCurrentIap.iSsid ) |
|
348 { |
|
349 delete iCurrentIap.iSsid; |
|
350 iCurrentIap.iSsid = NULL; |
|
351 } |
|
352 iCurrentIap.iWepKeys.Reset(); |
|
353 if ( aCloseArray ) |
|
354 { |
|
355 iCurrentIap.iWepKeys.Close(); |
|
356 } |
|
357 iCurrentIap.iHidden = EFalse; |
|
358 iCurrentIap.iSecurityType = CMManager::EWlanSecModeOpen; |
|
359 iCurrentIap.iNetworkMode = CMManager::EInfra; |
|
360 iCurrentIap.iWepAuthMode = CWEPSecuritySettings::EAuthOpen; |
|
361 } |
|
362 |
|
363 // --------------------------------------------------------------------------- |
|
364 // Resets iIaps members. |
|
365 // --------------------------------------------------------------------------- |
|
366 // |
|
367 void CVoipXmlIapHandler::ResetTempIapArray( TBool aCloseArray ) |
|
368 { |
|
369 const TInt count = iIaps.Count(); |
|
370 for ( TInt counter = 0; counter < count; counter++ ) |
|
371 { |
|
372 if ( iIaps[counter]->iName ) |
|
373 { |
|
374 delete iIaps[counter]->iName; |
|
375 iIaps[counter]->iName = NULL; |
|
376 } |
|
377 if ( iIaps[counter]->iPreSharedKey ) |
|
378 { |
|
379 delete iIaps[counter]->iPreSharedKey; |
|
380 iIaps[counter]->iPreSharedKey = NULL; |
|
381 } |
|
382 if ( iIaps[counter]->iSsid ) |
|
383 { |
|
384 delete iIaps[counter]->iSsid; |
|
385 iIaps[counter]->iSsid = NULL; |
|
386 } |
|
387 iIaps[counter]->iWepKeys.Reset(); |
|
388 if ( aCloseArray ) |
|
389 { |
|
390 iIaps[counter]->iWepKeys.Close(); |
|
391 } |
|
392 } |
|
393 iIaps.ResetAndDestroy(); |
|
394 if ( aCloseArray ) |
|
395 { |
|
396 iIaps.Close(); |
|
397 } |
|
398 } |
|
399 |
|
400 // --------------------------------------------------------------------------- |
|
401 // Adds iCurrentIap into iIaps array, i.e. copies its values to a pointer |
|
402 // and appends that one into the array. |
|
403 // --------------------------------------------------------------------------- |
|
404 // |
|
405 void CVoipXmlIapHandler::AddCurrentIapL() |
|
406 { |
|
407 if ( !iCurrentIap.iSsid ) |
|
408 { |
|
409 // If there is no SSID, we won't add the IAP to array. |
|
410 return; |
|
411 } |
|
412 TTemporaryIap* iap = new TTemporaryIap; |
|
413 iap->iSsid = HBufC::NewLC( KMaxNodeValueLength ); // CS:1 |
|
414 iap->iName = HBufC::NewLC( KMaxNodeValueLength ); // CS:2 |
|
415 iap->iPreSharedKey = HBufC::NewLC( KMaxNodeValueLength ); // CS:3 |
|
416 |
|
417 iap->iSsid->Des().Copy( iCurrentIap.iSsid->Des() ); |
|
418 if ( iCurrentIap.iName ) |
|
419 { |
|
420 iap->iName->Des().Copy( iCurrentIap.iName->Des() ); |
|
421 } |
|
422 else |
|
423 { |
|
424 iap->iName->Des().Copy( iCurrentIap.iSsid->Des() ); |
|
425 } |
|
426 if ( iCurrentIap.iPreSharedKey ) |
|
427 { |
|
428 iap->iPreSharedKey->Des().Copy( iCurrentIap.iPreSharedKey->Des() ); |
|
429 } |
|
430 iap->iHidden = iCurrentIap.iHidden; |
|
431 iap->iNetworkMode = iCurrentIap.iNetworkMode; |
|
432 iap->iSecurityType = iCurrentIap.iSecurityType; |
|
433 iap->iWepAuthMode = iCurrentIap.iWepAuthMode; |
|
434 const TInt count = iCurrentIap.iWepKeys.Count(); |
|
435 for ( TInt counter = 0; counter < count; counter++ ) |
|
436 { |
|
437 iap->iWepKeys.Append( iCurrentIap.iWepKeys[counter] ); |
|
438 } |
|
439 iIaps.AppendL( iap ); |
|
440 CleanupStack::Pop( 3, iap->iSsid ); |
|
441 } |
|
442 |
|
443 // --------------------------------------------------------------------------- |
|
444 // Stores settings. |
|
445 // --------------------------------------------------------------------------- |
|
446 // |
|
447 void CVoipXmlIapHandler::StoreSettingsL() |
|
448 { |
|
449 RCmManagerExt cmm; |
|
450 cmm.OpenLC(); // CS:1 |
|
451 |
|
452 // First create all access points and store their ID's. |
|
453 const TInt iapCount = iIaps.Count(); |
|
454 RArray<TUint32> iapIds; |
|
455 CleanupClosePushL( iapIds ); // CS:2 |
|
456 for ( TInt counter = 0; counter < iapCount; counter++ ) |
|
457 { |
|
458 TUint32 id = CreateIapL( cmm, *iIaps[counter] ); |
|
459 iapIds.AppendL( id ); |
|
460 } |
|
461 |
|
462 // Create a destination if one was configured. |
|
463 if ( iDestinationName->Des().Length() ) |
|
464 { |
|
465 RArray<TUint32> destinationIds; |
|
466 // Get destination ID's for checking if name to be set is reserved. |
|
467 CleanupClosePushL( destinationIds ); // CS:3 |
|
468 cmm.AllDestinationsL( destinationIds ); |
|
469 HBufC* newName = HBufC::NewLC( KMaxNodeNameLength ); // CS:4 |
|
470 newName->Des().Copy( iDestinationName->Des() ); |
|
471 |
|
472 // Check that name is unique. |
|
473 const TInt destinationCount = destinationIds.Count(); |
|
474 for ( TInt counter = 0; counter < destinationCount; counter++ ) |
|
475 { |
|
476 RCmDestinationExt destination = cmm.DestinationL( |
|
477 destinationIds[counter] ); |
|
478 CleanupClosePushL( destination ); // CS:5 |
|
479 HBufC* settingsName = destination.NameLC(); // CS:6 |
|
480 TUint i( 1 ); // Add number to the name if name already in use. |
|
481 if ( 0 == newName->Des().Compare( settingsName->Des() ) ) |
|
482 { |
|
483 // If the name is changed we need to begin the comparison |
|
484 // again from the first profile. |
|
485 newName->Des().Copy( iDestinationName->Des() ); |
|
486 newName->Des().Append( KOpenParenthesis() ); |
|
487 newName->Des().AppendNum( i ); |
|
488 newName->Des().Append( KClosedParenthesis() ); |
|
489 counter = 0; |
|
490 i++; |
|
491 if ( KMaxProfileNames < i ) |
|
492 { |
|
493 User::Leave( KErrBadName ); |
|
494 } |
|
495 } |
|
496 // settingsName, &destination |
|
497 CleanupStack::PopAndDestroy( 2, &destination ); // CS:4 |
|
498 } |
|
499 RCmDestinationExt newDestination = cmm.CreateDestinationL( *newName ); |
|
500 CleanupClosePushL( newDestination ); // CS:5 |
|
501 // We need to run UpdateL in order to get destination ID. |
|
502 newDestination.UpdateL(); |
|
503 iDestinationId = newDestination.Id(); |
|
504 const TInt cmCount = iapIds.Count(); |
|
505 for ( TInt counter = 0; counter < cmCount; counter++ ) |
|
506 { |
|
507 RCmConnectionMethodExt connection = cmm.ConnectionMethodL( |
|
508 iapIds[counter] ); |
|
509 CleanupClosePushL( connection ); |
|
510 newDestination.AddConnectionMethodL( connection ); |
|
511 CleanupStack::PopAndDestroy( &connection ); |
|
512 } |
|
513 newDestination.UpdateL(); |
|
514 |
|
515 // &newDestination, newName, &destinationIds |
|
516 CleanupStack::PopAndDestroy( 3, &destinationIds ); // CS:2 |
|
517 } |
|
518 // &iapIds, &cmm |
|
519 CleanupStack::PopAndDestroy( 2, &cmm ); // CS:0 |
|
520 } |
|
521 |
|
522 // --------------------------------------------------------------------------- |
|
523 // Creates an actual IAP. |
|
524 // --------------------------------------------------------------------------- |
|
525 // |
|
526 TUint32 CVoipXmlIapHandler::CreateIapL( RCmManagerExt& aCmManager, |
|
527 TTemporaryIap aTempIap ) |
|
528 { |
|
529 RCmConnectionMethodExt newConnMethod = |
|
530 aCmManager.CreateConnectionMethodL( KUidWlanBearerType ); |
|
531 CleanupClosePushL( newConnMethod ); // CS:1 |
|
532 newConnMethod.SetStringAttributeL( CMManager::ECmName, |
|
533 aTempIap.iName->Des() ); |
|
534 newConnMethod.SetStringAttributeL( CMManager::EWlanSSID, |
|
535 aTempIap.iSsid->Des() ); |
|
536 newConnMethod.SetIntAttributeL( CMManager::EWlanConnectionMode, |
|
537 aTempIap.iNetworkMode ); |
|
538 if ( aTempIap.iHidden ) |
|
539 { |
|
540 newConnMethod.SetBoolAttributeL( CMManager::EWlanScanSSID, ETrue ); |
|
541 } |
|
542 newConnMethod.SetIntAttributeL( CMManager::EWlanSecurityMode, |
|
543 aTempIap.iSecurityType ); |
|
544 newConnMethod.UpdateL(); |
|
545 TUint32 wlanId = newConnMethod.GetIntAttributeL( |
|
546 CMManager::EWlanServiceId ); |
|
547 TUint32 iapId = newConnMethod.GetIntAttributeL( CMManager::ECmIapId ); |
|
548 |
|
549 CleanupStack::PopAndDestroy( &newConnMethod ); // CS:0 |
|
550 |
|
551 if ( aTempIap.iSecurityType == CMManager::EWlanSecModeWep ) |
|
552 { |
|
553 CMDBSession* db = CMDBSession::NewLC( CMDBSession::LatestVersion() ); |
|
554 // CS:1 |
|
555 CWEPSecuritySettings* wepSecSettings = |
|
556 CWEPSecuritySettings::NewL(); |
|
557 CleanupStack::PushL( wepSecSettings ); // CS:2 |
|
558 const TInt wepKeyCount = aTempIap.iWepKeys.Count(); |
|
559 for ( TInt counter = 0; counter < wepKeyCount; counter++ ) |
|
560 { |
|
561 User::LeaveIfError( wepSecSettings->SetKeyDataL( |
|
562 counter, aTempIap.iWepKeys[counter].iData, |
|
563 aTempIap.iWepKeys[counter].iHex ) ); |
|
564 } |
|
565 wepSecSettings->SaveL( wlanId, *db ); |
|
566 // wepSecSettings, db |
|
567 CleanupStack::PopAndDestroy( 2, db ); // CS:0 |
|
568 } |
|
569 else if ( aTempIap.iSecurityType == CMManager::EWlanSecMode802_1x || |
|
570 aTempIap.iSecurityType == CMManager::EWlanSecModeWpa || |
|
571 aTempIap.iSecurityType == CMManager::EWlanSecModeWpa2 ) |
|
572 { |
|
573 CMDBSession* db = CMDBSession::NewLC( CMDBSession::LatestVersion() ); |
|
574 // CS:1 |
|
575 CWPASecuritySettings* wpaSecSettings = |
|
576 CWPASecuritySettings::NewL( ESecurityModeWpa ); |
|
577 CleanupStack::PushL( wpaSecSettings ); // CS:2 |
|
578 User::LeaveIfError( wpaSecSettings->SetWPAPreSharedKey( |
|
579 aTempIap.iPreSharedKey->Des() )); |
|
580 wpaSecSettings->SaveL( wlanId, *db, ESavingBrandNewAP, 0 ); |
|
581 // wpaSecSettings, db |
|
582 CleanupStack::PopAndDestroy( 2, db ); // CS:0 |
|
583 } |
|
584 return iapId; |
|
585 } |
|
586 |
|
587 // End of file. |