# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1273845418 -10800 # Node ID 001d4d78e3502a31ab96261e7648437d3714f371 # Parent 498f361161400ea43218d11905aeb2756c6ec21e Revision: 201017 Kit: 201019 diff -r 498f36116140 -r 001d4d78e350 hotspotfw/hsclient/inc/hssiaphandler.h --- a/hotspotfw/hsclient/inc/hssiaphandler.h Mon May 03 13:32:51 2010 +0300 +++ b/hotspotfw/hsclient/inc/hssiaphandler.h Fri May 14 16:56:58 2010 +0300 @@ -100,14 +100,7 @@ void PackWepKeyCommsDatL( const SHssWep& aInputKey, const EHssWEPKeyFormat& aFormat, CMDBField* aPackedKey ); - - /** - * Converts Hotspot EAP settings to EAPOL EAP settings - * @param aHssEap, Hotspot EAP settings - * @param aEap, EAPOL EAP settings - */ - void ConvertEApSettings( THssEapSettings& aHssEap, EAPSettings& aEap ); - + /** * Converts ascii to hecxadecimal * @param aSource, ascii @@ -116,14 +109,6 @@ void ConvertAsciiToHex( const TDes8& aSource, HBufC8*& aDest ); - /** - * Writes eap type to descriptor - * @param aEapType, Eap type - * @param aEapString, Eap type descrpitor - * @param aEapCode, Eap id code - */ - void GetEapTypeDesC( TUint aEapType, TDes8& aEapString, TChar& aEapCode ); - private: // Data /** diff -r 498f36116140 -r 001d4d78e350 hotspotfw/hsclient/src/hssiaphandler.cpp --- a/hotspotfw/hsclient/src/hssiaphandler.cpp Mon May 03 13:32:51 2010 +0300 +++ b/hotspotfw/hsclient/src/hssiaphandler.cpp Fri May 14 16:56:58 2010 +0300 @@ -18,7 +18,6 @@ // INCLUDE FILES -#include #include #include "hssiaphandler.h" #include "hotspotclientserver.h" @@ -40,9 +39,9 @@ // ----------------------------------------------------------------------------- // CHssIapHandler::CHssIapHandler( ) - { + { DEBUG("CHssIapHandler::CHssIapHandler"); - } + } // ----------------------------------------------------------------------------- // ConstructL @@ -71,15 +70,15 @@ // ----------------------------------------------------------------------------- // CHssIapHandler::~CHssIapHandler() - { - DEBUG("CHssIapHandler::~CHssIapHandler()"); + { + DEBUG("CHssIapHandler::~CHssIapHandler()"); - if ( iWLANRecord != NULL ) - { - delete iWLANRecord; - } - iWLANRecord = NULL; - } + if ( iWLANRecord != NULL ) + { + delete iWLANRecord; + } + iWLANRecord = NULL; + } // ----------------------------------------------------------------------------- // ChangeSettingsL @@ -108,8 +107,8 @@ // Read WLAN table service id TUint32 serviceId(0); - RCmConnectionMethodExt plugin = cmManager.ConnectionMethodL( aIapID ); - CleanupClosePushL( plugin ); + RCmConnectionMethodExt plugin = cmManager.ConnectionMethodL( aIapID ); + CleanupClosePushL( plugin ); serviceId = plugin.GetIntAttributeL( EWlanServiceId ); DEBUG1("CHssIapHandler::ChangeSettingsL WLAN serviceId: %d", serviceId); @@ -125,7 +124,7 @@ CMDBSession* dbSession = CMDBSession::NewL(CMDBSession::LatestVersion()); CleanupStack::PushL( dbSession ); iWLANRecord = static_cast - ( CCDRecordBase::RecordFactoryL( 0)); + ( CCDRecordBase::RecordFactoryL( 0 ) ); iWLANRecord->InitializeL( KGenericTable(),NULL ); iWLANRecord->SetRecordId( serviceId ); @@ -156,9 +155,9 @@ // -> Destination can become unusable. TInt secMode = aSettings.iSecurityMode; if ( secMode > EHssWpa2Only ) - { - secMode = EHssAllowUnsecure; - } + { + secMode = EHssAllowUnsecure; + } if( secMode == EHssWep ) { @@ -194,88 +193,12 @@ *((CMDBField*)iWLANRecord->GetFieldByIdL(KCDTIdWlanWpaKeyLength)) = aSettings.iWPAKeyLength; *((CMDBField*)iWLANRecord->GetFieldByIdL(KCDTIdWlanEnableWpaPsk)) = aSettings.iEnableWpaPsk; } - else // Use EAP + else // Use EAP. EAP settings can be set with EAP API. { DEBUG("CHssIapHandler::ChangeSettingsL -> SecurityMode > EHssWep -> EAP"); *((CMDBField*)iWLANRecord->GetFieldByIdL(KCDTIdWlanEnableWpaPsk)) = aSettings.iEnableWpaPsk; } } - - // access point updated EAP data can be now set if needed - if ( ( !aSettings.iEnableWpaPsk ) && secMode > EHssWep ) - { - DEBUG("CHssIapHandler::ChangeSettingsL -> Set EAP data"); - TBuf8 enabledEapList; - for (TInt i=0;i eapTypeCue; - TChar eapCode; - GetEapTypeDesC(aSettings.iEapDataArray[i]->iEAPType, eapTypeCue, eapCode ); - - CEapType* eapType = NULL; - TRAPD( error, ( eapType = CEapType::NewL( eapTypeCue, ELan, serviceId ) ) ); - DEBUG1(" CEapType::NewL error: %d", error); - if ( ( error == KErrNone ) && eapType ) - { - CleanupStack::PushL( eapType ); - EAPSettings* eapSettings = new (ELeave) EAPSettings; - - ConvertEApSettings( *aSettings.iEapDataArray[i], *eapSettings ); - - // Set EAP tunneling - if ( aSettings.iEapDataArray[i]->iEncapsulatedInside != EAPSettings::EEapNone ) - { - DEBUG("iEncapsulatedInside != EAPSettings::EEapNone"); - eapType->SetTunnelingType( - static_cast ( aSettings.iEapDataArray[i]->iEncapsulatedInside ) ); - } - else // Write to EAP list - { - DEBUG("CHssIapHandler::ChangeSettingsL -> Add to EAP list"); - TBuf8<8> expandedForm; - expandedForm.AppendFill( 0xFE, 1 ); - if ( THssEapSettings::EEapPlainMschapv2 == aSettings.iEapDataArray[i]->iEAPType ) - { - expandedForm.AppendFill( 0xFF, 3 ); - } - else{ - expandedForm.AppendFill( 0x00, 6 ); - } - - expandedForm.AppendFill( eapCode, 1 ); - - enabledEapList.Append( expandedForm ); - } - - DEBUG("CHssIapHandler::ChangeSettingsL -> eapType->SetConfigurationL"); - TRAPD( eapErr, eapType->SetConfigurationL( *eapSettings ) ); - DEBUG1(" eapType->SetConfigurationL error: %d", eapErr); - if( eapErr != KErrNone ) - { - CleanupStack::PopAndDestroy( eapType ); - CleanupStack::PopAndDestroy( dbSession ); - DEBUG("CHssIapHandler::ChangeSettingsL EapError DONE"); - return eapErr; - } - CleanupStack::PopAndDestroy( eapType ); - } - if ( error != KErrNone ) - { - DEBUG("CHssIapHandler::ChangeSettingsL Eap error"); - CleanupStack::PopAndDestroy( dbSession ); - return error; - } - } - - // Set enabled EAP list - if ( enabledEapList.Length() > 0 ) - { - DEBUG("CHssIapHandler::ChangeSettingsL -> Set EAP list"); - CMDBField* eaps = (CMDBField*)iWLANRecord->GetFieldByIdL( KCDTIdWlanEnabledEaps ); - //eaps->SetMaxLengthL( eapList16.Length() ) - eaps->SetL( enabledEapList ); - } - } // now update the access point iWLANRecord->ModifyL( *dbSession ); @@ -375,65 +298,6 @@ aPackedKey->SetL( wepBuf); } - -// ----------------------------------------------------------------------------- -// ConvertEApSettings -// ----------------------------------------------------------------------------- -// -void CHssIapHandler::ConvertEApSettings( THssEapSettings& aHssEap, EAPSettings& aEap ) - { - DEBUG("CHssIapHandler::ConvertEApSettings"); - aEap.iEAPType = static_cast(aHssEap.iEAPType); - aEap.iUsernamePresent = aHssEap.iUsernamePresent; - aEap.iUsername = aHssEap.iUsername; - aEap.iPasswordPresent = aHssEap.iPasswordPresent; - aEap.iPassword = aHssEap.iPassword; - aEap.iRealmPresent = aHssEap.iRealmPresent; - aEap.iRealm = aHssEap.iRealm; - aEap.iUsePseudonymsPresent = aHssEap.iUsePseudonymsPresent; - aEap.iUsePseudonyms = aHssEap.iUsePseudonyms; - aEap.iVerifyServerRealmPresent = aHssEap.iVerifyServerRealmPresent; - aEap.iVerifyServerRealm = aHssEap.iVerifyServerRealm; - aEap.iRequireClientAuthenticationPresent = aHssEap.iRequireClientAuthenticationPresent; - aEap.iRequireClientAuthentication = aHssEap.iRequireClientAuthentication; - aEap.iSessionValidityTimePresent = aHssEap.iSessionValidityTimePresent; - aEap.iSessionValidityTime = aHssEap.iSessionValidityTime; - aEap.iCipherSuitesPresent = aHssEap.iCipherSuitesPresent; - - for( TInt i = 0; i < aHssEap.iCipherSuitesCount; i++ ) - { - aEap.iCipherSuites.Append( aHssEap.iCipherSuites[i] ); - } - aEap.iPEAPVersionsPresent = aHssEap.iPEAPVersionsPresent; - aEap.iPEAPv0Allowed = aHssEap.iPEAPv0Allowed; - aEap.iPEAPv1Allowed = aHssEap.iPEAPv1Allowed; - aEap.iPEAPv2Allowed = aHssEap.iPEAPv2Allowed; - aEap.iCertificatesPresent = aHssEap.iCertificatesPresent; - for( TInt i = 0; i < aHssEap.iCertificatesCount; i++ ) - { - DEBUG("CHssIapHandler::ConvertEApSettings Certificates present"); - CertificateEntry entry; - - entry.iCertType = static_cast( aHssEap.iCertificates[i]->iCertType ); - entry.iSubjectNamePresent = aHssEap.iCertificates[i]->iSubjectNamePresent; - entry.iSubjectName = aHssEap.iCertificates[i]->iSubjectName; - entry.iIssuerNamePresent = aHssEap.iCertificates[i]->iIssuerNamePresent; - entry.iIssuerName = aHssEap.iCertificates[i]->iIssuerName; - entry.iSerialNumberPresent= aHssEap.iCertificates[i]->iSerialNumberPresent; - entry.iSerialNumber = aHssEap.iCertificates[i]->iSerialNumber; - entry.iSubjectKeyIDPresent = aHssEap.iCertificates[i]->iSubjectKeyIDPresent; - entry.iSubjectKeyID = aHssEap.iCertificates[i]->iSubjectKeyID; - - entry.iThumbprintPresent = aHssEap.iCertificates[i]->iThumbprintPresent; - entry.iThumbprint = aHssEap.iCertificates[i]->iThumbprint; - TRAP_IGNORE( aEap.iCertificates.AppendL( entry ) ); // Memory problem, ignored... - } - aEap.iEncapsulatedEAPTypesPresent = aHssEap.iEncapsulatedEAPTypesPresent; - for( TInt i = 0; i < aHssEap.iEncapsulatedEAPTypesCount; i++ ) - { - aEap.iEncapsulatedEAPTypes.Append( aHssEap.iEncapsulatedEAPTypes[i] ); - } - } // ----------------------------------------------------------------------------- // ConvertAsciiToHex @@ -455,78 +319,6 @@ } // ----------------------------------------------------------------------------- -// GetEapTypeDesC -// ----------------------------------------------------------------------------- -// -void CHssIapHandler::GetEapTypeDesC( TUint aEapType, TDes8& aEapString, TChar& aEapCode ) - { - DEBUG1( "CHssIapHandler::GetEapTypeDesC aEapType: %d", aEapType ); - switch ( aEapType ) - { - // EapNone - case 0: - aEapString.Copy( KEapNoneId, KEapExpandedIdLength ); - aEapCode = KEapNoneId[7]; - break; - // KEapGtc - case 6: - aEapString.Copy( KEapGtcId, KEapExpandedIdLength ); - aEapCode = KEapGtcId[7]; - break; - // KEapTls - case 13: - aEapString.Copy( KEapTlsId, KEapExpandedIdLength ); - aEapCode = KEapTlsId[7]; - break; - // KEapLeap - case 17: - aEapString.Copy( KEapLeapId, KEapExpandedIdLength ); - aEapCode = KEapLeapId[7]; - break; - // KEapSim - case 18: - aEapString.Copy( KEapSimId, KEapExpandedIdLength ); - aEapCode = KEapSimId[7]; - break; - // KEapTtls - case 21: - aEapString.Copy( KEapTtlsId, KEapExpandedIdLength ); - aEapCode = KEapTtlsId[7]; - break; - // KEapAka - case 23: - aEapString.Copy( KEapAkaId, KEapExpandedIdLength ); - aEapCode = KEapAkaId[7]; - break; - // KEapPeap - case 25: - aEapString.Copy( KEapPeapId, KEapExpandedIdLength ); - aEapCode = KEapPeapId[7]; - break; - // KEapMschapv2 - case 26: - aEapString.Copy( KEapMschapv2Id, KEapExpandedIdLength ); - aEapCode = KEapMschapv2Id[7]; - break; - // KEapSecurid - case 32: - aEapString.Copy( KEapSecuridId, KEapExpandedIdLength ); - aEapCode = KEapSecuridId[7]; - break; - // KEapPlainMschapv2 - case 99: - aEapString.Copy( KEapPlainMschapv2Id, KEapExpandedIdLength ); - aEapCode = KEapPlainMschapv2Id[7]; - break; - default: - aEapString.Copy( KEapNoneId, KEapExpandedIdLength ); - aEapCode = KEapNoneId[7]; - break; - } - DEBUG( "CHssIapHandler::GetEapTypeDesC DONE" ); - } - -// ----------------------------------------------------------------------------- // GetNetworkIdL // ----------------------------------------------------------------------------- // diff -r 498f36116140 -r 001d4d78e350 hsfw_plat/hotspot_framework_client_api/group/bld.inf --- a/hsfw_plat/hotspot_framework_client_api/group/bld.inf Mon May 03 13:32:51 2010 +0300 +++ b/hsfw_plat/hotspot_framework_client_api/group/bld.inf Fri May 14 16:56:58 2010 +0300 @@ -32,4 +32,4 @@ ../inc/hssmgmtscaninfo.h MW_LAYER_PLATFORM_EXPORT_PATH(hssmgmtscaninfo.h) ../inc/hssmgmtclient.inl MW_LAYER_PLATFORM_EXPORT_PATH(hssmgmtclient.inl) ../inc/hssmgmtscaninfo.inl MW_LAYER_PLATFORM_EXPORT_PATH(hssmgmtscaninfo.inl) -../inc/hssiapsettings.inl MW_LAYER_PLATFORM_EXPORT_PATH(hssiapsettings.inl) + diff -r 498f36116140 -r 001d4d78e350 hsfw_plat/hotspot_framework_client_api/inc/hssiapsettings.h --- a/hsfw_plat/hotspot_framework_client_api/inc/hssiapsettings.h Mon May 03 13:32:51 2010 +0300 +++ b/hsfw_plat/hotspot_framework_client_api/inc/hssiapsettings.h Fri May 14 16:56:58 2010 +0300 @@ -30,9 +30,6 @@ const TInt KHssMaxMedTextLength = 255; const TUint8 KHssMaxSSIDLength = 32; const TUint32 KHssMaxWEPKeyLength = 29; -const TUint KHssGeneralStringMaxLength = 255; -const TUint KHssKeyIdentifierLength = 20; -const TUint KHssThumbprintMaxLength = 64; const TInt KHssMaxNumberOfKeys = 4; // DATA TYPES @@ -76,138 +73,6 @@ /** Array that stores the WEP key. */ TUint8 KeyMaterial[KHssMaxWEPKeyLength]; }; - - - - -/** -* class containing Certificate info for EAP settings -*/ -class THssCertificateEntry -{ -public: - - enum THssCertType - { - EUser, - ECA - }; - - THssCertificateEntry(); - - // Specifies whether this entry describes user or CA certificate (mandatory) - THssCertType iCertType; - - // Subject name in distinguished name ASCII form. - // For example "/C=US/O=Some organization/CN=Some common name". - TBool iSubjectNamePresent; - TBuf iSubjectName; - - // Issuer name in distinguished name ASCII form. - // For example "/C=US/O=Some organization/CN=Some common name". - TBool iIssuerNamePresent; - TBuf iIssuerName; - - // Serial number in ASCII form. - TBool iSerialNumberPresent; - TBuf iSerialNumber; - - // Subject key in binary form - TBool iSubjectKeyIDPresent; - TBuf8 iSubjectKeyID; - - // Thumbprint in binary form - TBool iThumbprintPresent; - TBuf iThumbprint; -}; - - -/** -* class containing EAP settings -*/ -class THssEapSettings -{ -public: - - enum THssEapType - { - EEapNone = 0, - EEapGtc = 6, - EEapTls = 13, - EEapLeap = 17, - EEapSim = 18, - EEapTtls = 21, - EEapAka = 23, - EEapPeap = 25, - EEapMschapv2 = 26, - EEapSecurid = 32, - EEapPlainMschapv2 = 99 - }; - - THssEapSettings(); - - void ExternalizeL( RWriteStream& aStream ) const; - - void InternalizeL( RReadStream& aStream ); - - // Specifies the EAP type these settings are for. - // Is not really needed but is here so just some sanity checks can be made - THssEapType iEAPType; - - // Username in ASCII format - TBool iUsernamePresent; - TBuf iUsername; - - // Password in ASCII format - TBool iPasswordPresent; - TBuf iPassword; - - // Realm in ASCII format - TBool iRealmPresent; - TBuf iRealm; - - // Use pseudonym identities in EAP-SIM/AKA - TBool iUsePseudonymsPresent; - TBool iUsePseudonyms; - - // Whether EAP-TLS/TTLS/PEAP should verify server realm - TBool iVerifyServerRealmPresent; - TBool iVerifyServerRealm; - - // Whether EAP-TLS/TTLS/PEAP should require client authentication - TBool iRequireClientAuthenticationPresent; - TBool iRequireClientAuthentication; - - // General session validity time (in minutes) - TBool iSessionValidityTimePresent; - TUint iSessionValidityTime; - - // An array of allowed cipher suites for EAP-TLS/TTLS/PEAP. - // Refer to RFC2246 chapter A.5 for the values. - TBool iCipherSuitesPresent; - TUint iCipherSuitesCount; - RArray iCipherSuites; - - // In EAP-PEAP is version 0 allowed - TBool iPEAPVersionsPresent; - TBool iPEAPv0Allowed; - TBool iPEAPv1Allowed; - TBool iPEAPv2Allowed; - - // Array listing the allowed certificates for EAP-TLS/TTLS/PEAP - TBool iCertificatesPresent; - TUint iCertificatesCount; - RPointerArray iCertificates; - - // Array listing the encapsulated EAP types (in priority order) - TBool iEncapsulatedEAPTypesPresent; - TUint iEncapsulatedEAPTypesCount; - RArray iEncapsulatedEAPTypes; - - // EAP type that this THssEapSettings type is encapsulated to - // Example: For EEapMschapv2 type this value could be EEapPeap - THssEapType iEncapsulatedInside; -}; /** * struct containing all wlan settings data @@ -237,13 +102,8 @@ TBuf8 iWPAPreSharedKey; TUint32 iWPAKeyLength; TBool iEnableWpaPsk; - - RPointerArray iEapDataArray; }; - -#include "hssiapsettings.inl" - #endif // HSSIAPSETTINGS_H // end of file diff -r 498f36116140 -r 001d4d78e350 hsfw_plat/hotspot_framework_client_api/inc/hssiapsettings.inl --- a/hsfw_plat/hotspot_framework_client_api/inc/hssiapsettings.inl Mon May 03 13:32:51 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,161 +0,0 @@ -/* -* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: EAP and WLAN authentication protocols. -* -*/ - - - -inline THssCertificateEntry::THssCertificateEntry() -: iSubjectNamePresent(EFalse) -, iIssuerNamePresent(EFalse) -, iSerialNumberPresent(EFalse) -, iSubjectKeyIDPresent(EFalse) -, iThumbprintPresent(EFalse) - { - } - -inline THssEapSettings::THssEapSettings() -: iUsernamePresent(EFalse) -, iPasswordPresent(EFalse) -, iRealmPresent(EFalse) -, iVerifyServerRealmPresent(EFalse) -, iRequireClientAuthenticationPresent(EFalse) -, iSessionValidityTimePresent(EFalse) -, iCipherSuitesPresent(EFalse) -, iCipherSuites(1) -, iPEAPVersionsPresent(EFalse) -, iCertificatesPresent(EFalse) -, iCertificates(1) -, iEncapsulatedEAPTypesPresent(EFalse) -, iEncapsulatedEAPTypes(1) -, iEncapsulatedInside( EEapNone ) - { - } - -inline void THssEapSettings::ExternalizeL( RWriteStream& aStream ) const - { - aStream.WriteInt32L( iEAPType ); - aStream.WriteUint32L( iUsernamePresent ); - aStream << iUsername; - aStream.WriteUint32L( iPasswordPresent ); - aStream << iPassword; - aStream.WriteUint32L( iRealmPresent ); - aStream << iRealm; - aStream.WriteUint32L( iUsePseudonymsPresent ); - aStream.WriteUint32L( iUsePseudonyms ); - aStream.WriteUint32L( iVerifyServerRealmPresent ); - aStream.WriteUint32L( iVerifyServerRealm ); - aStream.WriteUint32L( iRequireClientAuthenticationPresent ); - aStream.WriteUint32L( iRequireClientAuthentication ); - aStream.WriteUint32L( iSessionValidityTimePresent ); - aStream.WriteUint32L( iSessionValidityTime ); - aStream.WriteUint32L( iCipherSuitesPresent ); - aStream.WriteUint32L( iCipherSuitesCount); - for( TInt i = 0; i < iCipherSuitesCount; i++ ) - { - aStream.WriteUint32L(iCipherSuites[i]); - } - aStream.WriteUint32L( iPEAPVersionsPresent ); - aStream.WriteUint32L( iPEAPv0Allowed ); - aStream.WriteUint32L( iPEAPv1Allowed ); - aStream.WriteUint32L( iPEAPv2Allowed ); - aStream.WriteUint32L( iCertificatesPresent ); - aStream.WriteUint32L( iCertificatesCount); - for( TInt i = 0; i < iCertificatesCount; i++ ) - { - aStream.WriteInt32L( iCertificates[i]->iCertType ); - aStream.WriteUint32L( iCertificates[i]->iSubjectNamePresent ); - aStream << iCertificates[i]->iSubjectName; - aStream.WriteUint32L( iCertificates[i]->iIssuerNamePresent ); - aStream << iCertificates[i]->iIssuerName; - aStream.WriteUint32L( iCertificates[i]->iSerialNumberPresent ); - aStream << iCertificates[i]->iSerialNumber; - aStream.WriteUint32L( iCertificates[i]->iSubjectKeyIDPresent ); - aStream << iCertificates[i]->iSubjectKeyID; - aStream.WriteUint32L( iCertificates[i]->iThumbprintPresent ); - aStream << iCertificates[i]->iThumbprint; - } - aStream.WriteUint32L( iEncapsulatedEAPTypesPresent ); - aStream.WriteUint32L( iEncapsulatedEAPTypesCount ); - for( TInt i = 0; i < iEncapsulatedEAPTypesCount; i++ ) - { - aStream.WriteUint32L( iEncapsulatedEAPTypes[i] ); - } - } - -inline void THssEapSettings::InternalizeL( RReadStream& aStream ) - { - iEAPType = static_cast(aStream.ReadInt32L()); - iUsernamePresent = aStream.ReadUint32L(); - aStream >>iUsername; - iPasswordPresent = aStream.ReadUint32L(); - aStream >>iPassword; - iRealmPresent = aStream.ReadUint32L(); - aStream >>iRealm; - iUsePseudonymsPresent = aStream.ReadUint32L(); - iUsePseudonyms = aStream.ReadUint32L(); - iVerifyServerRealmPresent = aStream.ReadUint32L(); - iVerifyServerRealm = aStream.ReadUint32L(); - iRequireClientAuthenticationPresent = aStream.ReadUint32L(); - iRequireClientAuthentication = aStream.ReadUint32L(); - iSessionValidityTimePresent = aStream.ReadUint32L(); - iSessionValidityTime = aStream.ReadUint32L(); - iCipherSuitesPresent = aStream.ReadUint32L(); - iCipherSuitesCount = aStream.ReadUint32L(); - for( TInt i = 0; i < iCipherSuitesCount; i++ ) - { - iCipherSuites.Append(aStream.ReadUint32L()); - } - iPEAPVersionsPresent = aStream.ReadUint32L(); - iPEAPv0Allowed = aStream.ReadUint32L(); - iPEAPv1Allowed = aStream.ReadUint32L(); - iPEAPv2Allowed = aStream.ReadUint32L(); - iCertificatesPresent = aStream.ReadUint32L(); - iCertificatesCount = aStream.ReadUint32L(); - for( TInt i = 0; i < iCertificatesCount; i++ ) - { - THssCertificateEntry* entry = new (ELeave) THssCertificateEntry(); - - entry->iCertType = static_cast(aStream.ReadInt32L()); - entry->iSubjectNamePresent = aStream.ReadUint32L(); - aStream >> entry->iSubjectName; - entry->iIssuerNamePresent = aStream.ReadUint32L(); - aStream >> entry->iIssuerName; - entry->iSerialNumberPresent= aStream.ReadUint32L(); - aStream >> entry->iSerialNumber; - entry->iSubjectKeyIDPresent = aStream.ReadUint32L(); - aStream >> entry->iSubjectKeyID; - entry->iThumbprintPresent = aStream.ReadUint32L(); - aStream >> entry->iThumbprint; - iCertificates.Insert(entry, i); - } - iEncapsulatedEAPTypesPresent = aStream.ReadUint32L(); - iEncapsulatedEAPTypesCount = aStream.ReadUint32L(); - for( TInt i = 0; i < iEncapsulatedEAPTypesCount; i++ ) - { - iEncapsulatedEAPTypes.Append(aStream.ReadUint32L()); - } - -} - -inline THssIapSettings::THssIapSettings() -: iConnectionMode(EHssInfrastructure) -, iSecurityMode( EHssAllowUnsecure ) -, iAuthenticationMode(EHssOpen) -, iEapDataArray(1) -{ -} - -// end of file diff -r 498f36116140 -r 001d4d78e350 wlanutilities/wlanentryplugin/inc/cpwlanentryplugin.h --- a/wlanutilities/wlanentryplugin/inc/cpwlanentryplugin.h Mon May 03 13:32:51 2010 +0300 +++ b/wlanutilities/wlanentryplugin/inc/cpwlanentryplugin.h Fri May 14 16:56:58 2010 +0300 @@ -1,34 +1,34 @@ /* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0"" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: - * - */ +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* WLAN Entry plugin implementation. +*/ #ifndef CPWLANENTRYPLUGIN_H #define CPWLANENTRYPLUGIN_H - // System includes #include -#include +#include +#include // User includes // Forward declarations -class QTranslator; +class HbTranslator; // External data types @@ -36,10 +36,10 @@ // Class declaration -class CpWlanEntryPlugin : public QObject, public CpPluginPlatInterface +class CpWlanEntryPlugin : public QObject, public CpPluginInterface { Q_OBJECT - Q_INTERFACES(CpPluginPlatInterface) + Q_INTERFACES(CpPluginInterface) public: @@ -49,7 +49,8 @@ virtual ~CpWlanEntryPlugin(); - virtual CpSettingFormItemData *createSettingFormItemData(CpItemDataHelper &itemDataHelper) const; + virtual QList createSettingFormItemData( + CpItemDataHelper &itemDataHelper) const; signals: @@ -67,11 +68,12 @@ private: // data - bool mWlanSupported; // WLAN dynamic ON/OFF configuration - QTranslator *mTranslator; // Translator for text ID's used in this plugin + //! WLAN dynamic ON/OFF configuration + bool mWlanSupported; + //! Translator for text ID's used in this plugin + QSharedPointer mTranslator; // Friend classes - }; #endif // CPWLANENTRYPLUGIN_H diff -r 498f36116140 -r 001d4d78e350 wlanutilities/wlanentryplugin/src/cpwlanentryplugin.cpp --- a/wlanutilities/wlanentryplugin/src/cpwlanentryplugin.cpp Mon May 03 13:32:51 2010 +0300 +++ b/wlanutilities/wlanentryplugin/src/cpwlanentryplugin.cpp Fri May 14 16:56:58 2010 +0300 @@ -1,25 +1,24 @@ /* - * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0"" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: - * - */ +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* WLAN Entry plugin implementation. +*/ // System includes #include -#include -#include +#include #include "qsysteminfo.h" // User includes @@ -52,9 +51,12 @@ Constructor. */ -CpWlanEntryPlugin::CpWlanEntryPlugin() : QObject() +CpWlanEntryPlugin::CpWlanEntryPlugin() : + QObject(), + mWlanSupported(false), + mTranslator() { - OstTraceFunctionEntry1(CPWLANENTRYPLUGIN_CPWLANENTRYPLUGIN_ENTRY, this); + OstTraceFunctionEntry0(CPWLANENTRYPLUGIN_CPWLANENTRYPLUGIN_ENTRY); // Check & store WLAN dynamic configuration QtMobility::QSystemInfo sysinfo; @@ -62,14 +64,11 @@ if (mWlanSupported) { // Install localization - mTranslator = new QTranslator(this); - QString lang = QLocale::system().name(); - QString path = "Z:/resource/qt/translations/"; - mTranslator->load("wlanentryplugin_" + lang, path); - qApp->installTranslator(mTranslator); + mTranslator = QSharedPointer( + new HbTranslator("wlanentryplugin")); } - OstTraceFunctionExit1(CPWLANENTRYPLUGIN_CPWLANENTRYPLUGIN_EXIT, this); + OstTraceFunctionExit0(CPWLANENTRYPLUGIN_CPWLANENTRYPLUGIN_EXIT); } /*! @@ -78,27 +77,30 @@ CpWlanEntryPlugin::~CpWlanEntryPlugin() { - OstTraceFunctionEntry1(DUP1_CPWLANENTRYPLUGIN_CPWLANENTRYPLUGIN_ENTRY, this); - OstTraceFunctionExit1(DUP1_CPWLANENTRYPLUGIN_CPWLANENTRYPLUGIN_EXIT, this); + OstTraceFunctionEntry0(DUP1_CPWLANENTRYPLUGIN_CPWLANENTRYPLUGIN_ENTRY); + OstTraceFunctionExit0(DUP1_CPWLANENTRYPLUGIN_CPWLANENTRYPLUGIN_EXIT); } /*! Plugin function for creating the entry plugin form item data. + + @param [in,out] itemDataHelper Control Panel item data helper. */ -CpSettingFormItemData *CpWlanEntryPlugin::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const +QList CpWlanEntryPlugin::createSettingFormItemData( + CpItemDataHelper &itemDataHelper) const { - OstTraceFunctionEntry1(CPWLANENTRYPLUGIN_CREATESETTINGFORMITEMDATA_ENTRY, this); + OstTraceFunctionEntry0(CPWLANENTRYPLUGIN_CREATESETTINGFORMITEMDATA_ENTRY); - CpWlanEntryItemData *entryItemData = 0; + QList settingFormData; // The plugin is disabled if WLAN is not supported by the product. if (mWlanSupported) { - entryItemData = new CpWlanEntryItemData(itemDataHelper); + settingFormData.append(new CpWlanEntryItemData(itemDataHelper)); } - OstTraceFunctionExit1(CPWLANENTRYPLUGIN_CREATESETTINGFORMITEMDATA_EXIT, this); - return entryItemData; + OstTraceFunctionExit0(CPWLANENTRYPLUGIN_CREATESETTINGFORMITEMDATA_EXIT); + return settingFormData; } Q_EXPORT_PLUGIN2(cpwlanentryplugin, CpWlanEntryPlugin); diff -r 498f36116140 -r 001d4d78e350 wlanutilities/wlansniffer/inc/wlansnifferlistview.h --- a/wlanutilities/wlansniffer/inc/wlansnifferlistview.h Mon May 03 13:32:51 2010 +0300 +++ b/wlanutilities/wlansniffer/inc/wlansnifferlistview.h Fri May 14 16:56:58 2010 +0300 @@ -44,9 +44,13 @@ void detailsTriggered(int); void completeServiceTriggered(); +public slots: + void handleContextMenuClosed(); + private slots: void handleListItemActivated(HbListWidgetItem *item); void handleListItemLongPressed(HbListWidgetItem *item, const QPointF &coords); + void handleListItemDisconnect(); void handleDisconnect(); private: @@ -59,7 +63,12 @@ HbLabel *mStatusLabel; WlanSniffer *mAppRef; int mConnectingIapId; - bool mIapItemMenuOpen; + /*! + * Data identifying the network for which the context menu has been + * opened: WlanQtUtilsAp class, or int IAP ID + */ + QVariant mContextMenuData; + HbMenu *mContextMenu; //!< Context menu reference, if one is open }; #endif diff -r 498f36116140 -r 001d4d78e350 wlanutilities/wlansniffer/res/wlansnifferlistview.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wlansniffer/res/wlansnifferlistview.docml Fri May 14 16:56:58 2010 +0300 @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+
+ + + +
+ + + + + +
diff -r 498f36116140 -r 001d4d78e350 wlanutilities/wlansniffer/src/wlansnifferlistview.cpp --- a/wlanutilities/wlansniffer/src/wlansnifferlistview.cpp Mon May 03 13:32:51 2010 +0300 +++ b/wlanutilities/wlansniffer/src/wlansnifferlistview.cpp Fri May 14 16:56:58 2010 +0300 @@ -44,7 +44,7 @@ mStatusLabel(NULL), mAppRef(appRef), mConnectingIapId(0), - mIapItemMenuOpen(false) + mContextMenu(NULL) { OstTraceFunctionEntry0( WLANSNIFFERLISTVIEW_WLANSNIFFERLISTVIEW_ENTRY ); @@ -113,7 +113,8 @@ { OstTraceFunctionEntry0( WLANSNIFFERLISTVIEW_UPDATE_ENTRY ); - if (mIapItemMenuOpen == false) { + // Do not update list while the context menu is open + if (mContextMenu == NULL) { QList aps; QList iaps; @@ -158,6 +159,17 @@ OstTraceFunctionExit0( WLANSNIFFERLISTVIEW_UPDATECONNECTIONCLOSED_EXIT ); } +void WlanSnifferListView::handleContextMenuClosed() +{ + OstTraceFunctionEntry0( WLANSNIFFERLISTVIEW_HANDLECONTEXTMENUCLOSED_ENTRY ); + + // Menu deletes itself, but we need to cleanup the member variable + // in order to enable list updating again + mContextMenu = NULL; + + OstTraceFunctionExit0( WLANSNIFFERLISTVIEW_HANDLECONTEXTMENUCLOSED_EXIT ); +} + void WlanSnifferListView::handleListItemActivated(HbListWidgetItem *item) { OstTraceFunctionEntry0( WLANSNIFFERLISTVIEW_HANDLELISTITEMACTIVATED_ENTRY ); @@ -193,46 +205,49 @@ { OstTraceFunctionEntry0( WLANSNIFFERLISTVIEW_HANDLELISTITEMLONGPRESSED_ENTRY ); - // Disable list refreshing while context menu is shown - // Todo: Propably a more elegant way to do this is needed.. - mIapItemMenuOpen = true; - - (void)item; - HbMenu *contextMenu = new HbMenu(); - HbAction *actionDetails = contextMenu->addAction(hbTrId("txt_occ_menu_details")); - HbAction *actionSettings = contextMenu->addAction(hbTrId("txt_occ_menu_network_settings")); - HbAction *actionDisable = contextMenu->addAction(hbTrId("txt_occ_menu_disable_network")); - - // Add disconnect option if the IAP is connected - HbAction *actionDisconnect = 0; - WlanQtUtilsIap *iap = 0; - QVariant data = item->data(); - if (data.canConvert()) { - // Item was an IAP. - iap = mAppRef->wlanQtUtils()->iap(data.toInt()); - if (iap->connectionStatus() == WlanQtUtilsConnectionStatusConnected) { - actionDisconnect = contextMenu->addAction(hbTrId("txt_common_menu_disconnect")); - } + Q_ASSERT(mContextMenu == NULL); + + if (item->data().canConvert() && item->data().toInt() == + mAppRef->wlanQtUtils()->connectedWlanId()) { + // Connected IAP, add "Disconnect" action + mContextMenu = new HbMenu(); + // Remember the item that was long pressed + mContextMenuData = item->data(); + mContextMenu->addAction( + hbTrId("txt_common_menu_disconnect"), + this, + SLOT(handleListItemDisconnect())); + // Show the menu and connect closure signal (to re-enable list refreshing) + bool connectStatus = connect( + mContextMenu, + SIGNAL(aboutToClose()), + this, + SLOT(handleContextMenuClosed())); + Q_ASSERT(connectStatus); + mContextMenu->setAttribute(Qt::WA_DeleteOnClose); + mContextMenu->setTimeout(HbPopup::ContextMenuTimeout); + mContextMenu->setPreferredPos(coords); + mContextMenu->show(); } - - // Show the menu - HbAction *selectedAction = contextMenu->exec(coords); - // Re-enable list refreshing - mIapItemMenuOpen = false; - - if (selectedAction) { - // Handle the "Disconnect" menu selection - if (selectedAction == actionDisconnect) { - mStatusLabel->setPlainText(hbTrId("txt_occ_grid_not_connected")); - mAppRef->wlanQtUtils()->disconnectIap(iap->id()); - // Redraw the list so that disconnected network is not shown anymore - update(); - } - } OstTraceFunctionExit0( WLANSNIFFERLISTVIEW_HANDLELISTITEMLONGPRESSED_EXIT ); } +/*! + Handles a "Disconnect" action selected from the context menu for a list item. + */ +void WlanSnifferListView::handleListItemDisconnect() +{ + OstTraceFunctionEntry0( WLANSNIFFERLISTVIEW_HANDLELISTITEMDISCONNECT_ENTRY ); + + // "Disconnect" was only added, if the item was an IAP and data was + // the IAP ID + Q_ASSERT(mContextMenuData.canConvert()); + mAppRef->wlanQtUtils()->disconnectIap(mContextMenuData.toInt()); + + OstTraceFunctionExit0( WLANSNIFFERLISTVIEW_HANDLELISTITEMDISCONNECT_EXIT ); +} + // Todo: This is a temporary solution - real WLAN status indication & listening // is implemented later on. void WlanSnifferListView::handleDisconnect() diff -r 498f36116140 -r 001d4d78e350 wlanutilities/wpswizard/resources/occ_wps_P1.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wpswizard/resources/occ_wps_P1.docml Fri May 14 16:56:58 2010 +0300 @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 498f36116140 -r 001d4d78e350 wlanutilities/wpswizard/resources/occ_wps_P2.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wpswizard/resources/occ_wps_P2.docml Fri May 14 16:56:58 2010 +0300 @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff -r 498f36116140 -r 001d4d78e350 wlanutilities/wpswizard/resources/occ_wps_P3.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wpswizard/resources/occ_wps_P3.docml Fri May 14 16:56:58 2010 +0300 @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff -r 498f36116140 -r 001d4d78e350 wlanutilities/wpswizard/resources/occ_wps_P4.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wpswizard/resources/occ_wps_P4.docml Fri May 14 16:56:58 2010 +0300 @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 498f36116140 -r 001d4d78e350 wlanutilities/wpswizard/resources/occ_wps_P5.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wpswizard/resources/occ_wps_P5.docml Fri May 14 16:56:58 2010 +0300 @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 498f36116140 -r 001d4d78e350 wlanutilities/wpswizard/resources/occ_wps_P6.docml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/wlanutilities/wpswizard/resources/occ_wps_P6.docml Fri May 14 16:56:58 2010 +0300 @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +