Revision: 201036 RCL_3 PDK_3.0.4
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 13 Oct 2010 14:35:46 +0300
branchRCL_3
changeset 55 9c2aa05919d9
parent 46 c74b3d9f6b9e
Revision: 201036 Kit: 201041
wlansecuritysettings/wpasecuritysettingsui/data/WPASecuritySettingsUI.rss
wlansecuritysettings/wpasecuritysettingsui/inc/WPASecuritySettingsDlg.h
wlansecuritysettings/wpasecuritysettingsui/inc/WPASecuritySettingsImpl.h
wlansecuritysettings/wpasecuritysettingsui/inc/WPASecuritySettingsImpl.inl
wlansecuritysettings/wpasecuritysettingsui/loc/wpasecuritysettingsui.loc
wlansecuritysettings/wpasecuritysettingsui/src/WPASecuritySettingsDlg.cpp
wlansecuritysettings/wpasecuritysettingsui/src/WPASecuritySettingsImpl.cpp
--- a/wlansecuritysettings/wpasecuritysettingsui/data/WPASecuritySettingsUI.rss	Wed Sep 01 12:23:57 2010 +0100
+++ b/wlansecuritysettings/wpasecuritysettingsui/data/WPASecuritySettingsUI.rss	Wed Oct 13 14:35:46 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 /*
-* %version: tr1cfwln#21 %
+* %version: tr1cfwln#20 %
 */
 
 //  RESOURCE IDENTIFIER
@@ -271,12 +271,7 @@
     { 
     buf = qtn_wlan_sett_allow_tkip;
     }
- 
-RESOURCE TBUF r_wpa_unencrypted_conn
-    {
-    buf = qtn_wlan_sett_unencrypted_conn;
-    }
-
+        
 RESOURCE TBUF r_wpa_mode_eap
     { 
     buf = qtn_wlan_sett_wpa_mode_eap;
@@ -297,16 +292,6 @@
     buf = qtn_wlan_sett_tkip_not_allowed;
     }
 
-RESOURCE TBUF r_wpa_unencrypted_conn_not_allow
-    {
-    buf = qtn_wlan_sett_unencrypted_conn_not_allow;
-    }
-
-RESOURCE TBUF r_wpa_unencrypted_conn_allow
-    {
-    buf = qtn_wlan_sett_unencrypted_conn_allow;
-    }
-
 RESOURCE TBUF r_wpa_preshared_key_must_be_defined
     { 
     buf = qtn_selec_setting_compulsory;
--- a/wlansecuritysettings/wpasecuritysettingsui/inc/WPASecuritySettingsDlg.h	Wed Sep 01 12:23:57 2010 +0100
+++ b/wlansecuritysettings/wpasecuritysettingsui/inc/WPASecuritySettingsDlg.h	Wed Oct 13 14:35:46 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 /*
-* %version: tr1cfwln#21 %
+* %version: tr1cfwln#20 %
 */
 
 #ifndef WPA_SECURITY_SETTINGS_DLG_H
@@ -31,8 +31,7 @@
     EWpaMode,           // WPA mode
     EWpaEapConfig,      // EAP Plugin configuration
     EWpaWpa2Only,       // Wpa2 only mode
-    EWpaPreSharedKey,    // Pre-shared key
-    EWpaUnencryptedConn
+    EWpaPreSharedKey    // Pre-shared key
     };
 
 
--- a/wlansecuritysettings/wpasecuritysettingsui/inc/WPASecuritySettingsImpl.h	Wed Sep 01 12:23:57 2010 +0100
+++ b/wlansecuritysettings/wpasecuritysettingsui/inc/WPASecuritySettingsImpl.h	Wed Oct 13 14:35:46 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 /*
-* %version: tr1cfwln#28 %
+* %version: tr1cfwln#26 %
 */
 
 #ifndef WPASECURITYSETTINGSIMPL_H
@@ -161,20 +161,6 @@
         */
         inline void SetWpa2Only( const TBool aAllowed );
 
-        
-        /**
-        * Tells if 802.1x Unencrypted connection is allowed
-        * @return ETrue if Unencrypted connection is allowed
-        */
-        inline TBool WPAUnencryptedConn() const;
-
-
-        /**
-        * Sets the 802.1x Unencrypted connection enabling variable
-        * @param aUnencryptedConn   ETrue if Unencrypted connection is allowed
-        */
-        inline void SetWPAUnencryptedConn( const TBool aUnencryptedConn );
-        
 
         /**
         * Returns the Pre-shared key
@@ -304,9 +290,6 @@
 
         // WPA2 Only mode enabled or not
         TBool iWpa2Only;
- 
-        // 802.1x unencrypted connection allowed or not
-        TBool iWPAUnencryptedConn;
         
         // The Id of the AP.
         TUint32 iIapId;
--- a/wlansecuritysettings/wpasecuritysettingsui/inc/WPASecuritySettingsImpl.inl	Wed Sep 01 12:23:57 2010 +0100
+++ b/wlansecuritysettings/wpasecuritysettingsui/inc/WPASecuritySettingsImpl.inl	Wed Oct 13 14:35:46 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 /*
-* %version: tr1cfwln#16 %
+* %version: tr1cfwln#15 %
 */
 
 #ifndef WPASECURITYSETTINGSIMPL_INL
@@ -54,16 +54,6 @@
 
 
 // ---------------------------------------------------------
-// CWPASecuritySettingsImpl::WPAUnencryptedConn
-// ---------------------------------------------------------
-//
-inline TBool CWPASecuritySettingsImpl::WPAUnencryptedConn() const
-    { 
-    return iWPAUnencryptedConn; 
-    }
-
-
-// ---------------------------------------------------------
 // CWPASecuritySettingsImpl::WPAPreSharedKey
 // ---------------------------------------------------------
 //
@@ -123,15 +113,6 @@
     }
 
 
-// ---------------------------------------------------------
-// CWPASecuritySettingsImpl::SetWPAUnencryptedConn
-// ---------------------------------------------------------
-//
-inline void CWPASecuritySettingsImpl::SetWPAUnencryptedConn( const TBool aUnencryptedConn )
-    { 
-    iWPAUnencryptedConn = aUnencryptedConn; 
-    }
-
 
 // ---------------------------------------------------------
 // CWPASecuritySettingsImpl::SetWPAPreSharedKey
--- a/wlansecuritysettings/wpasecuritysettingsui/loc/wpasecuritysettingsui.loc	Wed Sep 01 12:23:57 2010 +0100
+++ b/wlansecuritysettings/wpasecuritysettingsui/loc/wpasecuritysettingsui.loc	Wed Oct 13 14:35:46 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 /*
-* %version: tr1cfwln#7 %
+* %version: %
 */
 
 // LOCALISATION STRINGS
@@ -63,14 +63,6 @@
 #define qtn_wlan_sett_allow_tkip                "WPA2-only mode"
 
 
-//d:Fourth element of the Selection List
-//l:list_setting_pane_t1
-//w:
-//r:5.0
-//
-#define qtn_wlan_sett_unencrypted_conn         "Unencrypted connection"
-
-
 //d:Setting item for the first element of the Selection List
 //d:(qtn_wlan_sett_wpa_mode)
 //l:list_set_graphic_pane_t1
@@ -107,24 +99,6 @@
 #define qtn_wlan_sett_tkip_not_allowed          "Yes"
 
 
-//d:Setting item for the fourth element of the Selection List
-//d:(qtn_wlan_sett_unencrypted_conn)
-//l:list_set_graphic_pane_t1
-//w:
-//r:5.0
-//
-#define qtn_wlan_sett_unencrypted_conn_not_allow  "Not allowed"
-
-
-//d:Setting item for the fourth element of the Selection List
-//d:(qtn_wlan_sett_unencrypted_conn)
-//l:list_set_graphic_pane_t1
-//w:
-//r:5.0
-//
-#define qtn_wlan_sett_unencrypted_conn_allow    "Allowed"
-
-
 //d:Information note for the user when the entered key is too short
 //l:popup_snote_single_text_window
 //w:
--- a/wlansecuritysettings/wpasecuritysettingsui/src/WPASecuritySettingsDlg.cpp	Wed Sep 01 12:23:57 2010 +0100
+++ b/wlansecuritysettings/wpasecuritysettingsui/src/WPASecuritySettingsDlg.cpp	Wed Oct 13 14:35:46 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 /*
-* %version: tr1cfwln#33 %
+* %version: tr1cfwln#31 %
 */
 
 // INCLUDE FILES
@@ -115,22 +115,20 @@
     {
 	CleanupStack::PushL( this );
 
-    const TInt Titles_Wpa_Main[KNumOfFieldsMain+2] =
+    const TInt Titles_Wpa_Main[KNumOfFieldsMain+1] =
         {
         R_WPA_MODE,
         R_WPA_EAP_CONFIG,
         R_WPA_MODE_PRESHARED_KEY,
-        R_WPA_TKIP_CIPHER,
-        R_WPA_UNENCRYPTED_CONN
+        R_WPA_TKIP_CIPHER
         };
 
-    const TInt Fields_Wpa_Main[KNumOfFieldsMain+2] =
+    const TInt Fields_Wpa_Main[KNumOfFieldsMain+1] =
         {
         EWpaMode,
         EWpaEapConfig,
         EWpaPreSharedKey,
-        EWpaWpa2Only,
-        EWpaUnencryptedConn
+        EWpaWpa2Only
         };
 
     iSecuritySettings = aSecuritySettings;
@@ -385,13 +383,7 @@
 
         default:
             {
-            // New events like
-            // EEventPanningStarted
-            // EEventPanningStopped
-            // EEventFlickStarted
-            // EEventFlickStopped
-            // EEventEmptyListClicked
-            // EEventEmptyAreaClicked
+            __ASSERT_DEBUG( EFalse, Panic( EUnknownCase ) );
             break;
             };
         };
@@ -467,14 +459,6 @@
 
     for( TInt i = 0; i < numOfFields; i++ )
         {
-        // 802.1x has no WpaMode (PSK not supported) and no Wpa2Only selection
-        if ( iSecuritySettings->SecurityMode() == ESecurityMode8021x && 
-                    (*wpaMember == EWpaMode ||*wpaMember == EWpaWpa2Only ) )
-            {
-            wpaMember++;
-            aRes++;
-            }
-        // If PSK in use, EAP plug-in configuration is not shown
         if ( *wpaMember == EWpaEapConfig && iSecuritySettings->WPAMode() )
             {
             wpaMember++;
@@ -500,20 +484,15 @@
 
             CleanupStack::PopAndDestroy( 2, title );   // itemText, title
             
-            // If Eap in use, PreSharedKey is not shown
             wpaMember++;
             aRes++;
             }
-        else            // EWpaMode, EWpaPreSharedKey, EWpaWpa2Only, EWpaUnencryptedConn:
+        else            // EWpaMode, EWpaPreSharedKey, EWpaWpa2Only:
             {
-            if (( *wpaMember != EWpaUnencryptedConn ) || 
-                (FeatureManager::FeatureSupported( KFeatureIdFfWlanAuthenticationOnlySupport ) ) )
-                {
-                HBufC* itemText = CreateTextualListBoxItemL( *wpaMember, *aRes );
-                CleanupStack::PushL( itemText );
-                aItemArray.AppendL( itemText->Des() );
-                CleanupStack::PopAndDestroy( itemText );
-                }
+            HBufC* itemText = CreateTextualListBoxItemL( *wpaMember, *aRes );
+            CleanupStack::PushL( itemText );
+            aItemArray.AppendL( itemText->Des() );
+            CleanupStack::PopAndDestroy( itemText );
             }
 
         wpaMember++;
@@ -600,13 +579,6 @@
             break;
             }
 
-        case EWpaUnencryptedConn:
-            {
-            valueResourceID = iSecuritySettings->WPAUnencryptedConn() ?
-                              R_WPA_UNENCRYPTED_CONN_ALLOW : R_WPA_UNENCRYPTED_CONN_NOT_ALLOW;
-            break;
-            }
-            
         case EWpaPreSharedKey:
             {
             valueResourceID = 
@@ -673,19 +645,9 @@
     {
     TInt currvalue( 0 );
     TBool retval( EFalse );
-    TInt attr_resid( 0 );
-    
     CDesCArrayFlat* items = FillPopupSettingPageLC( aData,  currvalue );
 
-    
-    if ( aData == EWpaUnencryptedConn)
-        {
-        attr_resid = R_WPA_UNENCRYPTED_CONN;
-        }
-    else
-        {
-        attr_resid = aData == EWpaMode ? R_WPA_MODE : R_WPA_TKIP_CIPHER;
-        }
+    TInt attr_resid = aData == EWpaMode ? R_WPA_MODE : R_WPA_TKIP_CIPHER;
 
     HBufC* titlebuf = iEikonEnv->AllocReadResourceLC( attr_resid );
     CAknRadioButtonSettingPage* dlg = new ( ELeave )CAknRadioButtonSettingPage(
@@ -819,7 +781,7 @@
                                                 R_WPA_MODE_PRESHARED_KEY ) );
         CleanupStack::PopAndDestroy();
         }
-    else if ( aData == EWpaWpa2Only )
+    else        // EWpaWpa2Only:
         {
         items->AppendL( *iEikonEnv->AllocReadResourceLC( 
                                                 R_WPA_CIPHER_ALLOWED ) );
@@ -830,18 +792,7 @@
 
         aCurrvalue = iSecuritySettings->Wpa2Only();
         }
-    else    // EWpaUnencryptedConn
-        {
-        items->AppendL( *iEikonEnv->AllocReadResourceLC( 
-                                            R_WPA_UNENCRYPTED_CONN_NOT_ALLOW ) );
-        CleanupStack::PopAndDestroy();
-        items->AppendL( *iEikonEnv->AllocReadResourceLC( 
-                                            R_WPA_UNENCRYPTED_CONN_ALLOW ) );
-        CleanupStack::PopAndDestroy();
 
-        aCurrvalue = iSecuritySettings->WPAUnencryptedConn();
-        }
-    
     return items;
     }
 
@@ -868,7 +819,7 @@
             retVal = ETrue;
             }
         }
-    else if ( aData == EWpaWpa2Only )
+    else        // EWpaWpa2Only:
         {
         if ( iSecuritySettings->Wpa2Only() != aCurrvalue )
             {   
@@ -876,14 +827,6 @@
             retVal = ETrue;
             }
         }
-    else  // EWpaUnencryptedConn
-        {
-        if ( iSecuritySettings->WPAUnencryptedConn() != aCurrvalue )
-            {   
-            iSecuritySettings->SetWPAUnencryptedConn( aCurrvalue );
-            retVal = ETrue;
-            }
-        }
 
     return retVal;
     }
@@ -915,18 +858,10 @@
 
     itemIndex = ( Max( iList->CurrentItemIndex(), 0 ) );
 
-    //In 802.1x the first item is EapConfig and second item is UncryptedConn
-    if (iSecuritySettings->SecurityMode() == ESecurityMode8021x)
-        {
-        shift = ( itemIndex == EWpaMode ) ? 1 : 3;
-        }
-    else
-        {
-        shift = ( itemIndex >= EWpaWpa2Only || 
-                ( itemIndex == EWpaEapConfig && 
-                        iSecuritySettings->WPAMode() ) ) ? 1 : 0;
-        }
-    
+    shift = ( itemIndex >= EWpaWpa2Only || 
+              ( itemIndex == EWpaEapConfig && 
+                iSecuritySettings->WPAMode() ) ) ? 1 : 0;
+
     TWpaMember* ptr = iFieldsMain + itemIndex + shift;
     TInt* titPtr = iTitlesMain + itemIndex + shift;
 
@@ -989,27 +924,6 @@
             break;
             }
 
-        case EWpaUnencryptedConn:
-             { // Setting item with two available values
-             TBool changed( ETrue );
-             if ( aQuick )
-                 {
-                 iSecuritySettings->SetWPAUnencryptedConn( 
-                                             !iSecuritySettings->WPAUnencryptedConn() );
-                 }
-             else
-                 {
-                 changed = ShowPopupSettingPageL( EWpaUnencryptedConn );
-                 }
-
-             if ( changed )
-                 {
-                 UpdateTextualListBoxItemL( *ptr, *titPtr, itemIndex );
-                 *iEventStore |= CWPASecuritySettings::EModified;
-                 }
-             break;
-             }
-
         case EWpaPreSharedKey:
             { // Text setting item
             if ( ShowPopupTextSettingPageL() )
--- a/wlansecuritysettings/wpasecuritysettingsui/src/WPASecuritySettingsImpl.cpp	Wed Sep 01 12:23:57 2010 +0100
+++ b/wlansecuritysettings/wpasecuritysettingsui/src/WPASecuritySettingsImpl.cpp	Wed Oct 13 14:35:46 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 /*
-* %version: tr1cfwln#29 %
+* %version: tr1cfwln#27 %
 */
 
 // INCLUDE FILES
@@ -69,8 +69,7 @@
                                                 TSecurityMode aSecurityMode )
 : iSecurityMode( aSecurityMode ),
   iWPAMode( EFalse ),
-  iWpa2Only( EFalse ),
-  iWPAUnencryptedConn( EFalse )
+  iWpa2Only( EFalse )
     {
     iWPAEAPPlugin.Zero();
     iWPAPreSharedKey.Zero();
@@ -124,26 +123,18 @@
     TInt errorCode = wLanServiceTable->GotoFirstRecord();
     if ( errorCode == KErrNone )
         {
-        if ( iSecurityMode == ESecurityMode8021x )
-            {
-            // in 802.1x PSK mode is not supported
-            iWPAMode = EFalse;
+        // Get WPA Mode
+        TRAPD( err, wLanServiceTable->ReadUintL( TPtrC( WLAN_ENABLE_WPA_PSK ),
+                                                ( TUint32& ) iWPAMode ) );
+        if ( err != KErrNone )
+            { // do not leave if value is not present in table...
+            if ( err != KErrUnknown )
+                User::Leave( err );
             }
-        else
-            {
-            // Get WPA Mode
-            TRAPD( err, wLanServiceTable->ReadUintL( TPtrC( WLAN_ENABLE_WPA_PSK ),
-                                                    ( TUint32& ) iWPAMode ) );
-            if ( err != KErrNone )
-                { // do not leave if value is not present in table...
-                if ( err != KErrUnknown )
-                    User::Leave( err );
-                }
-            }
-        
+
         TUint32 secMode = 0;
         // Get WPA2 Only Mode
-        TRAPD( err, wLanServiceTable->ReadUintL( TPtrC( WLAN_SECURITY_MODE ),
+        TRAP( err, wLanServiceTable->ReadUintL( TPtrC( WLAN_SECURITY_MODE ),
                                                  secMode ) );
         if ( err != KErrNone )
             { // do not leave if value is not present in table...
@@ -153,19 +144,6 @@
 
         iWpa2Only = secMode == EWpa2;
 
-        // Get Unencrypted Connection mode for 802.1x
-        if ( iSecurityMode == ESecurityMode8021x )
-            {
-            // WLAN_WPA_KEY_LENGTH is used also for Unencrypted Connection mode
-            TRAPD( err2, wLanServiceTable->ReadUintL( TPtrC( WLAN_WPA_KEY_LENGTH ),
-                                                ( TUint32& ) iWPAUnencryptedConn ) );
-            if ( err2 != KErrNone )
-                { // do not leave if value is not present in table...
-                if ( err2 != KErrUnknown )
-                    User::Leave( err2 );
-                }
-            }
-
         // Get EAP list
     	iWPAEAPPlugin.Copy( *wLanServiceTable->ReadLongTextLC( 
                                                         TPtrC( WLAN_EAPS ) ) );
@@ -270,11 +248,8 @@
 	        }
 	        
         // Get PreShared Key
-	    if ( iSecurityMode != ESecurityMode8021x )
-	        {
-            wLanServiceTable->ReadTextL( TPtrC( WLAN_WPA_PRE_SHARED_KEY ), 
+        wLanServiceTable->ReadTextL( TPtrC( WLAN_WPA_PRE_SHARED_KEY ), 
                                     iWPAPreSharedKey );
-	        }
 
         if ( !IsValidPsk( iWPAPreSharedKey ) )
             {       
@@ -318,11 +293,8 @@
         }
 
     // Save WPA Mode
-    if ( iSecurityMode != ESecurityMode8021x )
-        {
-        wLanServiceTable->WriteUintL( TPtrC( WLAN_ENABLE_WPA_PSK ), 
+    wLanServiceTable->WriteUintL( TPtrC( WLAN_ENABLE_WPA_PSK ), 
                                   ( TUint32& ) iWPAMode );
-        }
 
     TUint32 secMode;
 
@@ -359,26 +331,13 @@
                                   iWPADisabledEAPPlugin? 
                                         (const TDesC8&)*iWPADisabledEAPPlugin: 
                                         (const TDesC8&)KNullDesC8 );
- 
-
+    // Save PreShared Key
+    wLanServiceTable->WriteTextL( TPtrC( WLAN_WPA_PRE_SHARED_KEY ), 
+                                  iWPAPreSharedKey );
 
-    if ( iSecurityMode == ESecurityMode8021x )
-        {
-        // In 802.1x WpaKeyLength is not used 
-        // and the field is reused to save UnencryptedConn mode
-        wLanServiceTable->WriteUintL( TPtrC( WLAN_WPA_KEY_LENGTH ), 
-                                      ( TUint32& ) iWPAUnencryptedConn );
-        }
-    else
-        {
-        // Save PreShared Key
-        wLanServiceTable->WriteTextL( TPtrC( WLAN_WPA_PRE_SHARED_KEY ), 
-                                  iWPAPreSharedKey );
-    
-        // Save PreShared Key Length
-        wLanServiceTable->WriteUintL( TPtrC( WLAN_WPA_KEY_LENGTH ), 
-                                        iWPAPreSharedKey.Length() );
-        }
+    // Save PreShared Key Length
+    wLanServiceTable->WriteUintL( TPtrC( WLAN_WPA_KEY_LENGTH ), 
+                                  iWPAPreSharedKey.Length() );
 
     wLanServiceTable->PutRecordChanges();
 
@@ -583,32 +542,16 @@
 
     if( generic->FindL( aSession) )
         {
-        if ( iSecurityMode == ESecurityMode8021x )
-            {
-            // in 802.1x PSK mode is not supported
-            iWPAMode = EFalse;
-            }
-        else
-            {
-            // Get WPA mode
-            CMDBField<TUint>* enableWpaPskField = static_cast<CMDBField<TUint>*>
+        // Get WPA mode
+        CMDBField<TUint>* enableWpaPskField = static_cast<CMDBField<TUint>*>
                           ( generic->GetFieldByIdL( KCDTIdWlanEnableWpaPsk ) );
-            iWPAMode = *enableWpaPskField;
-            }
+        iWPAMode = *enableWpaPskField;
         
         // Get WPA2 Only Mode
         CMDBField<TUint>* secModeField = static_cast<CMDBField<TUint>*>
                                ( generic->GetFieldByIdL( KCDTIdWlanSecMode ) );
         TUint32 secMode = *secModeField;
         iWpa2Only = secMode == EWpa2;
- 
-        // Get 802.1x Unencrypted Connection saved in reused WpaKeyLengthField
-        if ( iSecurityMode == ESecurityMode8021x )
-            {
-            CMDBField<TUint>* WpaKeyLengthField = static_cast<CMDBField<TUint>*>
-                          ( generic->GetFieldByIdL( KCDTIdWlanWpaKeyLength ) );
-            iWPAUnencryptedConn = *WpaKeyLengthField;
-            }
         
         // Get EAP plugins
         CMDBField<TDesC>* wlanEapsField = static_cast<CMDBField<TDesC>*>
@@ -709,13 +652,10 @@
 	        }
 
         // GetWPA preshared key
-	    if ( iSecurityMode != ESecurityMode8021x )
-	        {
-            CMDBField<TDesC8>* wpaPskField = static_cast<CMDBField<TDesC8>*>
+        CMDBField<TDesC8>* wpaPskField = static_cast<CMDBField<TDesC8>*>
                        ( generic->GetFieldByIdL( KCDTIdWlanWpaPreSharedKey ) );
-            iWPAPreSharedKey = *wpaPskField;
-	        }
-	    
+        iWPAPreSharedKey = *wpaPskField;
+        
         if ( !IsValidPsk( iWPAPreSharedKey ) )
             {       
             // invalid key format
@@ -758,14 +698,11 @@
    
     // If loading failed, WLAN service record will be 
     // created and StoreL()-d, otherwise, ModifyL()
-
-    if ( iSecurityMode != ESecurityMode8021x )
-        {
-        // Set WPA mode
-        CMDBField<TUint>* enableWpaPskField = static_cast<CMDBField<TUint>*>
-                ( generic->GetFieldByIdL( KCDTIdWlanEnableWpaPsk ) );
-        enableWpaPskField->SetL( iWPAMode );
-        }
+    
+    // Set WPA mode
+    CMDBField<TUint>* enableWpaPskField = static_cast<CMDBField<TUint>*>
+                          ( generic->GetFieldByIdL( KCDTIdWlanEnableWpaPsk ) );
+    enableWpaPskField->SetL( iWPAMode );
     
     // Set security mode
     TUint32 secMode;
@@ -808,23 +745,15 @@
                                     (const TDesC8&)*iWPADisabledEAPPlugin: 
                                     (const TDesC8&)KNullDesC8 );
 
+    // Save PreShared Key
+    CMDBField<TDesC8>* wpaPskField = static_cast<CMDBField<TDesC8>*>
+                       ( generic->GetFieldByIdL( KCDTIdWlanWpaPreSharedKey ) );
+    wpaPskField->SetL( iWPAPreSharedKey );
+
     // Save PreShared Key length
     CMDBField<TUint>* keyLengthField = static_cast<CMDBField<TUint>*>
                         ( generic->GetFieldByIdL( KCDTIdWlanWpaKeyLength ) );
-    if ( iSecurityMode == ESecurityMode8021x )
-        {
-        // In 802.1x keyLengthField is reused to contain Unencrypted Connection info
-        keyLengthField->SetL( iWPAUnencryptedConn );
-        }
-    else
-        {
-        keyLengthField->SetL( iWPAPreSharedKey.Length() );
-        
-        // Save PreShared Key
-        CMDBField<TDesC8>* wpaPskField = static_cast<CMDBField<TDesC8>*>
-                           ( generic->GetFieldByIdL( KCDTIdWlanWpaPreSharedKey ) );
-        wpaPskField->SetL( iWPAPreSharedKey );
-        }
+    keyLengthField->SetL( iWPAPreSharedKey.Length() );
     
     TInt error( KErrNone );