# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1273844606 -10800 # Node ID 098e361762d26e41b97854d74e93a21f5c0334d1 # Parent 8957df7b007285a8f044e6d7443e8f8c25f12a4e Revision: 201017 Kit: 201019 diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/common.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/common.pri Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,66 @@ +# +# 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: controlpanel project - common qmake settings +# + +CONFIG += debug_and_release + +# On win32 and mac, debug and release libraries are named differently. +# We must follow the debug and release settings Qt was compiled with: +# build debug iff Qt built debug, build release iff Qt built release. + +win32|mac { + !contains(QT_CONFIG,debug)|!contains(QT_CONFIG,release) { + CONFIG -= debug_and_release debug release + contains(QT_CONFIG,debug): CONFIG+=debug + contains(QT_CONFIG,release):CONFIG+=release + } +} + +CONFIG(debug, debug|release) { + SUBDIRPART = debug +} else { + SUBDIRPART = release +} + +win32 { + DESTDIR = C:/ControlPanel/$$SUBDIRPART/bin + OBJECTS_DIR = $$PWD/../$$SUBDIRPART/tmp/$$TARGET +} + +# Add the output dirs to the link path too +LIBS += -L$$DESTDIR + +MOC_DIR = moc +OBJECT_DIR = obj +RCC_DIR = rcc + +#For some reason the default include path doesn't include MOC_DIR on symbian +symbian { + INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE + INCLUDEPATH += $$MW_LAYER_PLATFORM_EXPORT_PATH(cplogger) + INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE + INCLUDEPATH += $$MOC_DIR + TARGET.CAPABILITY = ALL -TCB + TARGET.EPOCALLOWDLLDATA = 1 +} + +INCLUDEPATH += $$PWD/inc +win32 { + # add platfrom API for windows + INCLUDEPATH += $$PWD/../../controlpanel/controlpanel_plat/inc +} + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/group/advancedsecplugin.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/group/advancedsecplugin.pri Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,39 @@ +# Copyright (c) 2010 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: advancedsecplugin source files + +# Input +HEADERS += ../inc/cpcertdatacontainer.h \ + ../inc/cpcertdetailview.h \ + ../inc/cpcertmanuisyncwrapper.h \ + ../inc/cpcerttrustview.h \ + ../inc/cpcertview.h \ + ../inc/cpcertpluginloader.h \ + ../inc/cpsecurityview.h \ + ../inc/cpuitrustids.h \ + ../inc/cpsecmodview.h \ + ../inc/cpsecmodmodel.h \ + ../inc/cpsecmodsyncwrapper.h \ + ../inc/cpmoduleview.h \ + ../inc/cpsecmoduleinfoview.h + +SOURCES += ../src/cpcertdatacontainer.cpp \ + ../src/cpcertdetailview.cpp \ + ../src/cpcertmanuisyncwrapper.cpp \ + ../src/cpcerttrustview.cpp \ + ../src/cpcertview.cpp \ + ../src/cpcertpluginloader.cpp \ + ../src/cpsecurityview.cpp \ + ../src/cpsecmodview.cpp \ + ../src/cpsecmodsyncwrapper.cpp \ + ../src/cpsecmodmodel.cpp \ + ../src/cpmoduleview.cpp \ + ../src/cpsecmoduleinfoview.cpp + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/group/advancedsecplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/group/advancedsecplugin.pro Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,108 @@ + +# +# 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: +# + +TEMPLATE = lib +TARGET = cpadvancedsecplugin + +CONFIG += hb plugin + +LIBS += -lcpframework + +include ( advancedsecplugin.pri ) +include ( ../rom/cpsecplugins_rom.pri ) + +symbian: { + TARGET.CAPABILITY = CAP_ECOM_PLUGIN + TARGET.UID3 = 0X2002E684 + INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE + INCLUDEPATH += ../inc + TARGET.EPOCALLOWDLLDATA = 1 + LIBS += -lcertstore + LIBS += -lCTFramework + LIBS += -lX509 + LIBS += -lpkixcert + LIBS += -lx509certnameparser + LIBS += -lhash + LIBS += -lcryptography + LIBS += -lDevTokenClient + LIBS += -lcrypto + + PLUGIN_STUB_PATH = /resource/qt/plugins/controlpanel + + deploy.path = C: + pluginstub.sources = $${TARGET}.dll + pluginstub.path = $$PLUGIN_STUB_PATH + DEPLOYMENT += pluginstub + + qtplugins.path = $$PLUGIN_STUB_PATH + qtplugins.sources += qmakepluginstubs/$${TARGET}.qtplugin + + for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin $$deploy.path$$qtplugins.path/$$basename(qtplugin)" + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_ar.ts /epoc32/include/platform/qt/translations/certificate_management_ar.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_bg.ts /epoc32/include/platform/qt/translations/certificate_management_bg.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_ca.ts /epoc32/include/platform/qt/translations/certificate_management_ca.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_cs.ts /epoc32/include/platform/qt/translations/certificate_management_cs.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_da.ts /epoc32/include/platform/qt/translations/certificate_management_da.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_de.ts /epoc32/include/platform/qt/translations/certificate_management_de.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_el.ts /epoc32/include/platform/qt/translations/certificate_management_el.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_en.ts /epoc32/include/platform/qt/translations/certificate_management_en.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_en_US.ts /epoc32/include/platform/qt/translations/certificate_management_en_US.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_es.ts /epoc32/include/platform/qt/translations/certificate_management_es.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_es_419.ts /epoc32/include/platform/qt/translations/certificate_management_es_419.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_et.ts /epoc32/include/platform/qt/translations/certificate_management_et.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_eu.ts /epoc32/include/platform/qt/translations/certificate_management_eu.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_fi.ts /epoc32/include/platform/qt/translations/certificate_management_fi.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_fr.ts /epoc32/include/platform/qt/translations/certificate_management_fr.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_fr_CA.ts /epoc32/include/platform/qt/translations/certificate_management_fr_CA.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_gl.ts /epoc32/include/platform/qt/translations/certificate_management_gl.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_he.ts /epoc32/include/platform/qt/translations/certificate_management_he.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_hi.ts /epoc32/include/platform/qt/translations/certificate_management_hi.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_hr.ts /epoc32/include/platform/qt/translations/certificate_management_hr.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_hu.ts /epoc32/include/platform/qt/translations/certificate_management_hu.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_id.ts /epoc32/include/platform/qt/translations/certificate_management_id.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_is.ts /epoc32/include/platform/qt/translations/certificate_management_is.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_it.ts /epoc32/include/platform/qt/translations/certificate_management_it.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_ja.ts /epoc32/include/platform/qt/translations/certificate_management_ja.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_ko.ts /epoc32/include/platform/qt/translations/certificate_management_ko.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_lt.ts /epoc32/include/platform/qt/translations/certificate_management_lt.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_lv.ts /epoc32/include/platform/qt/translations/certificate_management_lv.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_ms.ts /epoc32/include/platform/qt/translations/certificate_management_ms.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_nl.ts /epoc32/include/platform/qt/translations/certificate_management_nl.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_no.ts /epoc32/include/platform/qt/translations/certificate_management_no.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_pl.ts /epoc32/include/platform/qt/translations/certificate_management_pl.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_pt.ts /epoc32/include/platform/qt/translations/certificate_management_pt.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_pt_BR.ts /epoc32/include/platform/qt/translations/certificate_management_pt_BR.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_ro.ts /epoc32/include/platform/qt/translations/certificate_management_ro.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_ru.ts /epoc32/include/platform/qt/translations/certificate_management_ru.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_sk.ts /epoc32/include/platform/qt/translations/certificate_management_sk.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_sl.ts /epoc32/include/platform/qt/translations/certificate_management_sl.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_sr.ts /epoc32/include/platform/qt/translations/certificate_management_sr.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_sv.ts /epoc32/include/platform/qt/translations/certificate_management_sv.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_tl.ts /epoc32/include/platform/qt/translations/certificate_management_tl.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_th.ts /epoc32/include/platform/qt/translations/certificate_management_th.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_tr.ts /epoc32/include/platform/qt/translations/certificate_management_tr.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_uk.ts /epoc32/include/platform/qt/translations/certificate_management_uk.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_ur.ts /epoc32/include/platform/qt/translations/certificate_management_ur.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_vi.ts /epoc32/include/platform/qt/translations/certificate_management_vi.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_zh.ts /epoc32/include/platform/qt/translations/certificate_management_zh.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_zh_HK.ts /epoc32/include/platform/qt/translations/certificate_management_zh_HK.ts"  + :BLD_INF_RULES.prj_exports += "../translations/certificate_management_zh_TW.ts /epoc32/include/platform/qt/translations/certificate_management_zh_TW.ts"  + + + } + +TRANSLATIONS= certificate_management.ts \ No newline at end of file diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/inc/cpcertdatacontainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/inc/cpcertdatacontainer.h Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ +/* +* Copyright (c) 2010 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: Declaration of the CCertManUIKeeper class +* +*/ + +#ifndef CPCERTDATACONTAINER_H +#define CPCERTDATACONTAINER_H + +// INCLUDES +#include +#include +#include + +// FORWARD DECLARATIONS +class CpCertManUISyncWrapper; +class CpCertManUICertData; + +// CONSTANTS +const TUid KCMDeviceCertStoreTokenUid = { 0x101FB668 }; +const TUid KCMDeviceKeyStoreTokenUid = { 0x101FB66A }; +const TUid KCMTrustedServerTokenUid = { 0x101FB66F }; +const TUid KCMFileKeyStoreTokenUid = { 0x101F7333 }; +const TUid KCMFileCertStoreTokenUid = { 0x101F501A }; + + +// CLASS DECLARATION + +/** +* CpCertDataContainer retrieves and holds certificates. +* +*/ +class CpCertDataContainer : public CBase + { + public: // functions + + /** + * Default constructor + */ + CpCertDataContainer(); + + /** + * Destructor. + */ + ~CpCertDataContainer(); + + /** + * NewL + */ + static class CpCertDataContainer* NewL(); + + /** + * NewLC + */ + static class CpCertDataContainer* NewLC(); + + CUnifiedCertStore*& CertManager(); + + CUnifiedKeyStore*& KeyManager(); + + /** + * Checks that cacerts.dat file is not corrupt + * and returns CA certificates from it. + */ + void RefreshCAEntriesL(); + + /** + * Checks that cacerts.dat file is not corrupt + * and returns user certificates from it. + */ + void RefreshUserCertEntriesL(); + + /** + * Returns peer certificates. + */ + void RefreshPeerCertEntriesL(); + + /** + * Returns peer certificates. + */ + void RefreshDeviceCertEntriesL(); + + /** + * Shows error note + */ + void ShowErrorNoteL(TInt aError); + + public: //data + + /** + * To store CA certificate entries for Authority and Trust view + * Includes label from x509certnameparser. + */ + RMPointerArray iCALabelEntries; + + /** + * To store CA certificate entries for Authority and Trust view + * Includes label from x509certnameparser. + */ + RMPointerArray iUserLabelEntries; + + /** + * To store Peer certificate entries for Trusted Site view + * Includes label from x509certnameparser. + */ + RMPointerArray iPeerLabelEntries; + + /** + * To store Peer certificate entries for Device certificate view + * Includes label from x509certnameparser. + */ + RMPointerArray iDeviceLabelEntries; + + /** + * Used to wrap asynchronous calls + */ + CpCertManUISyncWrapper* iWrapper; + + /** + * File session handle. + */ + RFs iRfs; + + private: // functions + + void ConstructL(); + + private: //data + + /** + * To list certificates with criteria. + */ + CCertAttributeFilter* iFilter; + + /** + * To list keys with criteria. + */ + + TCTKeyAttributeFilter* iKeyFilter; + + /** + * UnifiedCertStore + */ + CUnifiedCertStore* iStore; + + /** + * UnifiedKeyStore + */ + CUnifiedKeyStore* iKeyStore; + + /** + * To store CA certificate entries. + */ + RMPointerArray iCAEntries; + + /** + * To store User certificate entries. + */ + RMPointerArray iUserEntries; + + /** + * To store Peer certificate entries. + */ + RMPointerArray iPeerEntries; + + /** + * To store Device certificate entries. + */ + RMPointerArray iDeviceEntries; + + /** + * To store Key entries + */ + RMPointerArray iKeyEntries; + + }; + +/** +* Small helper class to put label and certificate in same class. +* +*/ +class CpCertManUICertData : public CBase + { + public: + + CpCertManUICertData(); + + void Release(); + + HBufC* iCAEntryLabel; + HBufC* iUserEntryLabel; + HBufC* iPeerEntryLabel; + HBufC* iDeviceEntryLabel; + CCTCertInfo* iCAEntry; + CCTCertInfo* iUserEntry; + CCTCertInfo* iPeerEntry; + CCTCertInfo* iDeviceEntry; + + private: + ~CpCertManUICertData(); + + }; + + +#endif // CPCERTDATACONTAINER_H diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/inc/cpcertdetailview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/inc/cpcertdetailview.h Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,77 @@ +/* +* Copyright (c) 2010 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: +* +*/ + +#ifndef CPCERTDETAILVIEW_H +#define CPCERTDETAILVIEW_H + +#include +#include +#include +#include + +class CpCertDataContainer; +class CX509Certificate; +class CCertificate; +class HbListWidget; +class HbAbstractViewItem; +class CCTCertInfo; + +class QString; +class QSizeF; + +class CpCertDetailView : public CpBaseSettingView +{ + Q_OBJECT +public: + explicit CpCertDetailView( CpCertView::TCertificateViews currentView, TInt pos, + CpCertDataContainer& certDataContainer, + QGraphicsItem *parent = 0 ); + virtual ~CpCertDetailView(); + +private: + void viewCertificateDetailsL( TInt index, CpCertView::TCertificateViews type ); + void validateCertificateL(TInt index, const CCertificate& certDetails, const CCTCertInfo& certInfo, CpCertView::TCertificateViews type ); + CArrayFixFlat* validateX509CertificateL( const CX509Certificate& certDetails ); + TKeyUsagePKCS15 keyUsageAndLocationL( const CCTCertInfo& certEntry, TUid* keyLocation ); + void setLocationInfo( TBool certificate, TUid locUid, HbListWidget& certDisplayDetails ); + void divideIntoBlocks( const TDesC8& input, TPtr& output ); + + void addToListWidget( HbListWidget& certDisplayDetails, const QString& data ); + void addToListWidget( HbListWidget& certDisplayDetails, + const QString& displayString, const QString& displayDetails ); + + const CCTCertInfo* certInfo( TInt index, CpCertView::TCertificateViews certView ); + void addTrustedSitesL( const CCertificate& certDetails, HbListWidget& certDisplayDetails); + void addLabel( const CCTCertInfo& certInfo, HbListWidget& certDisplayDetails); + void addIssuerL( const CCertificate& certDetails, HbListWidget& certDisplayDetails ); + void addSubjectL( const CCertificate& certDetails, HbListWidget& certDisplayDetails ); + void addCertUsage( TKeyUsagePKCS15 usage, HbListWidget& certDisplayDetails ); + void addValidityPeriod( const CCertificate& certDetails, HbListWidget& certDisplayDetails); + void setURLLocation( HBufC8& urlDetails, HbListWidget& certDisplayDetails ); + void addCertFormat( TCertificateFormat certFormat, HbListWidget& certDisplayDetails ); + void addAlgoDetails( const CCertificate& certificate, HbListWidget& certDisplayDetails ); + void addSerialNo( const CCertificate& certificate, HbListWidget& certDisplayDetails ); + void addFingerprint( const CCertificate& certificate, HbListWidget& certDisplayDetails ); + void addPublicKeyDetailsL( const CCertificate& certificate, HbListWidget& certDisplayDetails ); + QString asymmetricAlgoId( const CCertificate& certificate ); + +private: + CpCertDataContainer& mCertDataContainer; + +}; + +#endif // CPCERTDETAILVIEW_H diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/inc/cpcertmanuisyncwrapper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/inc/cpcertmanuisyncwrapper.h Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,319 @@ +/* +* Copyright (c) 2010 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: Wrapper class for Symbian's Security Framework's calls +* +*/ + + +#ifndef CPCERTMANUISYNCWRAPPER_H +#define CPCERTMANUISYNCWRAPPER_H + + +// INCLUDES +#include + +// FORWARD DECLERATIONS +class CCertificate; +class CPKIXValidationResult; +class CPKIXCertChain; +class CUnifiedCertStore; + +// CLASS DECLARATION + +/** +* Wrapper class for Symbian's Security Framework's calls. +* Shows error notes if an error happenes. +* +* @lib certmanui.dll +* @since S60 2.0 +*/ +class CpCertManUISyncWrapper : public CActive + { + public: + + /** + * Two-phased constructor. + */ + static CpCertManUISyncWrapper* NewLC(); + + /** + * Two-phased constructor. + */ + static CpCertManUISyncWrapper* NewL(); + + /** + * Destructor. + */ + ~CpCertManUISyncWrapper(); + + public: // New functions + + /** + * TInt ListL + * @param aStore reference to store where operation is done. + * @param aArray Keys are stored here. + * @param aFilter Information on what kind keys are looked. + */ + + void ListL( CUnifiedKeyStore*& aStore, + RMPointerArray* aArray, + const TCTKeyAttributeFilter& aFilter ); + + /** + * TInt ListL + * @param aStore reference to store where operation is done. + * @param aArray Keys are stored here. + * @param aFilter Information on what kind keys are looked. + * @param aTokenUid Token UID of key store + */ + + void ListL( CUnifiedKeyStore*& aStore, + RMPointerArray* aArray, + const TCTKeyAttributeFilter& aFilter, + const TUid aTokenUid ); + + /** + * TInt ListL + * @param aStore reference to store where operation is done. + * @param aArray certificates are stored here. + * @param aFilter Information on what kind certificates are looked. + */ + void ListL( CUnifiedCertStore*& aStore, + RMPointerArray* aArray, + const CCertAttributeFilter& aFilter ); + + /** + * TInt ListL + * @param aStore reference to store where operation is done. + * @param aArray certificates are stored here. + * @param aFilter Information on what kind certificates are looked. + * @param aTokenUid Token UID of certificate store + */ + void ListL( CUnifiedCertStore*& aStore, + RMPointerArray* aArray, + const CCertAttributeFilter& aFilter, + const TUid aTokenUid ); + + + /** + * TInt GetCertificateL + * @param aStore reference to store where operation is done. + * @param aCertInfo Certificate that's detailed information is fetched. + * @param aCert Fetched certificate. + */ + void GetCertificateL( CUnifiedCertStore*& aStore, + const CCTCertInfo& aCertInfo, CCertificate*& aCert ); + + /** + * TInt GetCertificateL + * @param aStore reference to store where operation is done. + * @param aCertInfo Certificate that's detailed information is fetched. + * @param aCert Fetched certificate. + */ + void GetCertificateL( CUnifiedCertStore*& aStore, + const CCTCertInfo& aCertInfo, CCertificate*& aCert, TUid aTokenUid ); + + + /** + * TInt GetUrlCertificateL + * @param aStore reference to store where operation is done. + * @param aCertInfo Certificate that's detailed information is fetched. + * @param aUrl Fetched URL. + */ + void GetUrlCertificateL( + CUnifiedCertStore*& aStore, + const CCTCertInfo& aCertInfo, + TDes8& aUrl) ; + + /** + * TInt GetApplicationsL + * @param aStore reference to store where operation is done. + * @param aCertInfo Certificate that applications are fetched. + * @param Certificates applications are stoted here. + */ + void GetApplicationsL( CUnifiedCertStore*& aStore, + const CCTCertInfo& aCertInfo, RArray& aApps ); + + /** + * TInt ValidateX509RootCertificateL + * @param aValidationResult Result of validation. + * @param aValidationTime Time of validation. + * @param aChain Chain to be validated. + */ + void ValidateX509RootCertificateL( + CPKIXValidationResult*& aValidationResult, + const TTime& aValidationTime, CPKIXCertChain*& aChain ); + + /** + * TInt InitStoreL + * @param aStore reference to store to be initialized. + */ + void InitStoreL( CUnifiedCertStore*& aStore ); + + /** + * void InitStoreL + * @param aStore reference to store to be initialized. + */ + void InitStoreL( CUnifiedKeyStore*& aStore ); + + /** + * TInt DeleteCertL + * @param aStore reference to store where operation is done. + * @param aCertInfo Certificate to be deleted. + */ + void DeleteCertL( CUnifiedCertStore*& aStore, + const CCTCertInfo& aCertInfo ); + + /** + * TInt DeleteCertL + * @param aStore reference to store where operation is done. + * @param aCertInfo Certificate to be deleted. + */ + void DeleteCertL( CUnifiedCertStore*& aStore, + const CCTCertInfo& aCertInfo, + TUid aTokenUid ); + + /** + * TInt IsApplicableL + * @since S60 2.0 + * @param aStore reference to store where operation is done. + * @param aCertInfo Certificate thats applicability is queried. + * @param aApplication Application that's status is queried. + * @param aIsApplicable ETrue if applcable. + * @return TInt Status Symbian's API's call. + */ + TInt IsApplicableL( CUnifiedCertStore*& aStore, + const CCTCertInfo& aCertInfo, TUid aApplication, + TBool& aIsApplicable ); + + /** + * TInt IsTrustedL + * @since S60 2.0 + * @param aStore reference to store where operation is done. + * @param aCertInfo Certificate that's trust status is queried. + * @param aTrusted ETrue if trusted. + * @return TInt Status Symbian's API's call. + */ + TInt IsTrustedL( CUnifiedCertStore*& aStore, + const CCTCertInfo& aCertInfo, TBool& aTrusted ); + + /** + * TInt SetApplicabilityL + * @param aStore reference to store where operation is done. + * @param aCertInfo Certificate thats applicability is set. + * @param aApplications New applicability settings. + */ + void SetApplicabilityL( CUnifiedCertStore*& aStore, + const CCTCertInfo& aCertInfo, + RArray& aApplications ); + + /** + * void MoveCertL + * @since S60 3.2 + * @param aStore reference to store where operation is done + * @param aCertInfo Certificate info + * @param aSourceStore UID of source certificate store + * @param aTargetStore UID of source certificate store + * @return TInt Number of moved certificates + */ + TInt MoveCertL( CUnifiedCertStore*& aStore, + const CCTCertInfo& aCertInfo, + const TUid aSourceTokenId, + const TUid aTargetTokenId ); + + /** + * void MoveKeyL + * @param aStore reference to store where operation is done + * @param CCTKeyInfo Key info + * @param aSourceStore UID of source key store + * @param aTargetStore UID of source key store + */ + void MoveKeyL( CUnifiedKeyStore*& aStore, + const TCTKeyAttributeFilter& aFilter, + const TUid aSourceTokenId, + const TUid aTargetTokenId ); + + /** + * TInt GetInterface + * @since S60 3.0 + * @param aToken reference to token + * @param aTokenInterface Pointer to returned interface + * @return TInt Status Symbian's API's call. + */ + TInt GetInterface( TUid aRequiredInterface, + MCTToken& aToken, + MCTTokenInterface*& aReturnedInterface ); + + protected: + + void DoCancel(); + void RunL(); + + private: + + CpCertManUISyncWrapper(); + void ConstructL(); + + void HandleErrorL(); + + private: //Data + + // Internal operation states. + enum TOperation + { + EOperationNone, + EOperationInit, + EOperationList, + EGetCertificate, + EAddCertificate, + ERetriveURLCertificate, + EOperationDelete, + EOperationGetApps, + EOperationIsApplicable, + EOperationIsTrusted, + EOperationSetApplicability, + EOperationSetToTrusted, + EOperationValidateX509Root, + EShowErrorNote, + EOperationInitKeyStore, + EOperationKeyList, + EOperationGetInterface, + EOperationExportKey, + EOperationImportKey, + EOperationDeleteKey + }; + + // For wrapping asynchronous calls. + CActiveSchedulerWait iWait; + + // Internal state of operation. + TOperation iOperation; + + // Just for cancelling a operation. Does not own. + CUnifiedCertStore* iStore; + + // Just for cancelling a operation. Does not own. + CUnifiedKeyStore* iKeyStore; + + // Just for cancelling a operation. Does not own. + CPKIXCertChain* iChain; + + // For retrieving a certificate. + TPtr8 iCertPtr; + + }; + +#endif // CPCERTMANUISYNCWRAPPER_H + +// End of File diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/inc/cpcertpluginloader.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/inc/cpcertpluginloader.h Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2010 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: + * + */ +#ifndef CPCERTPLUGINLOADER_H +#define CPCERTPLUGINLOADER_H + +#include +#include +#include +class CpCertPluginLoader : public QObject, public CpPluginPlatInterface +{ + Q_OBJECT + Q_INTERFACES(CpPluginPlatInterface) +public: + CpCertPluginLoader(); + virtual ~CpCertPluginLoader(); + virtual CpSettingFormItemData *createSettingFormItemData(CpItemDataHelper &itemDataHelper) const; +private: + QTranslator* mTranslator; +}; + +#endif //CPCERTPLUGINLOADER_H diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/inc/cpcerttrustview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/inc/cpcerttrustview.h Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,100 @@ +/* +* Copyright (c) 2010 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: Declaration of the CCertManUIContainerTrust class +* Maintains correct list of trusted clients depending +* on the certificate that was in focus in Authority +* certificates view when Trust Settings view was entered. +* Shows and changes correct Yes/No text for the Trusted client. +* +*/ + + +#ifndef CPCERTTRUSTVIEW_H +#define CPCERTTRUSTVIEW_H + +// INCLUDES +#include +#include + +// CONSTANTS +const TInt KTrustSettingsResourceIndexWAP = 0; +const TInt KTrustSettingsResourceIndexMailAndImageConn = 1; +const TInt KTrustSettingsResourceIndexAppCtrl = 2; +const TInt KTrustSettingsResourceIndexJavaInstall = 3; +const TInt KTrustSettingsResourceIndexOCSPCheck = 4; +const TInt KTrustSettingsResourceIndexVPN = 5; +const TInt KTrustSettingsResourceIndexWidget = 6; +const TInt KTrustSettingsResourceIndexValueYes = 0; +const TInt KTrustSettingsResourceIndexValueNo = 1; + +// FORWARD DECLARATIONS +class CCertificateAppInfoManager; +class CpCertDataContainer; +class TCertificateAppInfo; +class CCTCertInfo; + +class QString; + +class HbDataFormModel; + +// CLASS DECLARATION +class CpCertTrustView : public CpBaseSettingView + { + Q_OBJECT + + public: + explicit CpCertTrustView( TInt certificateIndex, + CpCertDataContainer& certDataContainer, + QGraphicsItem *parent = 0 ); + virtual ~CpCertTrustView(); + void saveTrustSettings(); + + private: + void viewTrustSettings(); + void updateListBoxL(); + TInt trustIdIndex( TUid aTrusterUid ) const; + TBool checkCertificateClientTrustL( const TUid clientUid, const CCTCertInfo& entry ) const; + TUid trusterId(const QString& clientDescription) const; + + private: + CpCertDataContainer& mCertDataContainer; + /** + * Application manager class, used to get applications in system. + */ + CCertificateAppInfoManager* mAppInfoManager; + + /** + * Client Uids of the certstore + */ + RArray mClientUids; + + /** + * To get the names of the trusted clients from the resources + */ + QList mTrustedClients; + + /** + * To get the yes/no trust texts from the resources + */ + QList mTrustValues; + + TInt mCertificateIndex; + + HbDataFormModel* mFormModel; + + }; + +#endif // CPCERTTRUSTVIEW_H + +// End of File diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/inc/cpcertview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/inc/cpcertview.h Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,85 @@ +/* +* Copyright (c) 2010 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: +* +*/ + +#ifndef CPCERTVIEW_H +#define CPCERTVIEW_H + +#include + +class HbAbstractViewItem; +class CpCertDataContainer; +class CCTCertInfo; +class HbListView; + +class CpCertView : public CpBaseSettingView + { + Q_OBJECT + + public: + explicit CpCertView(const QModelIndex& index, QGraphicsItem *parent = 0); + virtual ~CpCertView(); + + public: + enum TCertificateViews + { + EAuthorityView=0, + ETrustedView, + EPersonalView, + EDeviceView + }; + + public slots: + void displayPreviousView(); + + private slots: + void openCertificate(); + void openCertFromList(const QModelIndex& modelIndex); + void showTrustSettings(); + void saveTrustSettings(); + void indicateLongPress(HbAbstractViewItem*, QPointF); + + void deleteCertificate(); + TInt refreshListL(); + void refreshView( TInt aCount ); + + void moveSelectedCert(); + void deleteList(); + void selectAll(); + void moveCert(); + void viewDone(); + + private: + const CCTCertInfo* certAt(TInt index) const; + QString certLabel(TInt index) const; + void deleteCerts( RArray& indexList ); + void setDetails(CpCertView::TCertificateViews currentView); + void moveCertList( RArray& indexList ); + + private: + CpCertView::TCertificateViews mCertView; + TInt mPos; + CpCertDataContainer* mCertDataContainer; + TBool mSelectAll; + + HbView* mPrevView; + HbView* mCurrentView; + CpBaseSettingView* mRefreshedView; + HbListView* mListView; + HbView* mOriginalView; + }; + +#endif /* CPCERTVIEW_H */ diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/inc/cpmoduleview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/inc/cpmoduleview.h Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2010 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: +* +*/ + +#ifndef CPMODULEVIEW_H +#define CPMODULEVIEW_H + +#include +#include "cpsecmodview.h" + +class HbAbstractViewItem; +class CpItemDataHelper; +class CSecModUIModel; +class CpSecModView; + +class CpModuleView : public CpBaseSettingView +{ + Q_OBJECT +public: + explicit CpModuleView( CpSecModView::TSecModViews currentView, + CSecModUIModel& secModUIModel, + QGraphicsItem *parent = 0 ); + virtual ~CpModuleView(); + +private slots: + void handleAccessView( const QModelIndex& modelIndex ); + void handleAccessView(); + void handleSigView(); + void handleSigViewCommand(); + void indicateLongPress(HbAbstractViewItem *item,QPointF coords); + +private: + void showAccessView(); + void showSignatureView(TBool showBlockedNote); + +private: + enum TSecModAccessCodeCommandIds + { + EIndexCodeLabel = 0, + EIndexCodeRequest, + EIndexCodeStatus + }; + + enum TSecModSignatureCommandIds + { + ESecModUICmdOpen = 0, + ESecModUICmdModuleInfo, + ESecModUICmdDelKeyStore, + ESecModUICmdChange, + ESecModUICmdUnblock, + ESecModUICmdClose, + ESecModUICmdAppTest + }; + +private: + CpSecModView::TSecModViews mCurrentView; + CSecModUIModel& mSecModUIModel; + TInt mPos; +}; + +#endif /* CPMODULEVIEW_H */ diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/inc/cpsecmodmodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/inc/cpsecmodmodel.h Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,341 @@ +/* +* Copyright (c) 2002-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: Declaration of the CSecModUIModel class +* +*/ + + +#ifndef CSECMODUIMODEL_H +#define CSECMODUIMODEL_H + +// INCLUDES +#include +#include +#include +#include + +#include +#include +#include +#include + +class QString; +class HbListWidget; + +// CONSTANTS +const TInt KMaxSettItemSize = 200; + +const TInt KPinGSettIndex = 0; +const TInt KPinNrSettIndex = 1; + +const TUid KUidSecMod = { 0x101F8668 }; + +// Panic strings +_LIT(KPanicNullPointer, "SecModUI: invalid pointer"); +_LIT(KPanicIndexOutOfRange, "SecModUI: array indexed out of range"); + +// FORWARD DECLARATIONS +class CUnifiedKeyStore; +class MCTAuthenticationObject; +class MCTAuthenticationObjectList; +class CSecModUISyncWrapper; +class MCTKeyStore; +class MCTToken; + +class QString; + +// FUNCTION PROTOTYPES +GLREF_C void Panic( TInt aPanic ); + +// CLASS DECLARATION + +/** +* class CSecModUIModel +* Model of the application +* +* @lib SecModUI.lib +* @since Series 60 3.0 +*/ +class CSecModUIModel : public CBase + { + public: // Constructors and destructLoadTokenLabelsLor + + /** + * Two-phased constructor. + */ + static CSecModUIModel* NewL(); + + /** + * Destructor. + */ + virtual ~CSecModUIModel(); + + public: // New functions + /** + * Initializes unified keystore + */ + void InitializeKeyStoreL(); + + /** + * Retrieves the description and location of all tokens. + * @return Map containing the label and the appripriate location. + */ + QMap LoadTokenLabelsL(); + + /** + * Shows error note if needed. + * @param aError + * @return void + */ + void ShowErrorNote(TInt aError) const; + + /** + * Retrieves the appropriate token based on the index. + * @param aTokenIndex Index of the token to be opened. + * @return void + */ + void OpenTokenL(TInt aTokenIndex); + + /** + * Initialize the auth objects and return the total count. + * @param aItemArray contains localised stings + * @return void + */ + TInt CheckCodeViewStringsL(); + + /** + * Retrieves description of the token based on UID of the current active keystore. + * @return Description + */ + QString TokenLabelForTitle() const; + + /** + * Returns status of the selected auth object. + * @param index + * @return status + */ + TUint32 AuthStatus(TInt aIndex) const; + + /** + * Returns status of the auth object based on its persistent properties set + * by security module implementation. + * @param aIndex Index of the authentication object + * @param aShowBlockedNote If ETrue, shows code blocked if code is blocked. + * @return status of the pin. + */ + QString PINStatus( TInt aIndex, TBool aShowBlockedNote ) const; + + /** + * Checks whether the Pin is still available. + * @param aIndex Index of the authentication object. + * @return status + */ + TBool PinOpen(TInt aIndex) const; + + /** + * Based on the property of auth object the pin can be + * changed or unblocked. + * @param aIndex Index of the auth object + * @return ?description + */ + void ChangeOrUnblockPinL(TInt aIndex); + + /** + * Changes the value of the PIN. + * @param aIndex Index of the AO + * @return void + */ + void ChangePinL(TInt aIndex); + + /** + * Toggles the value of auth object if possible. + * @param ?arg1 ?description + * @return ?description + */ + TInt ChangeCodeRequest(TInt aIndex); + + /** + * If the auth object is open then closes it. + * @param aIndex Index of the AO to be closed. + * @return void + */ + void CloseAuthObjL(TInt aIndex); + + /** + * Unblocks PIN + * @param aIndex Index of the AO + * @return void + */ + void UnblockPinL(TInt aIndex); + + /** + * Deletes key from the appropriate keystore. + * @param aTokenIndex Index of the token to be deleted. + * @return ETrue if keystore was deleted. + */ + void DeleteKeysL(TInt aTokenIndex); + + /** + * Returns ETrue if PIN is changeable. + * @param aIndex Index of the AO + * @return ETrue / EFalse + */ + TBool PinChangeable(TInt aIndex) const; + + /** + * Displays security module details dialog. + * @param aTokenIndex Index of the token, which details are shown. + * @return void + */ + QVector< QPair > SecModDetailsL(TInt aTokenIndex); + + /** + * Displays details dialog of the active security module . + * @return void + */ + QVector< QPair > GetSecModDetailsL(); + + /** + * Appends the location of the keystore. + * @return void + */ + void AppendLocation( QVector< QPair >& aSecModDetails, + TUid aLocUid, + QString aCertDisplayDetails ); + + /** + * Appends the value of a label if present otherwise appends empty descriotion. + * @return void + */ + void AppendItem( QVector< QPair >& aSecModDetails, + QString aLabel, + const TDesC& aValue, + QString aNullDescription ); + + /** + * Generate details of signing security module. + * @return void + */ + void AppendPinNRs(QVector< QPair >& aSecModDetails); + + QVector< QPair > AuthDetails(); + + /** + * Changes PIN-NR + * @param aIndex Index of the AO + * @return void + */ + void ChangePinNrL(TInt aIndex); + + /** + * Unblocks PIN-NR + * @param aIndex Index of the AO + * @return void + */ + void UnblockPinNrL(TInt aIndex); + + /** + * Retrieves the UID of the current active keystore. + * @return uid + */ + TInt KeyStoreUID(); + + /** + * Retrieves the auth object at the speficied index. + * @return auth object + */ + const MCTAuthenticationObject& AuthObj(TInt aIndex); + + /** + * Returns ETrue if PIN is unblockable. + * @param aIndex Index of the AO + * @return ETrue / EFalse + */ + TBool PinUnblockable(TInt aIndex) const; + + + /** + * Returns ETrue if PIN request can be disabled / enabled. + * @param aIndex Index of the AO + * @return ETrue / EFalse + */ + TBool PinRequestChangeable(TInt aIndex) const; + + /** + * Returns ETrue if token is deletable. + * @param aTokenIndex Index of the token to be deleted. + * @return ETrue / EFalse + */ + TBool IsTokenDeletable(TInt aTokenIndex); + + + private: + + /** + * C++ default constructor. + */ + CSecModUIModel(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + void ResetAndDestroyCTObjects(); + + void ResetAndDestroyAOs(); + + void InitAuthObjectsL(); + + void ListAuthObjectsL(); + + void CreateSettingItem(const TDesC& aTitle, + const TDesC& aValue, + TDes& aItem) const; + + QString Location( TUid aUid ) const; + + void AppendPinNRsL( TDes& aMessage ) const; + + private: + // DATA TYPES + enum TSecModPanicCode + { + EPanicNullPointer, + EPanicIndexOutOfRange + }; + + private: // Data + // Resource file offsets + TInt iResourceFileOffset; + TInt iResourceFileOffset2; + TInt iResourceFileOffset3; + + CSecModUISyncWrapper* iWrapper; // owned + RFs iRfs; + + /** + * Crypto Token objects + */ + CUnifiedKeyStore* iUnifiedKeyStore; // owned + MCTKeyStore* iKeyStore; // not owned + MCTAuthenticationObjectList* iAOList; // owned, items not owned + RMPointerArray iAOArray; // items not owned + + RMPointerArray iAOKeyStores; // items not owned + }; + +#endif // CSECMODUIMODEL_H + +// End of File diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/inc/cpsecmodsyncwrapper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/inc/cpsecmodsyncwrapper.h Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,125 @@ +/* +* Copyright (c) 2005-2010 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: Wrapper class for Symbian's Security Framework's calls. +* +*/ + +#ifndef CPSECMODUISYNCWRAPPER_H +#define CPSECMODUISYNCWRAPPER_H + +#include +#include +#include +#include +#include + +class MCTToken; +class MCTAuthenticationObject; +class MCTAuthenticationObjectList; +class CUnifiedKeyStore; +class MCTTokenInterface; +class TCTTokenObjectHandle; + + + +/** +* class CSecModUISyncWrapper +* Wrapper class for Symbian's Security Framework's calls. +* +* @lib wimmanui.dll +* @since Series 60 2.0 +*/ +class CSecModUISyncWrapper : public CActive + { + public: // Constructors and destructor + + static CSecModUISyncWrapper* NewLC(); + static CSecModUISyncWrapper* NewL(); + virtual ~CSecModUISyncWrapper(); + + public: // New functions + + TInt Initialize(CUnifiedKeyStore& aKeyStore ); + + TInt OpenWIM(); + + TInt GetAuthObjectInterface( + MCTToken& aToken, + MCTTokenInterface*& aTokenInterface); + + TInt ListAuthObjects( + MCTAuthenticationObjectList& aAuthObjList, + RMPointerArray& aAuthObjects ); + + TInt ListKeys( + MCTKeyStore& aKeyStore, + RMPointerArray& aKeysInfos, + const TCTKeyAttributeFilter& aFilter); + + TInt DeleteKey( + CUnifiedKeyStore& aKeyStore, + TCTTokenObjectHandle aHandle); + + TInt ChangeReferenceData( MCTAuthenticationObject& aAuthObject ); + + TInt UnblockAuthObject( MCTAuthenticationObject& aAuthObject ); + + TInt EnableAuthObject( MCTAuthenticationObject& aAuthObject ); + + TInt DisableAuthObject( MCTAuthenticationObject& aAuthObject ); + + TInt CloseAuthObject( MCTAuthenticationObject& aAuthObject ); + + TInt TimeRemaining( MCTAuthenticationObject& aAuthObject, TInt& aStime ); + + protected: // From CActive + + void DoCancel(); + void RunL(); + + private: // New functions + + CSecModUISyncWrapper(); + + private: // Data + + // Internal operation states. + enum TOperation + { + EOperationInit, + EOperationGetAOInterface, + EOperationListAOs, + EOperationListKeys, + EOperationDelKey, + EOperationChangeReferenceData, + EOperationUnblockAO, + EOperationEnableAO, + EOperationDisableAO, + EOperationCloseAO, + EOperationTimeRemAO, + EOperationNone + }; + + // For wrapping asynchronous calls. + CActiveSchedulerWait iWait; + + // Internal state of operation. + TOperation iOperation; + + // CT objects + TAny* iObject; + }; + + +#endif // CPSECMODUISYNCWRAPPER_H diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/inc/cpsecmoduleinfoview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/inc/cpsecmoduleinfoview.h Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,40 @@ +/* +* Copyright (c) 2010 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: +* +*/ + +#ifndef CPSECMODULEINFOIEW_H +#define CPSECMODULEINFOIEW_H + +#include + + + +class CpSecmoduleInfoView : public CpBaseSettingView +{ + Q_OBJECT +public: + explicit CpSecmoduleInfoView(const QVector< QPair >& securityDetails,QGraphicsItem *parent = 0); + virtual ~CpSecmoduleInfoView(); + +public slots: + + +private: + + +}; + +#endif // CPSECMODULEINFOIEW_H diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/inc/cpsecmodview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/inc/cpsecmodview.h Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 2010 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: +* +*/ + +#ifndef CPSECMODVIEW_H +#define CPSECMODVIEW_H + +#include + +class HbAbstractViewItem; +class CpItemDataHelper; +class CSecModUIModel; + +class CpSecModView : public CpBaseSettingView +{ + Q_OBJECT +public: + explicit CpSecModView(TInt aCurrentPos, CSecModUIModel& aSecModUIModel, QGraphicsItem *parent = 0); + virtual ~CpSecModView(); + +private slots: + void displayPrevious(); + void showNextView( const QModelIndex& modelIndex ); + +public: + enum TSecModViews + { + EAccessView=0, + ESignatureView + }; + + +private: + CSecModUIModel& mSecModUIModel; + TInt mPos; + TSecModViews mCurrentView; + HbView* mAccessView; + HbView* mPrevView; + +}; + +#endif /* CPPLACEHOLDERENTRYITEMDATA_H */ diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/inc/cpsecurityview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/inc/cpsecurityview.h Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2010 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: +* +*/ + +#ifndef CPSECURITYVIEW_H +#define CPSECURITYVIEW_H + +#include + +class HbAbstractViewItem; +class CpItemDataHelper; +class CpSecModView; +class CpCertView; +class CSecModUIModel; +class QModelIndex; +class CpSecmoduleInfoView; +class CpSecurityView : public CpBaseSettingView +{ + Q_OBJECT +public: + explicit CpSecurityView(QGraphicsItem *parent = 0); + virtual ~CpSecurityView(); + +public slots: + void viewDone(); + void showWIMview(); + void displayCert(const QModelIndex& modelIndex); + void displayPrevious(); + void showCodeView(); + void showCodeView( const QModelIndex& modelIndex); + void indicateLongPress(HbAbstractViewItem *item,QPointF coords); + void deleteModule(); + void moduleDetails(); + void displayPreviousFromModInfo(); + +private: + CSecModUIModel* mSecModUIModel; + CpSecModView* mSecModView; + HbView* mPreView; + CpCertView* mCertView; + CpSecmoduleInfoView* mModuleinfoView; + HbView* mCurrentView; + TInt mPos; + +}; + +#endif // CPSECURITYVIEW_H diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/inc/cpuitrustids.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/inc/cpuitrustids.h Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2010 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: Contains the TUids of supported clients for certificate's Trust Setting View +* +*/ + + +#ifndef CPUITRUSTIDS_H +#define CPUITRUSTIDS_H + +// CONSTANTS +const TUid KCertManUINullId = {0}; +const TUid KCertManUIViewTrustWapConnectionId = {268479059}; +const TUid KCertManUIViewTrustApplicationControllerId = {268452523}; +const TUid KCertManUIViewTrustMailAndImageConnId = {268441661}; +const TUid KCertManUIViewTrustJavaInstallingId = {270506792}; +const TUid KCertManUIViewOCSPCheckInstallingId = {268478646}; +const TUid KCertManUIViewTrustVPNId = {270498195}; +const TUid KCertManUIViewTrustWidgetInstallId = {537028562}; + +#endif // CPUITRUSTIDS_H + +// End of File diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/rom/advancedsecurity_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/rom/advancedsecurity_resources.iby Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,21 @@ +/* +* Copyright (c) 2010 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: Translation string details +* +*/ + + +#include + +data=DATAZ_\QT_TRANSLATIONS_DIR\certificate_management.qm QT_TRANSLATIONS_DIR\certificate_management.qm \ No newline at end of file diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/rom/cpsecplugins.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/rom/cpsecplugins.iby Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 2010 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: +* +*/ + +#ifndef CPSECPLUGINS_IBY +#define CPSECPLUGINS_IBY + +file=ABI_DIR\BUILD_DIR\cpadvancedsecplugin.dll SHARED_LIB_DIR\cpadvancedsecplugin.dll + +data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpadvancedsecplugin.qtplugin resource\qt\plugins\controlpanel\cpadvancedsecplugin.qtplugin + +#endif diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/rom/cpsecplugins_rom.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/rom/cpsecplugins_rom.pri Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,21 @@ +# +# Copyright (c) 2010 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: +# + + +symbian { +BLD_INF_RULES.prj_exports += "../rom/cpsecplugins.iby CORE_APP_LAYER_IBY_EXPORT_PATH(cpsecplugins.iby)" +BLD_INF_RULES.prj_exports += "../rom/advancedsecurity_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(advancedsecurity_resources.iby )" +} \ No newline at end of file diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/src/cpcertdatacontainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/src/cpcertdatacontainer.cpp Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,751 @@ +/* +* Copyright (c) 2010 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: Implementation of class CCertManUIKeeper +* Creates and destroys all the views CertManUI uses. +* Handles changing CertManUI views. +* +*/ + + +// INCLUDE FILES +#include +#include +#include +#include + +#include + +#include + +#include "cpcertdatacontainer.h" +#include "cpcertmanuisyncwrapper.h" + +// CONSTANTS +_LIT( KNameSeparator, " " ); + +// ============================= LOCAL FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// TInt CompareCALabels( const CCTCertInfo& cert1, const CCTCertInfo& cert2 ) +// Compares two labels. +// ----------------------------------------------------------------------------- +// +TInt CompareCALabels( + const CpCertManUICertData& cert1, + const CpCertManUICertData& cert2 ) + { + return ( (cert1.iCAEntryLabel->Des()). + CompareF( cert2.iCAEntryLabel->Des() ) ); + } + +// ----------------------------------------------------------------------------- +// TInt CompareUserLabels( const CCTCertInfo& cert1, const CCTCertInfo& cert2 ) +// Compares two labels. +// ----------------------------------------------------------------------------- +// +TInt CompareUserLabels( + const CpCertManUICertData& cert1, + const CpCertManUICertData& cert2 ) + { + return ( (cert1.iUserEntryLabel->Des()). + CompareF( cert2.iUserEntryLabel->Des() ) ); + } + +// ----------------------------------------------------------------------------- +// TInt ComparePeerLabels( const CCTCertInfo& cert1, const CCTCertInfo& cert2 ) +// Compares two labels. +// ----------------------------------------------------------------------------- +// +TInt ComparePeerLabels( + const CpCertManUICertData& cert1, + const CpCertManUICertData& cert2 ) + { + return ( (cert1.iPeerEntryLabel->Des()). + CompareF( cert2.iPeerEntryLabel->Des() ) ); + } + +// ----------------------------------------------------------------------------- +// TInt CompareDeviceLabels( const CCTCertInfo& cert1, const CCTCertInfo& cert2 ) +// Compares two labels. +// ----------------------------------------------------------------------------- +// +TInt CompareDeviceLabels( + const CpCertManUICertData& cert1, + const CpCertManUICertData& cert2 ) + { + return ( (cert1.iDeviceEntryLabel->Des()). + CompareF( cert2.iDeviceEntryLabel->Des() ) ); + } + + +// ================= HELPER CLASS =========================== + +// Constructor. +CpCertManUICertData::CpCertManUICertData() + { + } + +// Destructor. +CpCertManUICertData::~CpCertManUICertData() + { + delete iCAEntryLabel; + delete iUserEntryLabel; + delete iPeerEntryLabel; + delete iDeviceEntryLabel; + } + +// Releases Certificate entries. +void CpCertManUICertData::Release() + { + if ( iCAEntry ) + { + iCAEntry->Release(); + } + + if ( iUserEntry ) + { + iUserEntry->Release(); + } + + if ( iPeerEntry ) + { + iPeerEntry->Release(); + } + + if ( iDeviceEntry ) + { + iDeviceEntry->Release(); + } + + delete this; + } + +// ================= MEMBER FUNCTIONS ======================= + +// --------------------------------------------------------- +// CCertManUIKeeper::CCertManUIKeeper() +// Constructor with parent +// --------------------------------------------------------- +// +CpCertDataContainer::CpCertDataContainer() + { + } + +// --------------------------------------------------------- +// CCertManUIKeeper::~CCertManUIKeeper() +// Destructor +// --------------------------------------------------------- +// +CpCertDataContainer::~CpCertDataContainer() + { + iCALabelEntries.Close(); + iUserLabelEntries.Close(); + iPeerLabelEntries.Close(); + iDeviceLabelEntries.Close(); + + if ( iWrapper ) + { + iWrapper->Cancel(); + } + delete iWrapper; + + delete iFilter; + delete iKeyFilter; + delete iStore; + delete iKeyStore; + + iCAEntries.Close(); + iUserEntries.Close(); + iPeerEntries.Close(); + iDeviceEntries.Close(); + iKeyEntries.Close(); + + iRfs.Close(); + } + +// --------------------------------------------------------- +// CCertManUIKeeper* CCertManUIKeeper::NewL(const TRect& aRect, TUid aViewId) +// --------------------------------------------------------- +// + +CpCertDataContainer* CpCertDataContainer::NewL() + { + CpCertDataContainer* self = new ( ELeave ) CpCertDataContainer; + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// --------------------------------------------------------- +// CCertManUIKeeper* CCertManUIKeeper::NewLC( +// const TRect& aRect, TUid aViewId) +// --------------------------------------------------------- +// +CpCertDataContainer* CpCertDataContainer::NewLC() + { + CpCertDataContainer* self = new ( ELeave ) CpCertDataContainer; + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// --------------------------------------------------------- +// CCertManUIKeeper::ConstructL( + // const TRect& aRect, TUid aViewId +// +// --------------------------------------------------------- +// +void CpCertDataContainer::ConstructL() + { + // Ensure that file server session is succesfully created + User::LeaveIfError( iRfs.Connect() ); + + TRAPD ( error, iStore = CUnifiedCertStore::NewL( iRfs, ETrue ) ); + + if ( error == KErrNotSupported || error == KErrNotReady + || error == KErrArgument || error == KErrNotFound ) + { + // Something may be wrong with the databases + ShowErrorNoteL( error ); + } + + User::LeaveIfError( error ); + + iWrapper = CpCertManUISyncWrapper::NewL(); + iWrapper->InitStoreL( iStore ); + + iFilter = CCertAttributeFilter::NewL(); + + TRAP( error, iKeyStore = CUnifiedKeyStore::NewL( iRfs ) ); + + if (error == KErrNotSupported || error == KErrNotReady + || error == KErrArgument || error == KErrNotFound) + { + // Something is wrong with key stores + ShowErrorNoteL( error ); + } + + User::LeaveIfError( error ); + + iWrapper->InitStoreL( iKeyStore ); + iKeyEntries.Close(); + + } + + +// --------------------------------------------------------- +// CCertManUIKeeper::CertManager() +// --------------------------------------------------------- +// +CUnifiedCertStore*& CpCertDataContainer::CertManager() + { + return iStore; + } + +// --------------------------------------------------------- +// CCertManUIKeeper::KeyManager() +// --------------------------------------------------------- +// +CUnifiedKeyStore*& CpCertDataContainer::KeyManager() + { + return iKeyStore; + } + +// --------------------------------------------------------- +// CCertManUIKeeper::RefreshCAEntriesL() +// Checks that cacerts.dat file is not corrupted and +// returns CA certificates from it +// --------------------------------------------------------- +// +void CpCertDataContainer::RefreshCAEntriesL() + { + iFilter->SetOwnerType( ECACertificate ); + iCAEntries.Close(); + CUnifiedCertStore*& store = CertManager(); + iWrapper->ListL( store, &iCAEntries, *iFilter ); + + iCALabelEntries.Close(); + for ( TInt ii = 0; ii < iCAEntries.Count(); ii++ ) + { + switch ( iCAEntries[ii]->CertificateFormat() ) + { + case EX509Certificate: + { + CpCertManUICertData* data = new ( ELeave ) CpCertManUICertData(); + CleanupStack::PushL( data ); + data->iCAEntry = CCTCertInfo::NewL( *iCAEntries[ii] ); + + HBufC* pri = NULL; + HBufC* sec = NULL; + + CCertificate* cert; + + TRAPD(err, iWrapper->GetCertificateL( CertManager(), *iCAEntries[ii], cert )); + if (( err == KErrArgument ) || ( err == KErrCorrupt )) + { + // This indicates that certificate is not according to X509 + // specification or it is corrupted. Ignore certificate + if(data->iCAEntry) + { + data->iCAEntry->Release(); + } + CleanupStack::PopAndDestroy( data ); // data + continue; + } + else + { + User::LeaveIfError( err ); + } + + CleanupStack::PushL( cert ); + + X509CertNameParser::PrimaryAndSecondaryNameL + ( *((CX509Certificate*)cert), pri, sec, iCAEntries[ii]->Label()); + + CleanupStack::PushL( pri ); + CleanupStack::PushL( sec ); + + TInt lenght = 0; + + lenght += iCAEntries[ii]->Label().Length(); + + if ( pri ) + { + lenght += pri->Length(); + } + if ( sec && !(iCAEntries[ii]->Label().Length()) ) + { + lenght += sec->Length(); + } + lenght += KNameSeparator.iTypeLength; + + HBufC* label = HBufC::NewL( lenght ); + label->Des().Append( iCAEntries[ii]->Label() ); + + if ( pri ) + { + label->Des().Append( KNameSeparator ); + label->Des().Append( pri->Des() ); + } + if ( sec && !(iCAEntries[ii]->Label().Length()) ) + { + label->Des().Append( sec->Des() ); + } + + data->iCAEntryLabel = label; + iCALabelEntries.Append( data ); + + CleanupStack::PopAndDestroy( 3, cert ); // pri, sec + CleanupStack::Pop( data ); + break; + } // EX509Certificate + + case EWTLSCertificate: + // Do nothing for wtls certificates + break; + default: + { + User::Leave( KErrNotSupported ); + } + } // switch + + } // for + + // Sort the certificates. + TLinearOrder order( CompareCALabels ); + iCALabelEntries.Sort( order ); + + } + +// --------------------------------------------------------- +// CCertManUIKeeper::RefreshPeerCertEntriesL() +// Checks that Trusted site certificate store is +// not corrupted and returns Peer certificates from it +// --------------------------------------------------------- +// +void CpCertDataContainer::RefreshPeerCertEntriesL() + { + iFilter->SetOwnerType( EPeerCertificate ); + iPeerEntries.Close(); + CUnifiedCertStore*& store = CertManager(); + + iWrapper->ListL( store, &iPeerEntries, *iFilter, KCMTrustedServerTokenUid ); + + iPeerLabelEntries.Close(); + + for ( TInt ii = 0; ii < iPeerEntries.Count(); ii++ ) + { + switch ( iPeerEntries[ii]->CertificateFormat() ) + { + case EX509Certificate: + { + CpCertManUICertData* data = new (ELeave) CpCertManUICertData(); + CleanupStack::PushL( data ); + data->iPeerEntry = CCTCertInfo::NewL( *iPeerEntries[ii] ); + + CCertificate* cert; + + TRAPD( err, iWrapper->GetCertificateL( CertManager(), *iPeerEntries[ii], cert, KCMTrustedServerTokenUid )); + if (( err == KErrArgument ) || ( err == KErrCorrupt )) + { + // This indicates that certificate is not according to X509 + // specification or it is corrupted. Ignore certificate + if( data->iPeerEntry ) + { + data->iPeerEntry->Release(); + } + CleanupStack::PopAndDestroy( data ); // data + continue; + } + else + { + User::LeaveIfError( err ); + } + + CleanupStack::PushL( cert ); + + TInt lenght = 0; + + lenght += iPeerEntries[ii]->Label().Length(); + + HBufC* label = HBufC::NewL( lenght ); + label->Des().Append( iPeerEntries[ii]->Label() ); + + data->iPeerEntryLabel = label; + iPeerLabelEntries.Append( data ); + + CleanupStack::PopAndDestroy( cert ); // cert + CleanupStack::Pop( data ); // data + break; + } // EX509Certificate + + case EWTLSCertificate: + // Do nothing for wtls certificates + break; + default: + { + User::Leave( KErrNotSupported ); + } + } // switch + + } // for + + // Sort the certificates. + TLinearOrder order( ComparePeerLabels ); + iPeerLabelEntries.Sort( order ); + + } + + +// --------------------------------------------------------- +// CCertManUIKeeper::RefreshUserCertEntriesL() +// Checks that cacerts.dat file is not corrupted and +// returns User certificates from it +// --------------------------------------------------------- +// +void CpCertDataContainer::RefreshUserCertEntriesL() + { + iFilter->SetOwnerType( EUserCertificate ); + iUserEntries.Close(); + CUnifiedCertStore*& store = CertManager(); + iWrapper->ListL( store, &iUserEntries, *iFilter ); + + iUserLabelEntries.Close(); + + for ( TInt i = 0; i < iUserEntries.Count(); i++ ) + { + + if ( iUserEntries[i]->Handle().iTokenHandle.iTokenTypeUid == KCMDeviceCertStoreTokenUid ) + { + // User certificates from DeviceCertStore are not + // shown in Personal certificate view. Ignore this certificate. + break; + } + + switch ( iUserEntries[i]->CertificateFormat() ) + { + case EX509Certificate: + { + CpCertManUICertData* data = new (ELeave) CpCertManUICertData(); + CleanupStack::PushL( data ); + data->iUserEntry = CCTCertInfo::NewL( *iUserEntries[i] ); + + HBufC* pri = NULL; + HBufC* sec = NULL; + + CCertificate* cert = NULL; + TRAPD(error, iWrapper->GetCertificateL( CertManager(), *iUserEntries[i], cert )); + + if( error == KErrArgument) + { + CleanupStack::PopAndDestroy( data ); + break; + } + else if ( error != KErrNone ) + { + User::Leave( error ); + } + else + { + CleanupStack::PushL( cert ); + } + + X509CertNameParser::PrimaryAndSecondaryNameL + ( *((CX509Certificate*)cert), pri, sec, iUserEntries[i]->Label()); + + CleanupStack::PushL( pri ); + CleanupStack::PushL( sec ); + + TInt lenght = 0; + + lenght += iUserEntries[i]->Label().Length(); + + if ( pri ) + { + lenght += pri->Length(); + } + if ( sec && !(iUserEntries[i]->Label().Length()) ) + { + lenght += sec->Length(); + } + lenght += KNameSeparator.iTypeLength; + + HBufC* label = HBufC::NewL( lenght ); + label->Des().Append( iUserEntries[i]->Label() ); + + if ( pri ) + { + label->Des().Append( KNameSeparator ); + label->Des().Append( pri->Des() ); + } + if ( sec && !(iUserEntries[i]->Label().Length()) ) + { + label->Des().Append( sec->Des() ); + } + + data->iUserEntryLabel = label; + iUserLabelEntries.Append( data ); + + CleanupStack::PopAndDestroy( 3, cert ); // pri, sec + CleanupStack::Pop( data ); // data + break; + } // EX509Certificate + + case EX509CertificateUrl: + { + CpCertManUICertData* urlCertData = new (ELeave) CpCertManUICertData(); + CleanupStack::PushL( urlCertData ); + urlCertData->iUserEntry = CCTCertInfo::NewL( *iUserEntries[i] ); + + CCertificate* cert = NULL; + TRAPD(error, iWrapper->GetCertificateL( CertManager(), *iUserEntries[i], cert )); + if( error == KErrArgument ) + { + CleanupStack::PopAndDestroy( urlCertData ); // urlCertData + break; + } + else if ( error != KErrNone ) + { + User::Leave(error); + } + else + { + CleanupStack::PushL( cert ); + } + + _LIT(KUrlUserCert, "URL UserCert"); + HBufC* UrlLabel = HBufC::NewL( KUrlUserCert().Length() ); + UrlLabel->Des().Append( KUrlUserCert()); + + urlCertData->iUserEntryLabel = UrlLabel; + iUserLabelEntries.Append( urlCertData ); + + CleanupStack::PopAndDestroy( cert ); // cert + CleanupStack::Pop( urlCertData ); // data + break; + } + } // switch + + } // for + + // Sort the certificates. + TLinearOrder order( CompareUserLabels ); + iUserLabelEntries.Sort( order ); + + } + +// --------------------------------------------------------- +// CCertManUIKeeper::RefreshDeviceCertEntriesL() +// returns device certificates +// --------------------------------------------------------- +// +void CpCertDataContainer::RefreshDeviceCertEntriesL() + { + iFilter->SetOwnerType( EUserCertificate ); + iDeviceEntries.Close(); + CUnifiedCertStore*& store = CertManager(); + + iWrapper->ListL( store, &iDeviceEntries, *iFilter, KCMDeviceCertStoreTokenUid ); + + iDeviceLabelEntries.Close(); + for ( TInt i = 0; i < iDeviceEntries.Count(); i++ ) + { + switch ( iDeviceEntries[i]->CertificateFormat() ) + { + case EX509Certificate: + { + CpCertManUICertData* data = new (ELeave) CpCertManUICertData(); + CleanupStack::PushL( data ); + data->iDeviceEntry = CCTCertInfo::NewL( *iDeviceEntries[i] ); + + HBufC* pri = NULL; + HBufC* sec = NULL; + + CCertificate* cert = NULL; + TRAPD(error, iWrapper->GetCertificateL( CertManager(), *iDeviceEntries[i], cert, KCMDeviceCertStoreTokenUid )); + + if( error == KErrArgument) + { + CleanupStack::PopAndDestroy( data ); + break; + } + else if ( error != KErrNone ) + { + User::Leave( error ); + } + else + { + CleanupStack::PushL( cert ); + } + + X509CertNameParser::PrimaryAndSecondaryNameL + ( *((CX509Certificate*)cert), pri, sec, iDeviceEntries[i]->Label()); + + CleanupStack::PushL( pri ); + CleanupStack::PushL( sec ); + + TInt lenght = 0; + + lenght += iDeviceEntries[i]->Label().Length(); + + if ( pri ) + { + lenght += pri->Length(); + } + if ( sec && !(iDeviceEntries[i]->Label().Length()) ) + { + lenght += sec->Length(); + } + lenght += KNameSeparator.iTypeLength; + + HBufC* label = HBufC::NewL( lenght ); + label->Des().Append( iDeviceEntries[i]->Label() ); + + if ( pri ) + { + label->Des().Append( KNameSeparator ); + label->Des().Append( pri->Des() ); + } + if ( sec && !(iDeviceEntries[i]->Label().Length()) ) + { + label->Des().Append( sec->Des() ); + } + + data->iDeviceEntryLabel = label; + iDeviceLabelEntries.Append( data ); + + CleanupStack::PopAndDestroy( 3, cert ); // pri, sec + CleanupStack::Pop( data ); // data + break; + } // EX509Certificate + + case EX509CertificateUrl: + { + CpCertManUICertData* urlCertData = new (ELeave) CpCertManUICertData(); + CleanupStack::PushL( urlCertData ); + urlCertData->iDeviceEntry = CCTCertInfo::NewL( *iDeviceEntries[i] ); + + CCertificate* cert = NULL; + TRAPD(error, iWrapper->GetCertificateL( CertManager(), *iDeviceEntries[i], cert, KCMDeviceCertStoreTokenUid )); + if( error == KErrArgument) + { + CleanupStack::PopAndDestroy( urlCertData ); // urlCertData + break; + } + else if ( error != KErrNone ) + { + User::Leave(error); + } + else + { + CleanupStack::PushL( cert ); + } + + _LIT(KUrlUserCert, "URL UserCert"); + HBufC* UrlLabel = HBufC::NewL( KUrlUserCert().Length() ); + UrlLabel->Des().Append( KUrlUserCert()); + + + urlCertData->iDeviceEntryLabel = UrlLabel; + iDeviceLabelEntries.Append( urlCertData ); + + CleanupStack::PopAndDestroy( cert ); // cert + CleanupStack::Pop( urlCertData ); // data + break; + } + } // switch + + } // for + + // Sort the certificates. + TLinearOrder order( CompareDeviceLabels ); + iDeviceLabelEntries.Sort( order ); + + } + +// --------------------------------------------------------- +// CCertManUIKeeper::ShowErrorNoteL( TInt aError ) +// Shows error note +// --------------------------------------------------------- +// +void CpCertDataContainer::ShowErrorNoteL( TInt aError ) + { + QString sError; + switch ( aError ) + { + case KErrCorrupt: + { + sError = "Database corrupted. Some data might have been lost."; + break; + } + case KErrCancel: + { + // Show nothing + break; + } + default: + { + sError = "Internal error"; + break; + } + } + + if ( sError.length() != 0 ) + { + HbMessageBox::information(sError); + } + } + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/src/cpcertdetailview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/src/cpcertdetailview.cpp Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,864 @@ +/* +* Copyright (c) 2010 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: +* +*/ +#include +#include +#include +#include +#include +#include // MD5 fingerprint +#include + +#include // Pow +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "cpcertdetailview.h" +#include "cpcertview.h" +#include "cpcertdatacontainer.h" +#include "cpcertmanuisyncwrapper.h" +#include "../../../pkiutilities/DeviceToken/Inc/TrustedSitesStore.h" + +const TInt KFileCertStoreUid( 0x101F501A ); +const TInt KTrustedServerCertStoreUid( 0x101FB66F ); +const TInt KDeviceCertStoreUid( 0x101FB668 ); +const TInt KDeviceKeyStoreUid( 0x101FB66A ); +const TInt KWIMCertStoreUid ( 0x101F79D9 ); + +const TInt KMaxLengthTextSerialNumberFormatting = 3; +_LIT( KCertManUIDetailsViewHexaFormat, "%02X" ); +_LIT( KBlockSeparator, " " ); + +template +class CleanupResetAndDestroy + { +public: + inline static void PushL( T& aRef ); +private: + static void ResetAndDestroy( TAny *aPtr ); + }; + +template +inline void CleanupResetAndDestroyPushL( T& aRef ); + +template +inline void CleanupResetAndDestroy::PushL( T& aRef ) + { + CleanupStack::PushL( TCleanupItem( &ResetAndDestroy, &aRef ) ); + } + +template +void CleanupResetAndDestroy::ResetAndDestroy( TAny *aPtr ) + { + if( aPtr ) + { + static_cast( aPtr )->ResetAndDestroy(); + } + } + +template +inline void CleanupResetAndDestroyPushL( T& aRef ) + { + CleanupResetAndDestroy::PushL( aRef ); + } + +CpCertDetailView::CpCertDetailView(CpCertView::TCertificateViews aCurrentView,TInt aPos, CpCertDataContainer& aCertDataContainer, QGraphicsItem *parent /*= 0*/) +: CpBaseSettingView(0,parent), mCertDataContainer(aCertDataContainer) + { + setTitle(tr("Certificate Details")); + + try + { + QT_TRAP_THROWING(viewCertificateDetailsL(aPos, aCurrentView)); + } + catch(const std::exception& exception) + { + HbMessageBox::information(exception.what()); + throw(exception); + } + } + + +CpCertDetailView::~CpCertDetailView() + {} + +void CpCertDetailView::viewCertificateDetailsL( TInt aIndex, CpCertView::TCertificateViews aType ) + { + + QGraphicsLinearLayout *layout = q_check_ptr(new QGraphicsLinearLayout(Qt::Vertical)); + setLayout(layout); + + HbListWidget* mCertDetails = q_check_ptr(new HbListWidget(this)); + + HBufC8* urlBuf = NULL; + CCertificate* details = NULL; + CUnifiedCertStore*& store = mCertDataContainer.CertManager(); + + const CCTCertInfo* entry = certInfo(aIndex, aType); + TCertificateFormat certificateFormat = entry->CertificateFormat(); + + if( certificateFormat != EX509CertificateUrl ) + { + mCertDataContainer.iWrapper->GetCertificateL( store, *entry, details ); + CleanupStack::PushL( details ); + validateCertificateL( aIndex, *details, *entry, aType ); + } + else + { + urlBuf = HBufC8::NewLC( entry->Size() ); + TPtr8 urlPtr = urlBuf->Des(); + mCertDataContainer.iWrapper->GetUrlCertificateL( store, *entry, urlPtr ); + } + + if( aType == CpCertView::ETrustedView ) + { + addTrustedSitesL(*details, *mCertDetails); + } + else + { + addLabel(*entry, *mCertDetails); + } + + // certificate issuer and owner + if( certificateFormat == EX509Certificate ) + { + addIssuerL(*details, *mCertDetails); + addSubjectL(*details, *mCertDetails); + } + + // Get key usage and location. This is done only client certificates. + const TInt KLocationUnknown = 0; + TUid keyLocation = { KLocationUnknown }; + + if(( aType == CpCertView::EPersonalView ) || ( aType == CpCertView::EDeviceView )) + { + TKeyUsagePKCS15 usage = keyUsageAndLocationL( *entry, &keyLocation ); + addCertUsage(usage, *mCertDetails); + } + + if( certificateFormat == EX509Certificate ) + { + addValidityPeriod( *details, *mCertDetails ); + TUid certLoc; + certLoc.iUid = entry->Token().TokenType().Type().iUid; + // add the location of the certificate + setLocationInfo( ETrue, certLoc, *mCertDetails ); + } + else if( certificateFormat == EX509CertificateUrl ) + { + setURLLocation( *urlBuf, *mCertDetails ); + } + else + { + // nothing + } + + addCertFormat(certificateFormat, *mCertDetails); + + // Private key location, only for user and device certicates + if(( aType == CpCertView::EPersonalView ) || ( aType == CpCertView::EDeviceView )) + { + setLocationInfo( EFalse, keyLocation, *mCertDetails ); + } + + if( certificateFormat == EX509Certificate ) + { + addAlgoDetails( *details, *mCertDetails); + addSerialNo( *details, *mCertDetails ); + addFingerprint( *details, *mCertDetails); + addPublicKeyDetailsL( *details, *mCertDetails ); + } + else + { + // SetUrlCertAlgorihm() + } + + if( certificateFormat != EX509CertificateUrl ) + { + CleanupStack::PopAndDestroy( details ); + } + else + { + CleanupStack::PopAndDestroy( urlBuf ); + } + + layout->addItem(mCertDetails); + } + +const CCTCertInfo* CpCertDetailView::certInfo( TInt index, CpCertView::TCertificateViews certView ) + { + const CCTCertInfo* certinfo = NULL; + + if( certView == CpCertView::EAuthorityView ) + { + certinfo = ( mCertDataContainer.iCALabelEntries )[ index ]->iCAEntry; + } + else if( certView == CpCertView::ETrustedView ) + { + certinfo = ( mCertDataContainer.iPeerLabelEntries )[ index ]->iPeerEntry; + } + else if( certView == CpCertView::EDeviceView ) + { + certinfo = ( mCertDataContainer.iDeviceLabelEntries )[ index ]->iDeviceEntry; + } + else if( certView == CpCertView::EPersonalView ) + { + certinfo = ( mCertDataContainer.iUserLabelEntries )[ index ]->iUserEntry; + } + return certinfo; + } + +void CpCertDetailView::addTrustedSitesL( const CCertificate& certDetails, HbListWidget& certDisplayDetails ) + { + CTrustSitesStore* trustedSitesStore = CTrustSitesStore::NewL(); + CleanupStack::PushL( trustedSitesStore ); + + RPointerArray trustedSites; + CleanupResetAndDestroyPushL( trustedSites ); + trustedSitesStore->GetTrustedSitesL( certDetails.Encoding(), trustedSites ); + + QString sTrustedSites = "Site:"; + if( trustedSites.Count() > 0 ) + { + // display trusted sites + sTrustedSites = "Site:"; + } + addToListWidget(certDisplayDetails, sTrustedSites); + + for(int index=0;indexPtr()), trustedSites[index]->Length()); + addToListWidget(certDisplayDetails, trustedSiteDetail); + } + + CleanupStack::PopAndDestroy( &trustedSites ); + CleanupStack::PopAndDestroy( trustedSitesStore ); + + } + +void CpCertDetailView::addLabel( const CCTCertInfo& aCertInfo, HbListWidget& certDisplayDetails ) + { + QString sLabel("Label:"); + QString sLabelDetails = "(No label)"; + if(aCertInfo.Label().Length() != 0) + { + sLabelDetails = QString((QChar*)(aCertInfo.Label().Ptr()),aCertInfo.Label().Length()); + } + addToListWidget(certDisplayDetails, sLabel, sLabelDetails); + } + +void CpCertDetailView::addIssuerL( const CCertificate& aCertDetails, + HbListWidget& certDisplayDetails ) + { + HBufC* issuer = NULL; + X509CertNameParser::IssuerFullNameL( (CX509Certificate&)aCertDetails, issuer ); + CleanupStack::PushL( issuer ); + + QString sIssuer = "Issuer:"; + QString sIssuerDetails = "(Not defined)"; + if(issuer->Des().Length() != 0) + { + sIssuerDetails = QString((QChar*)issuer->Des().Ptr(),issuer->Des().Length()); + } + addToListWidget(certDisplayDetails, sIssuer, sIssuerDetails); + + CleanupStack::PopAndDestroy( issuer ); + } + +void CpCertDetailView::addSubjectL( const CCertificate& aCertDetails, + HbListWidget& certDisplayDetails ) + { + HBufC* subject = NULL; + X509CertNameParser::SubjectFullNameL( (CX509Certificate&)aCertDetails, subject ); + CleanupStack::PushL( subject ); + + QString sSubject = "Subject:"; + QString sSubjectDetails = "(No subject)"; + if(subject->Des().Length() != 0) + { + sSubjectDetails = QString((QChar*)subject->Des().Ptr(),subject->Des().Length()); + } + + addToListWidget(certDisplayDetails, sSubject, sSubjectDetails); + + CleanupStack::PopAndDestroy( subject ); + } + +void CpCertDetailView::addCertUsage( TKeyUsagePKCS15 usage, HbListWidget& certDisplayDetails ) + { + QString strUsage; + switch( usage ) + { + case EPKCS15UsageSignSignRecover: + case EPKCS15UsageSignDecrypt: + case EPKCS15UsageSign: + strUsage = "Client authentication"; + break; + case EPKCS15UsageNonRepudiation: + strUsage = "Digital signing"; + break; + default: + strUsage = "(Not defined)"; + break; + } + addToListWidget(certDisplayDetails, strUsage ); + } + + +void CpCertDetailView::addValidityPeriod( const CCertificate& aCertDetails, + HbListWidget& certDisplayDetails) + { + // Certificate validity period + // Hometime's offset to UTC + TLocale locale; + TTimeIntervalSeconds offSet = locale.UniversalTimeOffset(); + + QString sValidFrom("Valid from: "); + const CValidityPeriod& validityPeriod = aCertDetails.ValidityPeriod(); + TTime startValue = validityPeriod.Start(); + startValue += offSet; + TDateTime dateTime = startValue.DateTime(); + TMonth month = dateTime.Month(); + TInt day = dateTime.Day(); + TInt year = dateTime.Year(); + QDateTime qValidityPeriod(QDate(year, month, day)); + QString sValidFromDetail = qValidityPeriod.toString("MM\\dd\\yyyy"); + + addToListWidget(certDisplayDetails, sValidFrom, sValidFromDetail); + + QString sValidUntil("Valid until: "); + TTime finishValue = validityPeriod.Finish(); + finishValue += offSet; + dateTime = finishValue.DateTime(); + month = dateTime.Month(); + day = dateTime.Day(); + year = dateTime.Year(); + qValidityPeriod.setDate(QDate(year, month, day)); + QString sValidUntilDetail = qValidityPeriod.toString("MM\\dd\\yyyy"); + + addToListWidget(certDisplayDetails, sValidUntil, sValidUntilDetail); + + } + +void CpCertDetailView::setURLLocation( HBufC8& urlDetails, HbListWidget& certDisplayDetails ) + { + TPtr8 urlPtr = urlDetails.Des(); + + QString certUrl = "Location:"; + QString certURLDetail = "(Not defined)"; + TInt length = urlPtr.Length(); + if(length != 0) + { + certURLDetail = QString((QChar*)urlPtr.Ptr(),urlPtr.Length()); + } + addToListWidget(certDisplayDetails, certUrl, certURLDetail); + } + +void CpCertDetailView::addCertFormat( TCertificateFormat aCertFormat, HbListWidget& certDisplayDetails ) + { + // certificate format + QString certFormat = "Certificate format:"; + QString certFormatDetails = "(Not defined)"; + if( aCertFormat == EX509Certificate || aCertFormat == EX509CertificateUrl) + { + certFormatDetails = "X509"; + } + addToListWidget(certDisplayDetails, certFormat, certFormatDetails); + } + +void CpCertDetailView::addAlgoDetails( const CCertificate& certificate, + HbListWidget& certDisplayDetails ) + { + // certificate algorithms + QString sDgstAlgoDetails = "Unknown"; + // digest algorithm + TAlgorithmId algorithmId = certificate.SigningAlgorithm().DigestAlgorithm().Algorithm(); + switch( algorithmId ) + { + case EMD2: + { + sDgstAlgoDetails = "MD2"; + break; + } + case EMD5: + { + sDgstAlgoDetails = "MD5"; + break; + } + case ESHA1: + { + sDgstAlgoDetails = "SHA1"; + break; + } + } + + QString sAsymmetricAlgoDetails = asymmetricAlgoId(certificate); + QString sAlgorithm("Algorithm:"); + QString sAlgoDetails = "Unknown"; + // If other algorithm is unknown + if( sDgstAlgoDetails != "Unknown" && sAsymmetricAlgoDetails != "Unknown" ) + { + sAlgoDetails = sDgstAlgoDetails; + sAlgoDetails.append(sAsymmetricAlgoDetails); + } + addToListWidget(certDisplayDetails, sAlgorithm, sAlgoDetails); + } + +void CpCertDetailView::addSerialNo( const CCertificate& certificate, + HbListWidget& certDisplayDetails ) + { + // certificate serial number + QString sCertSerialNo("Serial number:"); + QString sCertSerialNoDetails = 0; + TPtrC8 serialNumber = certificate.SerialNumber(); + TBuf buf2; + + for( TInt i = 0; i < serialNumber.Length(); i++ ) + { + buf2.Format( KCertManUIDetailsViewHexaFormat, serialNumber[i] ); + sCertSerialNoDetails.append( QString( (QChar*)buf2.Ptr(),buf2.Length() ) ); + } + addToListWidget(certDisplayDetails, sCertSerialNo, sCertSerialNoDetails); + } + +void CpCertDetailView::addFingerprint( const CCertificate& certificate, + HbListWidget& certDisplayDetails) + { + // certificate fingerprint SHA-1 + QString sSha1("Fingerprint (SHA1):"); + TPtrC8 sha1_fingerprint = certificate.Fingerprint(); + HBufC* finalSha1 = NULL; + QT_TRAP_THROWING( finalSha1 = HBufC::NewLC(100)); + TPtr finalShaPtr = finalSha1->Des(); + divideIntoBlocks( sha1_fingerprint, finalShaPtr ); + QString sSha1Details = QString( (QChar*)finalShaPtr.Ptr(), finalShaPtr.Length() ); + CleanupStack::PopAndDestroy(finalSha1); + + addToListWidget(certDisplayDetails, sSha1, sSha1Details); + + // certificate fingerprint MD5 + QString sMd5("Fingerprint (MD5):"); + CMD5* md5= NULL; + QT_TRAP_THROWING( md5 = CMD5::NewL()); + QT_TRAP_THROWING(CleanupStack::PushL( md5 )); + TBuf8<20> fingerprint = md5->Hash( certificate.Encoding() ); + CleanupStack::PopAndDestroy( md5 ); + HBufC* finalMd5 = NULL; + QT_TRAP_THROWING( finalMd5 = HBufC::NewLC(100)); + TPtr finalMd5Ptr = finalMd5->Des(); + divideIntoBlocks( fingerprint, finalMd5Ptr ); + QString sMd5Details = QString( (QChar*)finalMd5Ptr.Ptr(), finalMd5Ptr.Length()); + CleanupStack::PopAndDestroy(finalMd5); + addToListWidget(certDisplayDetails, sMd5, sMd5Details); + } + +void CpCertDetailView::addPublicKeyDetailsL( const CCertificate& certificate, + HbListWidget& certDisplayDetails ) + { + // Public key + // Should look like: "Public key (%0U %1N bit):" + + QString sPublicKey("Public key ("); // %S %d bits):"); + sPublicKey.append(asymmetricAlgoId(certificate)); + + // Get public key already here to get length of it for string loader. + const CSubjectPublicKeyInfo& publicKey = certificate.PublicKey(); + TPtrC8 keyData = publicKey.KeyData(); + TInt size = keyData.Size(); // %1N + + // To get key size decode DER encoded key got from the certificate. + TX509KeyFactory key; + + // There doesn't seem to be definition of MAX_INT anywhere so calculate it. + TReal maxInt; + TReal intBits = sizeof( TInt ) * 8; + Math::Pow( maxInt, 2, intBits ); + maxInt = ( maxInt / 2 ) - 1; + + TAlgorithmId algorithmId = certificate.SigningAlgorithm().AsymmetricAlgorithm().Algorithm(); + switch( algorithmId ) + { + case ERSA: + { + const CRSAPublicKey* keyRSA = key.RSAPublicKeyL( keyData ); + + const TInteger& n = keyRSA->N(); + + TUint keySizeN = n.BitCount(); + + // Play it safe. + if( keySizeN < maxInt ) + { + size = keySizeN; + } + + delete keyRSA; + + break; + } + case EDSA: + { + TPtrC8 params = publicKey.EncodedParams(); + const CDSAPublicKey* keyDSA = key.DSAPublicKeyL( params, keyData ); + + const TInteger& y = keyDSA->Y(); + + TUint keySizeY = y.BitCount(); + + // Play it safe. + if( keySizeY < maxInt ) + { + size = keySizeY; + } + + delete keyDSA; + + break; + } + // There doesn't seem to be TX509KeyFactory function for DH keys. + // If the key is DH or unknown, just multiply length of the key + // in bytes with 8. It is not correct but at least gives an idea. + // Without setting something to size 'unknown' text should be used + // below for the string which is much more error prone than setting + // at least something. + case EDH: + default: + { + size = 8 * keyData.Size(); + } + } + + sPublicKey.append(" ").append(QString::number(size)).append(" bits):"); + + // Finally append the public key. + HBufC* pubKey = HBufC::NewLC(size*3); + TPtr pubKeyPtr = pubKey->Des(); + divideIntoBlocks( keyData, pubKeyPtr ); + QString sPublicKeyDetails = QString ( (QChar*)pubKeyPtr.Ptr(), pubKeyPtr.Length()); + CleanupStack::PopAndDestroy(pubKey); + addToListWidget(certDisplayDetails, sPublicKey, sPublicKeyDetails); + } + +QString CpCertDetailView::asymmetricAlgoId( const CCertificate& certificate ) + { + QString sAsymmetricAlgoId = 0; + // public-key algorithm + TAlgorithmId algorithmId = certificate.SigningAlgorithm().AsymmetricAlgorithm().Algorithm(); + switch( algorithmId ) + { + case ERSA: + { + sAsymmetricAlgoId = "RSA"; + break; + } + case EDSA: + { + sAsymmetricAlgoId = "DSA"; + break; + } + case EDH: + { + sAsymmetricAlgoId = "DH"; + break; + } + default: + { + sAsymmetricAlgoId = "Unknown"; + } + } + return sAsymmetricAlgoId; + } + +void CpCertDetailView::addToListWidget(HbListWidget& certDisplayDetails, const QString& data ) + { + HbListWidgetItem* wItem = q_check_ptr(new HbListWidgetItem()); + wItem->setText(data); + certDisplayDetails.addItem(wItem); + } + +void CpCertDetailView::addToListWidget( HbListWidget& certDisplayDetails, + const QString& displayString, + const QString& displayDetails ) + { + HbListWidgetItem* wDisplayString = q_check_ptr(new HbListWidgetItem()); + wDisplayString->setText(displayString); + certDisplayDetails.addItem(wDisplayString); + + HbListWidgetItem* wDisplayDetails = q_check_ptr(new HbListWidgetItem()); + wDisplayDetails->setText(displayDetails); + certDisplayDetails.addItem(wDisplayDetails); + } + +void CpCertDetailView::validateCertificateL( + TInt aIndex, const CCertificate& certDetails, const CCTCertInfo& aCertInfo, CpCertView::TCertificateViews aType ) + { + + TInt poppableItems = 0; + // Check allways first the validity period + // Show Expired/Not yet valid notes + const CValidityPeriod& validityPeriod = certDetails.ValidityPeriod(); + const TTime& startValue = validityPeriod.Start(); + const TTime& finishValue = validityPeriod.Finish(); + TTime current; + current.UniversalTime(); + + if ( startValue > current ) + { + // certificate is not valid yet + HbMessageBox::warning("The certificate is not valid yet"); + } + else if ( finishValue < current ) + { + // certificate is expired + HbMessageBox::warning("The certificate has expired"); + } + else + { + // put here check for certificate status, show warning notes if needed + TBool noValidationError = ETrue; + CArrayFixFlat* validationError = NULL; + // set it to the most common cert format + TCertificateFormat certificateFormat = EX509Certificate; + + if ( aType == CpCertView::EAuthorityView ) + { + certificateFormat = mCertDataContainer.iCALabelEntries[aIndex]-> + iCAEntry->CertificateFormat(); + } + else if ( aType == CpCertView::ETrustedView ) + { + certificateFormat = mCertDataContainer.iPeerLabelEntries[aIndex]-> + iPeerEntry->CertificateFormat(); + } + else if ( aType == CpCertView::EDeviceView ) + { + certificateFormat = mCertDataContainer.iDeviceLabelEntries[aIndex]-> + iDeviceEntry->CertificateFormat(); + } + else if( aType == CpCertView::EPersonalView ) + { + certificateFormat = mCertDataContainer.iUserLabelEntries[aIndex]-> + iUserEntry->CertificateFormat(); + } + + switch ( certificateFormat ) + { + case EX509Certificate: + { + validationError = validateX509CertificateL((CX509Certificate&)certDetails ); + break; + } + default: + { + validationError = new ( ELeave) CArrayFixFlat( 1 ); + break; + } + } + CleanupStack::PushL( validationError ); + poppableItems++; + + TInt errorCount = validationError->Count(); + TBool ready = EFalse; + for ( TInt i = 0; i < errorCount && !ready; i++ ) + { + TValidationError errorType = validationError->At(i); + + switch ( errorType ) + { + case EValidatedOK: + case EChainHasNoRoot: + case EBadKeyUsage: + // Ignore these errors + //LOG_WRITE( "Ignored certificate validation error" ); + break; + + default: + // certificate is corrupted + noValidationError = EFalse; + HbMessageBox::warning("The certificate is corrupted"); + ready = ETrue; + break; + } + } + + if ( noValidationError && (aType == CpCertView::EAuthorityView )) + // Check for last if the CA certificate has no clients, + // ie. the trust state of every client is No + // For user certificates we don't do the check + { + + RArray trusterUids; + CleanupClosePushL( trusterUids ); + poppableItems++; + + mCertDataContainer.iWrapper->GetApplicationsL( + mCertDataContainer.CertManager(), aCertInfo, trusterUids ); + + if ( trusterUids.Count() == 0) + { + HbMessageBox::warning("Certificate not trusted"); + } + } + } + CleanupStack::PopAndDestroy( poppableItems ); + } + +CArrayFixFlat* CpCertDetailView::validateX509CertificateL( const CX509Certificate& certDetails ) + { + TInt poppableItems = 0; + CArrayFixFlat* validationError = + new ( ELeave ) CArrayFixFlat( 1 ); + CleanupStack::PushL( validationError ); //This is returned, so it isn't destroyed at the end. + + TTime GMTTime; + GMTTime.UniversalTime(); // Get Universal Time + RPointerArray certArray; + certArray.Append( &certDetails ); + + CPKIXCertChain* chain = CPKIXCertChain::NewLC( + mCertDataContainer.iRfs, certDetails.Encoding(), certArray ); + ++poppableItems; + + CPKIXValidationResult* result = CPKIXValidationResult::NewLC(); + ++poppableItems; + mCertDataContainer.iWrapper->ValidateX509RootCertificateL( result, GMTTime, chain ); + + TValidationStatus validationStatus = result->Error(); + //Set reserve space. One for error, other for warnings. + validationError->SetReserveL( 1 + result->Warnings().Count() ); + validationError->AppendL(validationStatus.iReason); + for ( TUint8 i = 0; i < result->Warnings().Count(); i++ ) + { + validationError->AppendL( result->Warnings().At(0).iReason ); + } + + CleanupStack::PopAndDestroy( poppableItems, chain ); // All but validationError. + CleanupStack::Pop(validationError); + return validationError; + } + +TKeyUsagePKCS15 CpCertDetailView::keyUsageAndLocationL( const CCTCertInfo& certEntry, + TUid* keyLocation ) + { + TKeyUsagePKCS15 keyUsage; + + // Check whether we have key for this certificate + RMPointerArray keyEntry; + TCTKeyAttributeFilter filter; + filter.iKeyId = certEntry.SubjectKeyId(); + + mCertDataContainer.iWrapper->ListL( mCertDataContainer.KeyManager(), &keyEntry, filter ); + + if (keyEntry.Count()) + { + keyUsage = keyEntry[0]->Usage(); + // Get Location + keyLocation->iUid = keyEntry[0]->Token().TokenType().Type().iUid ; + } + else + { + keyUsage = EPKCS15UsageNone; + } + + keyEntry.Close(); + return keyUsage; + } + +// --------------------------------------------------------- +// CCertManUICertificateHelper::setLocationInfo( (HBufC& aMessage, +// TBool certificate, +// TUid* aLocUid) +// Adds certificate/private key's location info to certificate details +// --------------------------------------------------------- +// +void CpCertDetailView::setLocationInfo(TBool certificate, TUid locUid, HbListWidget& certDisplayDetails) + { + + QString locationDetails = "(Not defined)"; + + switch ( locUid.iUid ) + { + case KFileCertStoreUid: + case KTrustedServerCertStoreUid: + case KDeviceCertStoreUid: + case KDeviceKeyStoreUid: + case KTokenTypeFileKeystore: + locationDetails = "Phone memory"; + break; + + case KWIMCertStoreUid: + locationDetails = "Smart card"; + break; + + default: + if ( !certificate ) + { + locationDetails = "No private key"; + } + break; + } + + QString location = "Location:"; + if ( !certificate ) + { + location = "Private key location:"; + } + + addToListWidget(certDisplayDetails, location, locationDetails ); + + } + +// --------------------------------------------------------- +// CCertManUICertificateHelper::divideIntoBlocks +// --------------------------------------------------------- +// +void CpCertDetailView::divideIntoBlocks( const TDesC8& input, TPtr& output ) + { + const TInt KBlockLength = 2; + TInt blockIndex = 0; + for ( TInt j = 0 ; j < input.Length() ; j++ ) + { + if ( blockIndex == KBlockLength ) + { + output.Append( KBlockSeparator ); + blockIndex = 0; + } + output.AppendNumFixedWidthUC( (TUint)(input[ j ]), EHex, 2 ); + ++blockIndex; + } + } + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/src/cpcertmanuisyncwrapper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/src/cpcertmanuisyncwrapper.cpp Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,776 @@ +/* +* Copyright (c) 2010 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: Implements a synchronous wrapper for easier use of Symbian's +* Security Frameworks's API's. +* +*/ + + +// INCLUDE FILES +#include +#include +#include +#include +#include + +#include "cpcertmanuisyncwrapper.h" + +// CONSTANTS +_LIT_SECURITY_POLICY_C1( KKeyStoreUsePolicy, ECapabilityReadUserData ); +// Maximum length of a certificate +const TInt KMaxCertificateLength = 5000; +const TInt KMaxKeyLength = 10000; + +// ----------------------------------------------------------------------------- +// CpCertManUISyncWrapper::ListL +// ----------------------------------------------------------------------------- +// +void CpCertManUISyncWrapper::ListL( + CUnifiedCertStore*& aStore, + RMPointerArray* aArray, + const CCertAttributeFilter& aFilter, + const TUid aTokenUid ) + { + + if ( IsActive() ) + { + // Wrapper is active. Don't go further + User::Leave(KErrGeneral); + } + + TInt count = aStore->CertStoreCount(); + for ( TInt ii = 0; ii < count; ii++ ) + { + MCTCertStore& certstore = aStore->CertStore( ii ); + MCTToken& token = certstore.Token(); + TUid tokenuid = token.Handle().iTokenTypeUid; + if ( tokenuid == aTokenUid ) + { + certstore.List( *aArray, aFilter, iStatus ); + iOperation = EOperationList; + iStore = aStore; + SetActive(); + iWait.Start(); + User::LeaveIfError( iStatus.Int() ); + break; + } + } + iOperation = EOperationNone; + } + +// ----------------------------------------------------------------------------- +// CpCertManUISyncWrapper::ListL +// ----------------------------------------------------------------------------- +// +void CpCertManUISyncWrapper::ListL( + CUnifiedKeyStore*& aStore, + RMPointerArray* aArray, + const TCTKeyAttributeFilter& aFilter ) + { + + if ( IsActive() ) + { + // Wrapper is active. Don't go further + User::Leave(KErrGeneral); + } + + aStore->List( *aArray, aFilter, iStatus ); + iOperation = EOperationKeyList; + iKeyStore = aStore; + SetActive(); + iWait.Start(); + User::LeaveIfError( iStatus.Int() ); + iOperation = EOperationNone; + } + +// ----------------------------------------------------------------------------- +// CpCertManUISyncWrapper::GetCertificateL +// ----------------------------------------------------------------------------- +// +void CpCertManUISyncWrapper::GetCertificateL( CUnifiedCertStore*& aStore, + const CCTCertInfo& aCertInfo, + CCertificate*& aCert, + TUid aTokenUid ) + { + aCert = NULL; + + HBufC8* buf = HBufC8::NewLC( KMaxCertificateLength ); + iCertPtr.Set( buf->Des() ); + + TInt count = aStore->CertStoreCount(); + for (TInt i = 0; i < count; i++) + { + MCTCertStore& certstore = aStore->CertStore( i ); + MCTToken& token = certstore.Token(); + TUid tokenuid = token.Handle().iTokenTypeUid; + if ( tokenuid == aTokenUid ) + { + certstore.Retrieve( aCertInfo, iCertPtr, iStatus ); + iOperation = EGetCertificate; + iStore = aStore; + SetActive(); + iWait.Start(); + User::LeaveIfError( iStatus.Int() ); + break; + } + } + + + switch ( aCertInfo.CertificateFormat() ) + { + case EX509Certificate: + { + aCert = CX509Certificate::NewL( iCertPtr ); + break; + } + case EX509CertificateUrl: + { + break; + } + default: + { + break; + } + } + + CleanupStack::PopAndDestroy(buf); + iOperation = EOperationNone; + + } + +// ----------------------------------------------------------------------------- +// CpCertManUISyncWrapper::DeleteCertL +// ----------------------------------------------------------------------------- +// +void CpCertManUISyncWrapper::DeleteCertL( CUnifiedCertStore*& aStore, + const CCTCertInfo& aCertInfo ) + { + + aStore->Remove( aCertInfo, iStatus ); + iOperation = EOperationDelete; + iStore = aStore; + SetActive(); + iWait.Start(); + User::LeaveIfError( iStatus.Int() ); + iOperation = EOperationNone; + } + +// ----------------------------------------------------------------------------- +// CpCertManUISyncWrapper::DeleteCertL +// ----------------------------------------------------------------------------- +// +void CpCertManUISyncWrapper::DeleteCertL( CUnifiedCertStore*& aStore, + const CCTCertInfo& aCertInfo, + TUid aTokenUid ) + { + + TInt count = aStore->WritableCertStoreCount(); + for (TInt i = 0; i < count; i++) + { + MCTWritableCertStore& writablestore = aStore->WritableCertStore( i ); + MCTToken& token = writablestore.Token(); + TUid tokenuid = token.Handle().iTokenTypeUid; + if ( tokenuid == aTokenUid ) + { + writablestore.Remove( aCertInfo, iStatus ); + iOperation = EOperationDelete; + iStore = aStore; + SetActive(); + iWait.Start(); + User::LeaveIfError( iStatus.Int() ); + break; + } + } + iOperation = EOperationNone; + } + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CpCertManUISyncWrapper::CpCertManUISyncWrapper() +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CpCertManUISyncWrapper::CpCertManUISyncWrapper() : CActive( EPriorityStandard ), iCertPtr(0,0) + { + CActiveScheduler::Add( this ); + } + +// ----------------------------------------------------------------------------- +// CpCertManUISyncWrapper::ConstructL() +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CpCertManUISyncWrapper::ConstructL() + { + } + + +// ----------------------------------------------------------------------------- +// CpCertManUISyncWrapper::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CpCertManUISyncWrapper* CpCertManUISyncWrapper::NewLC() + { + CpCertManUISyncWrapper* wrap = new ( ELeave ) CpCertManUISyncWrapper(); + CleanupStack::PushL( wrap ); + wrap->ConstructL(); + return wrap; + } + +// ----------------------------------------------------------------------------- +// CpCertManUISyncWrapper::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CpCertManUISyncWrapper* CpCertManUISyncWrapper::NewL() + { + CpCertManUISyncWrapper* wrap = CpCertManUISyncWrapper::NewLC(); + CleanupStack::Pop(wrap); + return wrap; + } + +// Destructor +CpCertManUISyncWrapper::~CpCertManUISyncWrapper() + { + } + +// ----------------------------------------------------------------------------- +// CpCertManUISyncWrapper::RunL +// If no errors happened, stop. Show an error note if needed. +// ----------------------------------------------------------------------------- +// + +void CpCertManUISyncWrapper::RunL() + { + + if ( iWait.IsStarted() ) + { + iWait.AsyncStop(); + } + + } + +// ----------------------------------------------------------------------------- +// CpCertManUISyncWrapper::DoCancel +// Cancels the ongoing operation if possible. +// ----------------------------------------------------------------------------- +// +void CpCertManUISyncWrapper::DoCancel() + { + switch ( iOperation ) + { + case EOperationInit: + { + iStore->CancelInitialize(); + break; + } + case EOperationList: + { + iStore->CancelList(); + break; + } + case EGetCertificate: + { + iStore->CancelRetrieve(); + break; + } + case EAddCertificate: + { + iStore->Cancel(); + break; + } + case ERetriveURLCertificate: + { + iStore->CancelRetrieve(); + break; + } + case EOperationDelete: + { + iStore->CancelRemove(); + break; + } + case EOperationGetApps: + { + iStore->CancelApplications(); + break; + } + case EOperationValidateX509Root: + { + iChain->CancelValidate(); + break; + } + case EShowErrorNote: + { + break; + } + case EOperationInitKeyStore: + { + iKeyStore->CancelInitialize(); + break; + } + case EOperationKeyList: + { + iKeyStore->CancelList(); + break; + } + case EOperationExportKey: + { + iKeyStore->CancelExportKey(); + break; + } + case EOperationImportKey: + { + iKeyStore->CancelImportKey(); + break; + } + case EOperationDeleteKey: + { + iKeyStore->CancelDeleteKey(); + break; + } + default: + { + break; + } + } + } + +// ----------------------------------------------------------------------------- +// CpCertManUISyncWrapper::InitStoreL +// ----------------------------------------------------------------------------- +// +void CpCertManUISyncWrapper::InitStoreL( CUnifiedCertStore*& aStore ) + { + aStore->Initialize( iStatus ); + iOperation = EOperationInit; + iStore = aStore; + SetActive(); + iWait.Start(); + User::LeaveIfError( iStatus.Int() ); + iOperation = EOperationNone; + } + +// ----------------------------------------------------------------------------- +// CpCertManUISyncWrapper::InitStoreL +// ----------------------------------------------------------------------------- +// +void CpCertManUISyncWrapper::InitStoreL( CUnifiedKeyStore*& aStore ) + { + aStore->Initialize( iStatus ); + iOperation = EOperationInitKeyStore; + iKeyStore = aStore; + SetActive(); + iWait.Start(); + User::LeaveIfError( iStatus.Int() ); + iOperation = EOperationNone; + } + +// ----------------------------------------------------------------------------- +// CpCertManUISyncWrapper::ListL +// ----------------------------------------------------------------------------- +// +void CpCertManUISyncWrapper::ListL( + CUnifiedCertStore*& aStore, + RMPointerArray* aArray, + const CCertAttributeFilter& aFilter ) + { + + if ( IsActive() ) + { + // Wrapper is active. Don't go further + User::Leave(KErrGeneral); + } + + aStore->List( *aArray, aFilter, iStatus ); + iOperation = EOperationList; + iStore = aStore; + SetActive(); + iWait.Start(); + User::LeaveIfError( iStatus.Int() ); + iOperation = EOperationNone; + } + +// ----------------------------------------------------------------------------- +// CpCertManUISyncWrapper::ListL +// ----------------------------------------------------------------------------- +// +void CpCertManUISyncWrapper::ListL( + CUnifiedKeyStore*& aStore, + RMPointerArray* aArray, + const TCTKeyAttributeFilter& aFilter, + const TUid aTokenUid ) + { + + if ( IsActive() ) + { + // Wrapper is active. Don't go further + User::Leave(KErrGeneral); + } + + TInt count = aStore->KeyStoreManagerCount(); + for ( TInt ii = 0; ii < count; ii++ ) + { + MCTKeyStoreManager& keystoremanager = aStore->KeyStoreManager( ii ); + MCTToken& token = keystoremanager.Token(); + TUid tokenuid = token.Handle().iTokenTypeUid; + if ( tokenuid == aTokenUid ) + { + keystoremanager.List( *aArray, aFilter, iStatus ); + iOperation = EOperationKeyList; + iKeyStore = aStore; + SetActive(); + iWait.Start(); + User::LeaveIfError( iStatus.Int() ); + break; + } + } + iOperation = EOperationNone; + } + +// ----------------------------------------------------------------------------- +// CpCertManUISyncWrapper::GetCertificateL +// ----------------------------------------------------------------------------- +// +void CpCertManUISyncWrapper::GetCertificateL( + CUnifiedCertStore*& aStore, + const CCTCertInfo& aCertInfo, + CCertificate*& aCert ) + { + aCert = NULL; + HBufC8* buf = HBufC8::NewLC( KMaxCertificateLength ); + iCertPtr.Set( buf->Des() ); + aStore->Retrieve( aCertInfo, iCertPtr, iStatus); + iOperation = EGetCertificate; + iStore = aStore; + SetActive(); + iWait.Start(); + User::LeaveIfError( iStatus.Int() ); + + switch ( aCertInfo.CertificateFormat() ) + { + case EX509Certificate: + { + aCert = CX509Certificate::NewL( iCertPtr ); + break; + } + case EX509CertificateUrl: + { + break; + } + default: + { + break; + } + } + CleanupStack::PopAndDestroy(buf); + iOperation = EOperationNone; + } + +// ----------------------------------------------------------------------------- +// CpCertManUISyncWrapper::ValidateX509RootCertificateL +// ----------------------------------------------------------------------------- +// +void CpCertManUISyncWrapper::ValidateX509RootCertificateL( + CPKIXValidationResult*& aValidationResult, + const TTime& aValidationTime, CPKIXCertChain*& aChain ) + { + + aChain->ValidateL( *aValidationResult, aValidationTime, iStatus ); + iOperation = EOperationValidateX509Root; + iChain = aChain; + SetActive(); + iWait.Start(); + iOperation = EOperationNone; + User::LeaveIfError(iStatus.Int()); + } + +// ----------------------------------------------------------------------------- +// CpCertManUISyncWrapper::GetUrlCertificateL +// ----------------------------------------------------------------------------- +// +void CpCertManUISyncWrapper::GetUrlCertificateL( + CUnifiedCertStore*& aStore, + const CCTCertInfo& aCertInfo, + TDes8& aUrl ) + { + + aStore->Retrieve( aCertInfo, aUrl, iStatus); + iOperation = ERetriveURLCertificate; + iStore = aStore; + SetActive(); + iWait.Start(); + User::LeaveIfError( iStatus.Int() ); + iOperation = EOperationNone; + } + +// ----------------------------------------------------------------------------- +// CpCertManUISyncWrapper::GetApplicationsL +// ----------------------------------------------------------------------------- +// +void CpCertManUISyncWrapper::GetApplicationsL( CUnifiedCertStore*& aStore, + const CCTCertInfo& aCertInfo, RArray& aApps ) + { + + aStore->Applications( aCertInfo, aApps, iStatus ); + iOperation = EOperationGetApps; + iStore = aStore; + SetActive(); + iWait.Start(); + User::LeaveIfError( iStatus.Int() ); + iOperation = EOperationNone; + } + +// ----------------------------------------------------------------------------- +// CpCertManUISyncWrapper::SetApplicabilityL +// ----------------------------------------------------------------------------- +// +void CpCertManUISyncWrapper::SetApplicabilityL( CUnifiedCertStore*& aStore, + const CCTCertInfo& aCertInfo, + RArray& aApplications ) + { + + aStore->SetApplicability( aCertInfo, aApplications, iStatus ); + iOperation = EOperationSetApplicability; + iStore = aStore; + SetActive(); + iWait.Start(); + User::LeaveIfError( iStatus.Int() ); + aStore->SetTrust( aCertInfo, ETrue, iStatus ); + iOperation = EOperationSetToTrusted; + SetActive(); + iWait.Start(); + User::LeaveIfError( iStatus.Int() ); + iOperation = EOperationNone; + } + +// ----------------------------------------------------------------------------- +// CpCertManUISyncWrapper::MoveKeyL +// ----------------------------------------------------------------------------- +// +void CpCertManUISyncWrapper::MoveKeyL( + CUnifiedKeyStore*& aStore, + const TCTKeyAttributeFilter& aFilter, + const TUid aSourceTokenId, + const TUid aTargetTokenId ) + { + + TInt sourceIndex(-1); + TInt targetIndex(-1); + + // Find the index of key stores + TInt count = aStore->KeyStoreManagerCount(); + + for (TInt ii = 0; ii < count; ii++) + { + MCTKeyStoreManager& keystoremanager = aStore->KeyStoreManager( ii ); + MCTToken& token = keystoremanager.Token(); + TUid tokenuid = token.Handle().iTokenTypeUid; + + if ( tokenuid == aSourceTokenId ) + { + sourceIndex = ii; + } + + if ( tokenuid == aTargetTokenId ) + { + targetIndex = ii; + } + } + + if (( sourceIndex == -1 ) || ( targetIndex == -1 )) + { + // Key store(s) doesn't exist + User::Leave( KErrNotFound ); + } + + RMPointerArray keyEntries; + + MCTKeyStoreManager& sourcekeystore = + aStore->KeyStoreManager( sourceIndex ); + + MCTKeyStoreManager& targetkeystore = + aStore->KeyStoreManager( targetIndex ); + + + ListL( aStore, &keyEntries, aFilter, aSourceTokenId ); + + // Go through all matching keys and move them to + // target store + for ( TInt ii = 0; ii < keyEntries.Count(); ii++ ) + { + HBufC8* keyData = HBufC8::NewLC( KMaxKeyLength ); + + // Retrieve key from source key store + sourcekeystore.ExportKey( (*keyEntries[ii]).Handle(), keyData, iStatus ); + iOperation = EOperationExportKey; + SetActive(); + iWait.Start(); + User::LeaveIfError( iStatus.Int() ); + + TCTTokenObjectHandle sourceKeyHandle = (*keyEntries[ii]).Handle(); + + // Import key to target key store + + // If key info access type indicates that key is local, then importing is + // not possible. The following is the workarround. Almost identical + // copy of keyinfo is created without CCTKeyInfo::ELocal access type flag. + // UsePolicy is also updated + TInt accessType = (*keyEntries[ii]).AccessType(); + if ( accessType & CCTKeyInfo::ELocal ) + { + // CCTKeyInfo::ELocal is set in key info + HBufC* label = (*keyEntries[ii]).Label().AllocLC(); + + // The following XOR operation will clear local bit if it is on. + accessType ^= CCTKeyInfo::ELocal; + + CCTKeyInfo* keyInfo = CCTKeyInfo::NewL( (*keyEntries[ii]).ID(), + (*keyEntries[ii]).Usage(), + (*keyEntries[ii]).Size(), + NULL, + label, + (*keyEntries[ii]).Token(), + (*keyEntries[ii]).HandleID(), + KKeyStoreUsePolicy, + (*keyEntries[ii]).ManagementPolicy(), + (*keyEntries[ii]).Algorithm(), + accessType, + (*keyEntries[ii]).Native(), + (*keyEntries[ii]).StartDate(), + (*keyEntries[ii]).EndDate() ); + + CleanupStack::Pop(label); + targetkeystore.ImportKey( *keyData, keyInfo, iStatus ); + } + else + { + targetkeystore.ImportKey( *keyData, keyEntries[ii], iStatus ); + } + + iOperation = EOperationImportKey; + SetActive(); + iWait.Start(); + User::LeaveIfError( iStatus.Int() ); + + // Delete key from source key store + sourcekeystore.DeleteKey( sourceKeyHandle, iStatus ); + iOperation = EOperationDeleteKey; + SetActive(); + iWait.Start(); + User::LeaveIfError( iStatus.Int() ); + + CleanupStack::PopAndDestroy(keyData); + } + + } + +// ----------------------------------------------------------------------------- +// CpCertManUISyncWrapper::MoveCertL +// ----------------------------------------------------------------------------- +// +TInt CpCertManUISyncWrapper::MoveCertL( + CUnifiedCertStore*& aStore, + const CCTCertInfo& aCertInfo, + const TUid aSourceTokenId, + const TUid aTargetTokenId ) + { + + TInt sourceIndex(-1); + TInt targetIndex(-1); + TInt certCount (0); + + // Find the index of certificate stores + TInt count = aStore->WritableCertStoreCount(); + for (TInt ii = 0; ii < count; ii++) + { + MCTWritableCertStore& writablestore = aStore->WritableCertStore( ii ); + MCTToken& token = writablestore.Token(); + TUid tokenuid = token.Handle().iTokenTypeUid; + + if ( tokenuid == aSourceTokenId ) + { + sourceIndex = ii; + } + + if ( tokenuid == aTargetTokenId ) + { + targetIndex = ii; + } + } + + if (( sourceIndex == -1 ) || ( targetIndex == -1 )) + { + // Certificate store(s) doesn't exist + User::Leave( KErrNotFound ); + } + + + MCTWritableCertStore& sourcewritablestore = + aStore->WritableCertStore( sourceIndex ); + + // All of the certificates that are associated with same + // private key will be moved to target certificate store. + CCertAttributeFilter* filter = CCertAttributeFilter::NewL(); + filter->SetOwnerType( EUserCertificate ); + filter->SetSubjectKeyId( aCertInfo.SubjectKeyId() ); + RMPointerArray certEntries; + + // List certificates from source certificate store + ListL( aStore, &certEntries, *filter, aSourceTokenId ); + + delete filter; + + for ( TInt ii = 0; ii < certEntries.Count(); ii++ ) + { + // Retrieve certificate from source certificate store + HBufC8* buf = HBufC8::NewLC( KMaxCertificateLength ); + iCertPtr.Set( buf->Des() ); + sourcewritablestore.Retrieve( *certEntries[ii], iCertPtr, iStatus ); + iOperation = EGetCertificate; + SetActive(); + iWait.Start(); + User::LeaveIfError( iStatus.Int() ); + + // Add certificate to target certificate store + MCTWritableCertStore& targetwritablestore = + aStore->WritableCertStore( targetIndex ); + + targetwritablestore.Add( (*certEntries[ii]).Label(), EX509Certificate, + EUserCertificate, &((*certEntries[ii]).SubjectKeyId()), + &((*certEntries[ii]).IssuerKeyId()), *buf, iStatus ); + + iOperation = EAddCertificate; + SetActive(); + iWait.Start(); + User::LeaveIfError( iStatus.Int() ); + + // Delete certificate from source certificate store + sourcewritablestore.Remove( *certEntries[ii], iStatus ); + iOperation = EOperationDelete; + iStore = aStore; + SetActive(); + iWait.Start(); + User::LeaveIfError( iStatus.Int() ); + iOperation = EOperationNone; + certCount++; + CleanupStack::PopAndDestroy(buf); + } + + return certCount; + } + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/src/cpcertpluginloader.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/src/cpcertpluginloader.cpp Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2010 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: + * + */ + +#include + +#include "cpcertpluginloader.h" +#include "cpsecurityview.h" +#include + +CpCertPluginLoader::CpCertPluginLoader() + { + mTranslator =q_check_ptr( new QTranslator()); + // to be uncommented after translation sumission. + // QString lang = QLocale::system().name(); + QString path = "z:/resource/qt/translations/"; + mTranslator->load(path + "certificate_management_en" ); + qApp->installTranslator(mTranslator); + } + +CpCertPluginLoader::~CpCertPluginLoader() + { + if (mTranslator) + { + if (mTranslator->isEmpty() == false) + qApp->removeTranslator(mTranslator); + delete mTranslator; + } + } + +CpSettingFormItemData *CpCertPluginLoader::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const + { + return new CpSettingFormEntryItemDataImpl( + itemDataHelper,tr("Advanced Security"), QString()); + } + +Q_EXPORT_PLUGIN2(cpcertpluginloader, CpCertPluginLoader); diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/src/cpcerttrustview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/src/cpcerttrustview.cpp Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,361 @@ +/* +* Copyright (c) 2010 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: Implementation of class CCertManUIContainerTrust. +* Maintains correct list of trusted clients depending +* on the certificate that was in focus in Authority +* certificates view when Trust Settings view was entered. +* Shows and changes correct Yes/No text for the Trusted client. +* +*/ + +// INCLUDE FILES +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include "cpcerttrustview.h" +#include "cpcertdatacontainer.h" +#include "cpcertmanuisyncwrapper.h" +#include "cpuitrustids.h" + +const TInt KMidpCertStoreUid = 0x101F5B71; + +// ============================= LOCAL FUNCTIONS =============================== + +// ================= MEMBER FUNCTIONS ======================= + +CpCertTrustView::CpCertTrustView( TInt certificateIndex, CpCertDataContainer& certDataContainer, QGraphicsItem *parent /*= 0*/) + : CpBaseSettingView(0,parent), mCertDataContainer(certDataContainer), mCertificateIndex(certificateIndex) + { + setTitle(tr("Trust Settings")); + viewTrustSettings(); + } + +// --------------------------------------------------------- +// CpCertTrustView::~CpCertTrustView() +// Destructor +// --------------------------------------------------------- +// +CpCertTrustView::~CpCertTrustView() + { + delete mAppInfoManager; + mClientUids.Close(); + delete mFormModel; + mTrustedClients.erase(mTrustedClients.begin(), mTrustedClients.end()); + mTrustValues.erase(mTrustValues.begin(), mTrustValues.end()); + } + + +void CpCertTrustView::viewTrustSettings() + { + mTrustedClients << " \tWAP connection\t\t"; + mTrustedClients << " \tMail and Image conn.\t\t"; + mTrustedClients << " \tNative installing\t\t"; + mTrustedClients << " \tJava installing\t\t"; + mTrustedClients << " \tOCSP validation\t\t"; + mTrustedClients << " \tVPN\t\t"; + mTrustedClients << " \tWidget Installation\t\t"; + + mTrustValues << "On"; + mTrustValues << "Off"; + + try + { + QT_TRAP_THROWING( mAppInfoManager = + CCertificateAppInfoManager::NewL( mCertDataContainer.iRfs, EFalse ); + updateListBoxL();) + } + catch(std::exception& exception) + { + QString error(exception.what()); + QT_TRAP_THROWING( mCertDataContainer.ShowErrorNoteL( error.toInt()) ); + throw(exception); + } + } + + +// --------------------------------------------------------------------------- +// CpCertTrustView::UpdateListBoxL() +// Puts correct Trust Settings text to listbox and correct value (yes/no) +// to the setting, asks the value from CheckCertificateClientTrust +// For X509 certificates, only one Application is currently supported +// (Application controller), more applications maybe added later however, +// so one additional application has been left in comments as an example. +// WAP connection and Application installer have their names from resources +// and thus localized, other additional application get their names from +// TCertificateAppInfo's Name() function. +// --------------------------------------------------------------------------- +// +void CpCertTrustView::updateListBoxL() + { + mClientUids.Reset(); + + TInt clientCount = 0; + + // Use certificate index from previous view + CCTCertInfo* entry = mCertDataContainer.iCALabelEntries[ mCertificateIndex ]->iCAEntry; + + // Here MCTCertApps should be used to get client options, but it is not properly + // supported in any cert store. It should be possible to get the MCTCertApps + // through token's GetInterface function. + if ( entry->Token().TokenType().Type() == TUid::Uid( KTokenTypeFileCertstore ) ) + { + if ( !mAppInfoManager ) + { + User::Leave( KErrArgument ); + } + RArray apps; + apps = mAppInfoManager->Applications(); + for ( TInt i = 0; i < apps.Count(); i++ ) + { + if ( apps[i].Id() != KCertManUIViewTrustJavaInstallingId && + apps[i].Id() != KCertManUIViewTrustApplicationControllerId ) + { + mClientUids.Append( apps[i].Id() ); + } + } + } + else + { + mCertDataContainer.iWrapper->GetApplicationsL( + mCertDataContainer.CertManager(), *entry, mClientUids ); + } + + // This is needed because MIDPCertStore does not support MCTCertApps + if ( mClientUids.Count() == 0 && + entry->Token().TokenType().Type() == TUid::Uid( KMidpCertStoreUid ) ) + { + mClientUids.Append( KCertManUIViewTrustJavaInstallingId ); + } + + clientCount = mClientUids.Count(); + + QList itemArray; + for(int i=0;iCertificateFormat() ) + { + return; + } + TInt resIndex = KErrNotFound; + if ( mClientUids.Count() > 0 ) + { + for ( TInt k = 0; k < clientCount; k++ ) + { + resIndex = trustIdIndex( mClientUids[k] ); + if ( resIndex == KErrNotFound ) + { + continue; + } + + // based on the trust list update the array + TBool trustState = EFalse; + QString item = mTrustedClients[ resIndex ]; + trustState = checkCertificateClientTrustL( mClientUids[k], *entry ); + if ( trustState ) + { + itemArray.replace(resIndex,1); + } + } + } + // display the list + QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical); + setLayout(layout); + std::auto_ptr form(new HbDataForm()); + mFormModel = new HbDataFormModel(); + + HbListWidget* mCertLabelList = new HbListWidget(this); + std::auto_ptr certLabel(q_check_ptr(new HbListWidgetItem())); + const TDesC& label = entry->Label(); + certLabel->setText(QString( (QChar*)label.Ptr(),label.Length() ) ); + mCertLabelList->addItem(certLabel.get()); + certLabel.release(); + + int count = mTrustedClients.size(); + for( int index = 0 ;index < count; ++index) + { + std::auto_ptr item (q_check_ptr(new HbDataFormModelItem( + HbDataFormModelItem::ToggleValueItem, + mTrustedClients[index] ) )); + + if( itemArray[index] == 1) + { + item->setContentWidgetData("text",mTrustValues[0]); + item->setContentWidgetData("additionalText",mTrustValues[1]); + } + else + { + item->setContentWidgetData("text",mTrustValues[1]); + item->setContentWidgetData("additionalText",mTrustValues[0]); + } + mFormModel->appendDataFormItem(item.get()); + item.release(); + } + + form->setModel(mFormModel); + layout->addItem(mCertLabelList); + layout->addItem(form.get()); + form.release(); + } + +void CpCertTrustView::saveTrustSettings() + { + CCTCertInfo& entry = *( mCertDataContainer.iCALabelEntries[ mCertificateIndex ]->iCAEntry ); + if ( entry.IsDeletable() ) + { + TInt itemCount = mFormModel->rowCount(); + RArray newUids; + QT_TRAP_THROWING( CleanupClosePushL( newUids )); + + for(int index = 0;indexitem(index); + QString trustValue = item->contentWidgetData("text").toString(); + if(trustValue == "On") + { + newUids.Append(trusterId(mTrustedClients[index])); + } + } + QT_TRAP_THROWING( mCertDataContainer.iWrapper->SetApplicabilityL( mCertDataContainer.CertManager(), entry, newUids )); + CleanupStack::PopAndDestroy(&newUids); + } + } + +TUid CpCertTrustView::trusterId(const QString& clientDescription) const + { + TUid retValue = TUid::Uid(0); + if( clientDescription == " \tWAP connection\t\t" ) + retValue = KCertManUIViewTrustWapConnectionId; + else if( clientDescription == " \tMail and Image conn.\t\t" ) + retValue = KCertManUIViewTrustMailAndImageConnId; + else if( clientDescription == " \tNative installing\t\t" ) + retValue = KCertManUIViewTrustApplicationControllerId; + else if( clientDescription == " \tJava installing\t\t" ) + retValue = KCertManUIViewTrustJavaInstallingId; + else if( clientDescription == " \tOCSP validation\t\t" ) + retValue = KCertManUIViewOCSPCheckInstallingId; + else if( clientDescription == " \tVPN\t\t" ) + retValue = KCertManUIViewTrustVPNId; + else if( clientDescription == " \tWidget Installation\t\t" ) + retValue = KCertManUIViewTrustWidgetInstallId; + return retValue; + } + +// --------------------------------------------------------------------------- +// CpCertTrustView::trustIdIndex( TUid trustUid ) +// --------------------------------------------------------------------------- +// +TInt CpCertTrustView::trustIdIndex( TUid trustUid ) const + { + TInt resIndex = KErrNotFound; + + if ( trustUid == KCertManUIViewTrustApplicationControllerId ) + { + resIndex = KTrustSettingsResourceIndexAppCtrl; + } + else if( trustUid == KCertManUIViewTrustWapConnectionId ) + { + resIndex = KTrustSettingsResourceIndexWAP; + } + else if ( trustUid == KCertManUIViewTrustMailAndImageConnId ) + { + resIndex = KTrustSettingsResourceIndexMailAndImageConn; + } + else if ( trustUid == KCertManUIViewTrustJavaInstallingId ) + { + resIndex = KTrustSettingsResourceIndexJavaInstall; + } + else if ( trustUid == KCertManUIViewOCSPCheckInstallingId ) + { + resIndex = KTrustSettingsResourceIndexOCSPCheck; + } + else if ( trustUid == KCertManUIViewTrustVPNId ) + { + resIndex = KTrustSettingsResourceIndexVPN; + } + else if ( trustUid == KCertManUIViewTrustWidgetInstallId ) + { + resIndex = KTrustSettingsResourceIndexWidget; + } + return resIndex; + } + + +// --------------------------------------------------------------------------- +// CpCertTrustView::CheckCertificateClientTrustL(const TUid aClientTUid, +// CCTCertInfo& aEntry) const +// Checks if a certificate trusts a client +// * Certificate format == ECrX509Certificate ECrX968Certificate ECrCertificateURL +// are not supported if certificate location == ECrCertLocationWIMCard +// * Certificate format == ECrX968Certificate ECrCertificateURL are not supported +// if certificate location == ECrCertLocationCertMan +// * Certificate location == ECrCertLocationWIMURL ECrCertLocationPhoneMemory +// ECrCertLocationPhoneMemoryURL are not supported +// --------------------------------------------------------------------------- +// +TBool CpCertTrustView::checkCertificateClientTrustL( + const TUid clientUid, const CCTCertInfo& entry ) const + { + TBool trustSettingTrusted = EFalse; + TCertificateFormat format = entry.CertificateFormat(); + + if ( format == EX509Certificate ) + { + + RArray trusterUids; + CleanupClosePushL( trusterUids ); + + //Owned by mCertDataContainer. + CUnifiedCertStore*& store = mCertDataContainer.CertManager(); + // Get trusting applications' Uids for the one selected + // certificate entry + mCertDataContainer.iWrapper->GetApplicationsL( store, entry, trusterUids ); + + // get the number of trusting applications for one + // selected certificate entry + TInt trusterCount = trusterUids.Count(); + // in this loop, for every trusting application in one + // selected certificate entry + for ( TInt i = 0; i < trusterCount; ++i ) + { + // put the trusting application's Uid to TUid truster + if ( clientUid == trusterUids[i] ) + { + trustSettingTrusted = ETrue; + break; + } + } + CleanupStack::PopAndDestroy(&trusterUids); + } + + return trustSettingTrusted; + } + +// End of File + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/src/cpcertview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/src/cpcertview.cpp Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,832 @@ +/* +* Copyright (c) 2010 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: +* +*/ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "cpcertdetailview.h" +#include "cpcertview.h" +#include "cpcertdatacontainer.h" +#include "cpcerttrustview.h" +#include "cpcertmanuisyncwrapper.h" + + +CpCertView::CpCertView(const QModelIndex& modelIndex, QGraphicsItem *parent /*= 0*/) + : CpBaseSettingView(0,parent), + mPrevView(NULL), + mCurrentView(NULL), + mRefreshedView(NULL), + mListView(NULL), + mOriginalView(NULL) + { + + mOriginalView = mainWindow()->currentView(); + + HbMenu* menu = this->menu(); + std::auto_ptr deleteAction(new HbAction(hbTrId("txt_common_menu_delete"))); + connect(deleteAction.get(), SIGNAL(triggered()), this, SLOT(deleteList())); + menu->addAction(deleteAction.get()); + deleteAction.release(); + + std::auto_ptr layout(new QGraphicsLinearLayout(Qt::Vertical)); + + HbDataForm *form = q_check_ptr(new HbDataForm(this)); + std::auto_ptr formModel(q_check_ptr(new HbDataFormModel())); + form->setModel(formModel.get()); + formModel.release(); + + HbListWidget* certificateList = q_check_ptr(new HbListWidget(this)); + + CpCertView::TCertificateViews currentView = (CpCertView::TCertificateViews)modelIndex.row(); + QString title; + if(currentView == EPersonalView) + { + title = "Move to Device"; + } + else if(currentView == EDeviceView) + { + title = "Move to Personal"; + } + std::auto_ptr moveToDeviceAction(q_check_ptr(new HbAction(title))); + connect(moveToDeviceAction.get(), SIGNAL(triggered()), this, SLOT(moveCert())); + menu->addAction(moveToDeviceAction.get()); + moveToDeviceAction.release(); + + setDetails(currentView); + TInt count = 0; + try + { + QT_TRAP_THROWING(mCertDataContainer = CpCertDataContainer::NewL()); + QT_TRAP_THROWING(count = refreshListL()); + } + catch(const std::exception& exception) + { + HbMessageBox::information(exception.what()); + throw(exception); + } + + for(int index = 0; index< count; index++) + { + QString certificateLabel = certLabel(index); + std::auto_ptr singleCert(q_check_ptr(new HbListWidgetItem())); + singleCert->setText(certificateLabel); + certificateList->addItem(singleCert.get()); + singleCert.release(); + } // End of FOR loop + + connect(certificateList, SIGNAL(activated(QModelIndex)), this, SLOT(openCertFromList(QModelIndex))); + connect(certificateList, SIGNAL(longPressed(HbAbstractViewItem*, QPointF )), this, SLOT(indicateLongPress(HbAbstractViewItem*, QPointF))); + + layout->addItem(certificateList); + setLayout(layout.get()); + layout.release(); + } + +CpCertView::~CpCertView() + { + delete mCertDataContainer; + mCertDataContainer = NULL; + + if(mPrevView) + { + mPrevView->deleteLater(); + mPrevView= NULL; + } + if(mCurrentView) + { + mCurrentView->deleteLater(); + mCurrentView= NULL; + } + if(mRefreshedView) + { + mRefreshedView->deleteLater(); + mRefreshedView= NULL; + } + if(mListView) + { + mListView->deleteLater(); + mListView= NULL; + } + } + +void CpCertView::setDetails(CpCertView::TCertificateViews currentView) + { + switch(currentView) + { + case EAuthorityView: + setTitle(hbTrId("txt_certificate_manager_list_authority_certificate")); + mCertView = EAuthorityView; + break; + + case ETrustedView: + setTitle(hbTrId("txt_certificate_manager_list_trusted_site_certific")); + mCertView = ETrustedView; + break; + + case EPersonalView: + setTitle(hbTrId("txt_certificate_manager_list_personal_certificates")); + mCertView = EPersonalView; + break; + + case EDeviceView: + setTitle(hbTrId("txt_certificate_manager_list_device_certificates")); + mCertView = EDeviceView; + break; + } + } + +void CpCertView::indicateLongPress(HbAbstractViewItem *item,QPointF coords) + { + std::auto_ptr contextMenu(q_check_ptr(new HbMenu())); + mPos = item->modelIndex().row(); // Pos will tell you what is the certificate clicked in particular view. + + std::auto_ptr open(q_check_ptr(new HbAction(hbTrId("txt_common_menu_open")))); + connect(open.get(), SIGNAL(triggered()), this, SLOT( openCertificate())); + contextMenu->addAction(open.get()); + open.release(); + + QString moveTitle; + + if(mCertView == EAuthorityView) + { + std::auto_ptr trustSettings(q_check_ptr(new HbAction(hbTrId("txt_certificate_manager_menu_trust_settings")))); + connect(trustSettings.get(), SIGNAL(triggered()), this, SLOT(showTrustSettings())); + contextMenu->addAction(trustSettings.get()); + trustSettings.release(); + } + else if(mCertView == EPersonalView) + { + moveTitle = hbTrId("txt_certificate_manager_menu_move_to_device_certif"); + } + else if(mCertView == EDeviceView) + { + moveTitle = hbTrId("txt_certificate_manager_menu_move_to_personal_cert"); + } + std::auto_ptr moveCert(q_check_ptr(new HbAction(moveTitle))); + connect(moveCert.get(), SIGNAL(triggered()), this, SLOT(moveSelectedCert())); + contextMenu->addAction(moveCert.get()); + moveCert.release(); + + if( certAt(mPos)->IsDeletable() ) + { + std::auto_ptr menuDelete(q_check_ptr(new HbAction(hbTrId("txt_common_menu_delete")))); + connect(menuDelete.get(), SIGNAL(triggered()), this, SLOT(deleteCertificate())); + contextMenu->addAction(menuDelete.get()); + menuDelete.release(); + } + contextMenu->open(); + contextMenu->setPreferredPos(coords); + } + +void CpCertView::openCertFromList(const QModelIndex& modelIndex) + { + // Pos will tell you what is the certificate clicked in particular view. + mPos = modelIndex.row(); + openCertificate(); + } + +void CpCertView::openCertificate() + { + mCurrentView = q_check_ptr(new CpCertDetailView(mCertView,mPos,*mCertDataContainer)); + connect(mCurrentView, SIGNAL(aboutToClose()), this, SLOT(displayPreviousView())); + mPrevView = mainWindow()->currentView(); + mainWindow()->addView(mCurrentView); + mainWindow()->setCurrentView(mCurrentView); + } + +void CpCertView::displayPreviousView() + { + mainWindow()->removeView(mCurrentView); + mCurrentView->deleteLater(); + mCurrentView= NULL; + mainWindow()->setCurrentView(mPrevView); + } + +void CpCertView::deleteCertificate() + { + RArray pos; + pos.Append(mPos); + QT_TRAP_THROWING(deleteCerts(pos)); + } + +void CpCertView::deleteList() + { + mSelectAll = EFalse; + HbDialog popup; + popup.setDismissPolicy(HbDialog::NoDismiss); + // Set the label as heading widget + popup.setHeadingWidget(q_check_ptr(new HbLabel(hbTrId("txt_certificate_manager_setlabel_certificates")))); + + std::auto_ptr layout(q_check_ptr(new QGraphicsLinearLayout(Qt::Vertical))); + + HbListView* selectAllView = q_check_ptr(new HbListView(this)); + QStandardItemModel* selectAllModel = q_check_ptr(new QStandardItemModel(this)); + // Populate the model with content + std::auto_ptr selectAllItem(q_check_ptr(new QStandardItem())); + selectAllItem->setData(QString("Select All"),Qt::DisplayRole); + selectAllModel->appendRow(selectAllItem.get()); + selectAllItem.release(); + + connect(selectAllView, SIGNAL(activated(QModelIndex)), this, SLOT(selectAll())); + selectAllView->setModel(selectAllModel); + selectAllView->setSelectionMode(HbListView::MultiSelection); + layout->addItem(selectAllView); + + mListView = q_check_ptr(new HbListView(this)); + // Connect to "activated" signal + connect(mListView, SIGNAL(activated(QModelIndex)), this, SLOT(itemActivated(QModelIndex))); + + // Create a model + QStandardItemModel* model = q_check_ptr(new QStandardItemModel(this)); + TInt count=0; + QT_TRAP_THROWING( count = refreshListL()); + RArray selectionIndex; + QT_TRAP_THROWING(CleanupClosePushL(selectionIndex)); + + for(TInt index = 0; index < count ; ++index) + { + const CCTCertInfo* cert = certAt(index); + if( cert->IsDeletable() ) + { + // Populate the model with content + std::auto_ptr certItem(q_check_ptr(new QStandardItem())); + QString certificateLabel = certLabel(index); + certItem->setData( certificateLabel, Qt::DisplayRole); + model->appendRow(certItem.get()); + selectionIndex.Append(index); + certItem.release(); + } + } + // Set the model to the list view + mListView->setModel(model); + mListView->setSelectionMode(HbListView::MultiSelection); + layout->addItem(mListView); + + std::auto_ptr widget( q_check_ptr(new HbWidget())); + widget->setLayout(layout.get()); + layout.release(); + popup.setContentWidget(widget.get()); + widget.release(); + + popup.setPrimaryAction(q_check_ptr(new HbAction(hbTrId("txt_common_opt_delete")))); + popup.setSecondaryAction(q_check_ptr(new HbAction(hbTrId("txt_common_button_cancel")))); + popup.setTimeout(HbPopup::NoTimeout); + + // Launch popup syncronously + HbAction* result = popup.exec(); + if(result == popup.primaryAction()) + { + QItemSelectionModel *selectionModel = mListView->selectionModel(); + QModelIndexList mWidgetItemsToRemove = selectionModel->selectedIndexes(); + TInt deleteCount = mWidgetItemsToRemove.count(); + // start deleting from end of array so that the indexes do not changes of the ones + // at the front. + RArray actualIndex; + QT_TRAP_THROWING(CleanupClosePushL(actualIndex)); + for (TInt index = deleteCount-1; index>= 0 ; --index) + { + TInt selectedItemIndex = mWidgetItemsToRemove[index].row(); + actualIndex.Append( selectionIndex[selectedItemIndex] ); + } + deleteCerts(actualIndex); + CleanupStack::PopAndDestroy(&actualIndex); + } + CleanupStack::PopAndDestroy(&selectionIndex); + mListView->deleteLater(); + mListView = NULL; + selectAllView->deleteLater(); + selectAllView = NULL; + } + +void CpCertView::moveCert() + { + mSelectAll = EFalse; + HbDialog popup; + popup.setDismissPolicy(HbDialog::NoDismiss); + // Set the label as heading widget + if(mCertView == EPersonalView) + { + popup.setHeadingWidget(q_check_ptr(new HbLabel(tr("Move To Device")))); + } + else if(mCertView == EDeviceView) + { + popup.setHeadingWidget(q_check_ptr(new HbLabel(tr("Move To Personal")))); + } + + std::auto_ptr layout(q_check_ptr(new QGraphicsLinearLayout(Qt::Vertical))); + + HbListView* selectAllView = q_check_ptr(new HbListView(this)); + QStandardItemModel* selectAllModel = q_check_ptr(new QStandardItemModel(this)); + // Populate the model with content + std::auto_ptr selectAllItem(q_check_ptr(new QStandardItem())); + selectAllItem->setData(QString("Select All"),Qt::DisplayRole); + selectAllModel->appendRow(selectAllItem.get()); + selectAllItem.release(); + connect(selectAllView, SIGNAL(activated(QModelIndex)), this, SLOT(selectAll())); + selectAllView->setModel(selectAllModel); + selectAllView->setSelectionMode(HbListView::MultiSelection); + layout->addItem(selectAllView); + + mListView = q_check_ptr(new HbListView(this)); + // Connect to "activated" signal + connect(mListView, SIGNAL(activated(QModelIndex)), this, SLOT(itemActivated(QModelIndex))); + + // Create a model + QStandardItemModel* model = q_check_ptr(new QStandardItemModel(this)); + TInt count =0; + QT_TRAP_THROWING(count = refreshListL()); + RArray selectionIndex; + QT_TRAP_THROWING(CleanupClosePushL(selectionIndex)); + for(TInt index = 0; index < count ; ++index) + { + // Populate the model with content + std::auto_ptr certItem(q_check_ptr(new QStandardItem())); + QString certificateLabel = certLabel(index); + certItem->setData( certificateLabel, Qt::DisplayRole); + model->appendRow(certItem.get()); + selectionIndex.Append(index); + certItem.release(); + } + + // Set the model to the list view + mListView->setModel(model); + mListView->setSelectionMode(HbListView::MultiSelection); + layout->addItem(mListView); + + std::auto_ptr widget(q_check_ptr(new HbWidget())); + widget->setLayout(layout.get()); + layout.release(); + popup.setContentWidget(widget.get()); + widget.release(); + + popup.setPrimaryAction(q_check_ptr(new HbAction(tr("Yes"),&popup))); + popup.setSecondaryAction(q_check_ptr(new HbAction(tr("No"),&popup))); + popup.setTimeout(HbPopup::NoTimeout); + + // Launch popup syncronously + HbAction* result = popup.exec(); + if(result == popup.primaryAction()) + { + QItemSelectionModel *selectionModel = mListView->selectionModel(); + QModelIndexList mWidgetItemsToRemove = selectionModel->selectedIndexes(); + TInt deleteCount = mWidgetItemsToRemove.count(); + // start deleting from end of array so that the indexes do not changes of the ones + // at the front. + RArray actualIndex; + QT_TRAP_THROWING(CleanupClosePushL(actualIndex)); + for (TInt index = deleteCount-1; index>= 0 ; --index) + { + TInt selectedItemIndex = mWidgetItemsToRemove[index].row(); + actualIndex.Append(selectionIndex[selectedItemIndex]); + } + moveCertList(actualIndex); + CleanupStack::PopAndDestroy(&actualIndex); + } + CleanupStack::PopAndDestroy(&selectionIndex); + mListView->deleteLater(); + mListView = NULL; + selectAllView->deleteLater(); + selectAllView = NULL; + } + +void CpCertView::selectAll() + { + if(mSelectAll == EFalse) + { + mListView->selectAll(); + mSelectAll= ETrue; + } + else + { + mListView->clearSelection(); + mSelectAll= EFalse; + } + } + +void CpCertView::deleteCerts( RArray& indexList ) + { + TInt count = indexList.Count(); + + HbMessageBox note(HbMessageBox::MessageTypeQuestion); + QString deleteMsg; + QString sCount; + if(count == 1) + { + deleteMsg = "Delete %1?"; + const CCTCertInfo* entry = certAt(indexList[0]); + sCount = QString((QChar*)entry->Label().Ptr(),entry->Label().Length()); + } + else + { + deleteMsg = "Delete %1 items?"; + sCount.setNum(count); + } + + deleteMsg = deleteMsg.arg(sCount); + note.setText(deleteMsg); + note.setPrimaryAction(q_check_ptr(new HbAction("Yes"))); + note.setSecondaryAction(q_check_ptr(new HbAction("No"))); + note.setTimeout(HbPopup::NoTimeout); + HbAction* result = note.exec(); + + if (result != note.primaryAction() || count == 0 ) + { + return; + } + + RPointerArray errCerts; + QT_TRAP_THROWING(CleanupClosePushL(errCerts)); + + for(TInt index = 0; index < count; ++index) + { + const CCTCertInfo* entry = certAt(indexList[index]); + + if( mCertView == EPersonalView || mCertView == EAuthorityView ) + { + QT_TRAP_THROWING( mCertDataContainer->iWrapper->DeleteCertL( + mCertDataContainer->CertManager(), *entry )); + } + else if( mCertView == ETrustedView ) + { + QT_TRAP_THROWING( mCertDataContainer->iWrapper->DeleteCertL( + mCertDataContainer->CertManager(),*entry, KCMTrustedServerTokenUid )); + } + else if( mCertView == EDeviceView ) + { + QT_TRAP_THROWING( mCertDataContainer->iWrapper->DeleteCertL( + mCertDataContainer->CertManager(), *entry, KCMDeviceCertStoreTokenUid )); + } + QT_TRAP_THROWING( errCerts.AppendL(entry)); + } + + if(errCerts.Count() > 0) + { + QString message("Unable to delete the following certificate: \n"); + TInt count = errCerts.Count(); + for(TInt index=0;indexLabel(); + QString certName = QString((QChar*)certLabel.Ptr(),certLabel.Length()); + message.append(certName).append("\n"); + } + HbMessageBox::warning(message); + } + QT_TRAP_THROWING( count = refreshListL()); + refreshView(count); + + CleanupStack::PopAndDestroy(&errCerts); + + } + +const CCTCertInfo* CpCertView::certAt(TInt index) const + { + CCTCertInfo* currentCert = NULL; + switch(mCertView) + { + case EAuthorityView: + { + currentCert = mCertDataContainer->iCALabelEntries[ index ]->iCAEntry; + break; + } + case ETrustedView: + { + currentCert = mCertDataContainer->iPeerLabelEntries[ index ]->iPeerEntry; + break; + } + case EDeviceView: + { + currentCert = mCertDataContainer->iDeviceLabelEntries[ index ]->iDeviceEntry; + break; + } + case EPersonalView: + { + currentCert = mCertDataContainer->iUserLabelEntries[ index ]->iUserEntry; + break; + } + }; + return currentCert; + } + +QString CpCertView::certLabel(TInt index) const + { + CpCertManUICertData* certData = NULL; + HBufC* label = NULL; + TInt length = 0; + switch(mCertView) + { + case EAuthorityView: + { + certData = mCertDataContainer->iCALabelEntries[index]; + label = certData->iCAEntryLabel; + length = certData->iCAEntryLabel->Length(); + break; + } + case ETrustedView: + { + certData = mCertDataContainer->iPeerLabelEntries[index]; + label = certData->iPeerEntryLabel; + length = certData->iPeerEntryLabel->Length(); + break; + } + case EPersonalView: + { + certData = mCertDataContainer->iUserLabelEntries[index]; + label = certData->iUserEntryLabel; + length = certData->iUserEntryLabel->Length(); + break; + } + case EDeviceView: + { + certData = mCertDataContainer->iDeviceLabelEntries[index]; + label = certData->iDeviceEntryLabel; + length = certData->iDeviceEntryLabel->Length(); + break; + } + } + return QString((QChar*)label->Des().Ptr(), length); + } + +TInt CpCertView::refreshListL() + { + TInt count = 0; + switch(mCertView) + { + case EAuthorityView: + mCertDataContainer->RefreshCAEntriesL(); + count = mCertDataContainer->iCALabelEntries.Count(); + break; + case ETrustedView: + mCertDataContainer->RefreshPeerCertEntriesL(); + count = mCertDataContainer->iPeerLabelEntries.Count(); + break; + case EPersonalView: + mCertDataContainer->RefreshUserCertEntriesL(); + count = mCertDataContainer->iUserLabelEntries.Count(); + break; + case EDeviceView: + mCertDataContainer->RefreshDeviceCertEntriesL(); + count = mCertDataContainer->iDeviceLabelEntries.Count(); + break; + }; + return count; + } + + +void CpCertView::refreshView( TInt count ) + { + if(mRefreshedView) + { + mRefreshedView->deleteLater(); + mRefreshedView = NULL; + } + + mRefreshedView = q_check_ptr(new CpBaseSettingView()); + switch(mCertView) + { + case EAuthorityView: + { + mRefreshedView->setTitle(hbTrId("txt_certificate_manager_list_authority_certificate")); + break; + } + case ETrustedView: + { + mRefreshedView->setTitle(hbTrId("txt_certificate_manager_list_trusted_site_certific")); + break; + } + case EPersonalView: + { + mRefreshedView->setTitle(hbTrId("txt_certificate_manager_list_personal_certificates")); + break; + } + case EDeviceView: + { + mRefreshedView->setTitle(hbTrId("txt_certificate_manager_list_device_certificates")); + break; + } + } + + HbMenu* menu = mRefreshedView->menu(); + + std::auto_ptr endAction( q_check_ptr(new HbAction(hbTrId("txt_common_opt_delete"))) ); + connect(endAction.get(), SIGNAL(triggered()), this, SLOT(deleteList())); + menu->addAction(endAction.get()); + endAction.release(); + + QString title; + if(mCertView == EPersonalView) + { + title = "Move to Device"; + } + else if(mCertView == EDeviceView) + { + title = "Move to Personal"; + } + std::auto_ptr moveAction(q_check_ptr(new HbAction(title))); + connect(moveAction.get(), SIGNAL(triggered()), this, SLOT(moveCert())); + menu->addAction(moveAction.get()); + moveAction.release(); + + std::auto_ptr layout(q_check_ptr(new QGraphicsLinearLayout(Qt::Vertical))); + + HbListWidget* mCertificateList = q_check_ptr(new HbListWidget(this)); + + for(int index = 0; index< count; index++) + { + QString certificateLabel = certLabel(index); + std::auto_ptr singleCert(q_check_ptr(new HbListWidgetItem())); + singleCert->setText(certificateLabel); + mCertificateList->addItem(singleCert.get()); + singleCert.release(); + } // end of for loop + + connect(mCertificateList, SIGNAL(activated(QModelIndex)), this, SLOT(openCertFromList(QModelIndex))); + connect(mCertificateList, SIGNAL(longPressed(HbAbstractViewItem*, QPointF )), this, SLOT(indicateLongPress(HbAbstractViewItem*, QPointF))); + + layout->addItem(mCertificateList); + + // Refresh current view + QObject::connect(mRefreshedView , SIGNAL(aboutToClose()), this, SLOT(viewDone())); + mPrevView = mainWindow()->currentView(); + mainWindow()->addView(mRefreshedView); + mainWindow()->setCurrentView(mRefreshedView); + mRefreshedView->setLayout(layout.get()); + layout.release(); + } + + +void CpCertView::viewDone() + { + mCurrentView = mainWindow()->currentView(); + mCurrentView->deleteLater(); + mCurrentView= NULL; + mainWindow()->setCurrentView(mOriginalView); + } +void CpCertView::showTrustSettings() + { + mCurrentView = q_check_ptr(new CpCertTrustView(mPos, *mCertDataContainer)); + connect(mCurrentView , SIGNAL(aboutToClose()), this, SLOT(saveTrustSettings())); + mPrevView = mainWindow()->currentView(); + mainWindow()->addView(mCurrentView); + mainWindow()->setCurrentView(mCurrentView); + } + +void CpCertView::saveTrustSettings() + { + ((CpCertTrustView*)mCurrentView)->saveTrustSettings(); + displayPreviousView(); + } + +void CpCertView::moveSelectedCert() + { + RArray pos; + pos.Append(mPos); + moveCertList(pos); + } + +void CpCertView::moveCertList(RArray& indexList) + { + HbMessageBox note(HbMessageBox::MessageTypeQuestion); + note.setHeadingWidget(q_check_ptr(new HbLabel(hbTrId("txt_certificate_manager_info_move")))); + if( mCertView == EPersonalView ) + { + note.setText(hbTrId("txt_certificate_manager_info_device_certificates_c")); + } + else if( mCertView == EDeviceView ) + { + note.setText("Use of Personal certificates may require user confirmation. Proceed?"); + } + + note.setPrimaryAction(q_check_ptr(new HbAction("Yes"))); + note.setSecondaryAction(q_check_ptr(new HbAction("No"))); + note.setTimeout(HbPopup::NoTimeout); + note.setIconVisible (EFalse); + HbAction* result = note.exec(); + + if (result != note.primaryAction()) + { + return; + } + + TInt count = indexList.Count(); + + for(TInt index = 0 ; index < count; ++index) + { + CCTCertInfo* entry = NULL; + if(mCertView == EPersonalView) + { + entry = mCertDataContainer->iUserLabelEntries[ indexList[index] ]->iUserEntry; + } + else if(mCertView == EDeviceView) + { + entry = mCertDataContainer->iDeviceLabelEntries[ indexList[index] ]->iDeviceEntry; + } + + // Move key first + TCTKeyAttributeFilter keyFilter; + keyFilter.iKeyId = entry->SubjectKeyId(); + keyFilter.iPolicyFilter = TCTKeyAttributeFilter::EAllKeys; + + TUid sourceCertStoreUid = TUid::Uid(0); + TUid targetCertStoreUid = TUid::Uid(0); + TUid sourceKeyStoreUid = TUid::Uid(0); + TUid targetKeyStoreUid = TUid::Uid(0); + + if(mCertView == EPersonalView) + { + sourceKeyStoreUid = KCMFileKeyStoreTokenUid; + targetKeyStoreUid = KCMDeviceKeyStoreTokenUid; + sourceCertStoreUid = KCMFileCertStoreTokenUid; + targetCertStoreUid = KCMDeviceCertStoreTokenUid; + } + else if(mCertView == EDeviceView) + { + sourceKeyStoreUid = KCMDeviceKeyStoreTokenUid; + targetKeyStoreUid = KCMFileKeyStoreTokenUid; + sourceCertStoreUid = KCMDeviceCertStoreTokenUid; + targetCertStoreUid = KCMFileCertStoreTokenUid; + } + try + { + + QT_TRAP_THROWING( mCertDataContainer->iWrapper->MoveKeyL( + mCertDataContainer->KeyManager(), keyFilter, sourceKeyStoreUid, targetKeyStoreUid )); + + // Move certificate + QT_TRAP_THROWING( mCertDataContainer->iWrapper->MoveCertL( + mCertDataContainer->CertManager(), *entry, sourceCertStoreUid, targetCertStoreUid ) ); + + } + catch(const std::exception& exception) + { + QString error(exception.what()); + QT_TRAP_THROWING(mCertDataContainer->ShowErrorNoteL( error.toInt() )); + User::Exit( KErrNone ); + } + + try + { + if(mCertView == EPersonalView) + { + QT_TRAP_THROWING( mCertDataContainer->RefreshUserCertEntriesL() ); + } + else if(mCertView == EDeviceView) + { + QT_TRAP_THROWING( mCertDataContainer->RefreshDeviceCertEntriesL() ); + } + } + catch(const std::exception& exception) + { + QString error(exception.what()); + if ( error.toInt() == KErrCorrupt ) + { + QT_TRAP_THROWING(mCertDataContainer->ShowErrorNoteL( error.toInt()) ); + User::Exit( KErrNone ); + } + // have to call straight away the Exit + // showing any error notes would corrupt the display + User::Exit( error.toInt() ); + } + } // for + // Refresh current view + QT_TRAP_THROWING(refreshView(refreshListL())); + } + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/src/cpmoduleview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/src/cpmoduleview.cpp Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,352 @@ +/* +* Copyright (c) 2010 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: +* +*/ + +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "cpmoduleview.h" +#include "cpsecmodmodel.h" +#include "cpsecmodview.h" + +CpModuleView::CpModuleView( CpSecModView::TSecModViews currentView, + CSecModUIModel& secModUIModel, + QGraphicsItem *parent /*= 0*/ ) +: CpBaseSettingView(0,parent), + mCurrentView(currentView), + mSecModUIModel(secModUIModel) + { + QString title = mSecModUIModel.TokenLabelForTitle(); + setTitle(title); + + if(currentView == CpSecModView::EAccessView) + { + showAccessView(); + } + else if(currentView == CpSecModView::ESignatureView) + { + showSignatureView(ETrue); + } + } + +CpModuleView::~CpModuleView() + {} + +void CpModuleView::showAccessView() + { + HbMenu* menu = this->menu(); + std::auto_ptr endAction(q_check_ptr(new HbAction("Module Info"))); + connect(endAction.get(), SIGNAL(triggered()), this, SLOT(saveProv())); + + menu->addAction(endAction.get()); + endAction.release(); + + std::auto_ptr layout(q_check_ptr(new QGraphicsLinearLayout(Qt::Vertical))); + + std::auto_ptr form(q_check_ptr(new HbDataForm())); + std::auto_ptr formModel(q_check_ptr(new HbDataFormModel())); + form->setModel(formModel.get()); + formModel.release(); + + QString titleName; + if (mSecModUIModel.KeyStoreUID() == KTokenTypeFileKeystore) + { + titleName = "Phone key store code"; + } + else + { + const TDesC& label = mSecModUIModel.AuthObj(KPinGSettIndex).Label(); + titleName = QString((QChar*)label.Ptr(), label.Length()); + } + + HbListWidget* accessDetails = q_check_ptr(new HbListWidget(this)); + + std::auto_ptr codeLabel(q_check_ptr(new HbListWidgetItem())); + codeLabel->setText(titleName); + accessDetails->addItem(codeLabel.get()); + codeLabel.release(); + + std::auto_ptr codeText(q_check_ptr(new HbListWidgetItem())); + codeText->setText("****"); + accessDetails->addItem(codeText.get()); + codeText.release(); + + std::auto_ptr requestLabel(q_check_ptr(new HbListWidgetItem())); + requestLabel->setText("Access Code Request"); + accessDetails->addItem(requestLabel.get()); + requestLabel.release(); + + TUint32 status = mSecModUIModel.AuthStatus(KPinGSettIndex); + std::auto_ptr requestText(q_check_ptr(new HbListWidgetItem())); + requestText->setText("Off"); + if (status & EEnabled) + { + requestText->setText("On"); + } + accessDetails->addItem(requestText.get()); + requestText.release(); + + std::auto_ptr statusLabel(q_check_ptr(new HbListWidgetItem())); + statusLabel->setText("Status"); + accessDetails->addItem(statusLabel.get()); + statusLabel.release(); + + std::auto_ptr statusText(q_check_ptr(new HbListWidgetItem())); + QString pinStatus = mSecModUIModel.PINStatus(KPinGSettIndex, ETrue); + statusText->setText(pinStatus); + accessDetails->addItem(statusText.get()); + statusText.release(); + + connect(accessDetails, SIGNAL(longPressed(HbAbstractViewItem*, QPointF )), this, SLOT(indicateLongPress(HbAbstractViewItem*, QPointF))); + connect(formModel.get(), SIGNAL(activated(QModelIndex)), this, SLOT(handleAccessView(QModelIndex))); + + layout->addItem(accessDetails); + layout->addItem(form.get()); + form.release(); + setLayout(layout.get()); + layout.release(); + } + +void CpModuleView::showSignatureView(TBool showBlockedNote) + { + mCurrentView = CpSecModView::ESignatureView; + std::auto_ptr layout(q_check_ptr(new QGraphicsLinearLayout(Qt::Vertical))); + std::auto_ptr form(q_check_ptr(new HbDataForm())); + std::auto_ptr formModel(q_check_ptr(new HbDataFormModel())); + + QVector< QPair > authDetails = mSecModUIModel.AuthDetails(); + QVectorIterator< QPair > authDetailsIter(authDetails); + + HbListWidget* accessDetails = q_check_ptr(new HbListWidget(this)); + + while(authDetailsIter.hasNext()) + { + authDetailsIter.next(); + QPair pair; + QString label = pair.first; + TUint32 status = pair.second; + QString blockedDetails = NULL; + if ( status & EAuthObjectBlocked) + { + if (showBlockedNote) + { + QString totalBlocked(" is blocked. PUK code is needed to unblock the code"); + if (status & EUnblockDisabled) + { + totalBlocked = " totalblocked, contact your module vendor."; + } + totalBlocked.prepend(label); + HbMessageBox::information(totalBlocked); + } + blockedDetails = label.append(" Blocked"); + + std::auto_ptr statusLabel(q_check_ptr(new HbListWidgetItem())); + statusLabel->setText(tr("Status")); + accessDetails->addItem(statusLabel.get()); + statusLabel.release(); + + std::auto_ptr statusText(q_check_ptr(new HbListWidgetItem())); + QString pinStatus = mSecModUIModel.PINStatus(KPinNrSettIndex, ETrue); + statusText->setText(pinStatus); + accessDetails->addItem(statusText.get()); + statusText.release(); + } + else + { + std::auto_ptr unblockedLabel(q_check_ptr(new HbListWidgetItem())); + unblockedLabel->setText(label); + accessDetails->addItem(unblockedLabel.get()); + unblockedLabel.release(); + + std::auto_ptr unblockedText(q_check_ptr(new HbListWidgetItem())); + unblockedText->setText("****"); + accessDetails->addItem(unblockedText.get()); + unblockedText.release(); + } + } + form->setModel(formModel.get()); + formModel.release(); + layout->addItem(accessDetails); + + connect(accessDetails, SIGNAL(longPressed(HbAbstractViewItem*, QPointF )), this, SLOT(indicateLongPress(HbAbstractViewItem*, QPointF))); + connect(formModel.get(), SIGNAL(activated(QModelIndex)), this, SLOT(handleSigView())); + + layout->addItem(form.get()); + form.release(); + setLayout(layout.get()); + layout.release(); + } + +void CpModuleView::indicateLongPress(HbAbstractViewItem *item,QPointF coords) + { + try + { + std::auto_ptr contextMenu(q_check_ptr(new HbMenu())); + mPos = item->modelIndex().row(); + + if(mCurrentView == CpSecModView::EAccessView) + { + if( mPos == EIndexCodeLabel && mSecModUIModel.PinChangeable(KPinGSettIndex) + || mPos == EIndexCodeRequest && mSecModUIModel.PinRequestChangeable(KPinGSettIndex) + || mPos == EIndexCodeStatus ) + { + std::auto_ptr changePIN(q_check_ptr(new HbAction("Change"))); + connect(changePIN.get(), SIGNAL(triggered()), this, SLOT( handleAccessView())); + contextMenu->addAction(changePIN.get()); + changePIN.release(); + } + if( mSecModUIModel.PinUnblockable(KPinGSettIndex) ) + { + std::auto_ptr unblockPIN(q_check_ptr(new HbAction("Unblock"))); + connect(unblockPIN.get(), SIGNAL(triggered()), this, SLOT( handleAccessView())); + contextMenu->addAction(unblockPIN.get()); + unblockPIN.release(); + } + if( mSecModUIModel.PinOpen(KPinGSettIndex) ) + { + std::auto_ptr closePIN(q_check_ptr(new HbAction("Close"))); + connect(closePIN.get(), SIGNAL(triggered()), this, SLOT( handleAccessView())); + contextMenu->addAction(closePIN.get()); + closePIN.release(); + } + } + else if(mCurrentView == CpSecModView::ESignatureView) + { + if (mSecModUIModel.PinChangeable(KPinNrSettIndex)) + { + std::auto_ptr changePIN(q_check_ptr(new HbAction("Change"))); + connect(changePIN.get(), SIGNAL(triggered()), this, SLOT( handleSigViewCommand())); + contextMenu->addAction(changePIN.get()); + changePIN.release(); + } + if (mSecModUIModel.PinUnblockable(KPinNrSettIndex)) + { + std::auto_ptr unblockPIN(q_check_ptr(new HbAction("Unblock"))); + connect(unblockPIN.get(), SIGNAL(triggered()), this, SLOT( handleSigViewCommand())); + contextMenu->addAction(unblockPIN.get()); + unblockPIN.release(); + } + } + + contextMenu->open(); + contextMenu->setPreferredPos(coords); + } + catch(const std::exception& exception) + { + HbMessageBox::information(exception.what()); + } + } + +void CpModuleView::handleAccessView( const QModelIndex& modelIndex ) + { + try + { + mPos = modelIndex.row(); + handleAccessView(); + } + catch(const std::exception& exception) + { + HbMessageBox::information(exception.what()); + } + } + +void CpModuleView::handleAccessView() + { + try + { + if(mPos == EIndexCodeLabel) + { + QT_TRAP_THROWING(mSecModUIModel.ChangeOrUnblockPinL(KPinGSettIndex)); + } + else if(mPos == EIndexCodeRequest) + { + if (KErrCancel == mSecModUIModel.ChangeCodeRequest(KPinGSettIndex)) + { + return; + } + } + else if ( mPos == EIndexCodeStatus) + { + QT_TRAP_THROWING(mSecModUIModel.CloseAuthObjL(KPinGSettIndex)); + } + showAccessView(); + } + catch(const std::exception& exception) + { + HbMessageBox::information(exception.what()); + } + } + +void CpModuleView::handleSigView() + { + try + { + QT_TRAP_THROWING(mSecModUIModel.ChangeOrUnblockPinL(KPinNrSettIndex)); + showSignatureView(EFalse); + } + catch(const std::exception& exception) + { + HbMessageBox::information(exception.what()); + } + } + +void CpModuleView::handleSigViewCommand() + { + try + { + switch(mPos) + { + case ESecModUICmdChange: + QT_TRAP_THROWING(mSecModUIModel.ChangePinNrL(mPos)); + showSignatureView(EFalse); + break; + case ESecModUICmdUnblock: + QT_TRAP_THROWING(mSecModUIModel.UnblockPinNrL(mPos)); + showSignatureView(EFalse); + break; + }; + } + catch(const std::exception& exception) + { + HbMessageBox::information(exception.what()); + } + } + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/src/cpsecmodmodel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/src/cpsecmodmodel.cpp Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,919 @@ +/* +* Copyright (c) 2005-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: Implementation of the CSecModUIModel class +* +*/ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include "cpsecmodmodel.h" +#include "cpsecmodsyncwrapper.h" + +const TInt KWIMStoreUid ( 0x101F79D9 ); +_LIT(KSecModUIPanic, "Security Module UI panic"); + +// ============================= LOCAL FUNCTIONS =============================== +GLDEF_C void Panic(TInt aPanic) + { + User::Panic(KSecModUIPanic, aPanic); + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::NewL() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CSecModUIModel* CSecModUIModel::NewL() + { + CSecModUIModel* self = new( ELeave ) CSecModUIModel(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::CSecModUIModel +// C++ default constructor can NOT contain any code, that might leave. +// ----------------------------------------------------------------------------- +// +CSecModUIModel::CSecModUIModel() + {} + +// ----------------------------------------------------------------------------- +// CSecModUIModel::~CSecModUIModel +// C++ destructor +// ----------------------------------------------------------------------------- +// + +CSecModUIModel::~CSecModUIModel() + { + delete iWrapper; + ResetAndDestroyCTObjects(); + } +// ----------------------------------------------------------------------------- +// CSecModUIModel::ResetAndDestroyCTObjects(): Cleans up all objects referenced +// through the crypto token framework. +// ----------------------------------------------------------------------------- +// +void CSecModUIModel::ResetAndDestroyCTObjects() + { + ResetAndDestroyAOs(); + iAOKeyStores.Reset(); + delete iUnifiedKeyStore; + iUnifiedKeyStore = NULL; + iKeyStore = NULL; + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::ResetAndDestroyAOs(): Cleans up the list of auth objects. +// ----------------------------------------------------------------------------- +// +void CSecModUIModel::ResetAndDestroyAOs() + { + if (iAOList) + { + iAOList->Release(); + iAOList = NULL; + } + if (iAOArray.Count() > 0 && + iAOArray[0]->Token().TokenType().Type().iUid == KTokenTypeFileKeystore) + { + iAOArray.Reset(); + } + else + { + iAOArray.Close(); + } + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::ConstructL() +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CSecModUIModel::ConstructL() + { + InitializeKeyStoreL(); + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::InitializeKeyStoreL() +// ----------------------------------------------------------------------------- +// +void CSecModUIModel::InitializeKeyStoreL() + { + ResetAndDestroyCTObjects(); + + // Ensure that file server session is succesfully created + User::LeaveIfError( iRfs.Connect() ); + + iUnifiedKeyStore = CUnifiedKeyStore::NewL(iRfs); + + if (iWrapper == NULL) + { + iWrapper = CSecModUISyncWrapper::NewL(); + } + + TInt err = iWrapper->Initialize(*iUnifiedKeyStore); + + ShowErrorNote(err); + if (KErrNone != err && KErrHardwareNotAvailable != err) + { + User::Leave(err); + } + TInt keyStoreCount = iUnifiedKeyStore->KeyStoreCount(); + if (0 >= keyStoreCount) + { + return; + } + + RMPointerArray keyInfos; + CleanupClosePushL(keyInfos); + TCTKeyAttributeFilter filter; + TInt keyInfoCount = 0; + filter.iPolicyFilter = TCTKeyAttributeFilter::EAllKeys; + + for (TInt i = 0; i < keyStoreCount; i++) + { + err = iWrapper->ListKeys(iUnifiedKeyStore->KeyStore(i), keyInfos, filter); + User::LeaveIfError(err); + //If list ok, append the AO, otherwise go next + keyInfoCount = keyInfos.Count(); + for (TInt j = 0; j < keyInfoCount; j++) + { + // Check that keystore has at least one AO. + if (NULL != keyInfos[j]->Protector()) + { + // If keystore has AO, add it to the array. + User::LeaveIfError( + iAOKeyStores.Append(&(iUnifiedKeyStore->KeyStore(i)))); + break; + } + } + } + CleanupStack::PopAndDestroy(&keyInfos); + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::LoadTokenLabelsL() +// Retrieves the description and location of all tokens. +// ----------------------------------------------------------------------------- +// +QMap CSecModUIModel::LoadTokenLabelsL() + { + + TInt keyStoreCount = iAOKeyStores.Count(); + QMap labelList; + + if (0 == keyStoreCount) + { + return labelList; + } + + for (TInt i = 0; i < keyStoreCount; i++) + { + QString keystoreLabel = 0; + if (iAOKeyStores[i]->Token().TokenType().Type().iUid == KTokenTypeFileKeystore ) + { + keystoreLabel = "Phone keystore"; + } + else if(iAOKeyStores[i]->Token().TokenType().Type().iUid == KWIMStoreUid ) + { + const TDesC& label = iAOKeyStores[i]->Token().Label(); + keystoreLabel = QString( (QChar*) label.Ptr(), label.Length()); + } + else + { + continue; + } + QString location = Location(iAOKeyStores[i]->Token().TokenType().Type()); + labelList.insert(keystoreLabel,location); + } + return labelList; + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::Location() +// Identifies the location of the keystore based on the Uid. +// ----------------------------------------------------------------------------- +// +QString CSecModUIModel::Location( TUid aUid ) const + { + QString location = 0; + + switch ( aUid.iUid ) + { + case KTokenTypeFileKeystore: + { + location = "\nPhone memory"; + break; + } + case KWIMStoreUid: + { + location = "\nSmart card"; + break; + } + default: + { + break; + } + } + return location; + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::ShowErrorNote(TInt aError) const +// Displays appropriate error message based on the error code. +// ----------------------------------------------------------------------------- +// +void CSecModUIModel::ShowErrorNote(TInt aError) const + { + QString sError; + + switch (aError) + { + case KErrCancel: + case KErrLocked: + case KErrNone: + { + break; + } + case KErrInUse: + { + sError = "Key is currently in use. Unable to delete. Close applications and try again."; + break; + } + case KErrBadPassphrase: + { + sError = "Code incorrect"; + break; + } + case KErrHardwareNotAvailable: // flow thru + default: + { + sError = "Security module internal error"; + break; + } + } + + if ( sError.length() != 0 ) + { + HbMessageBox::information(sError); + } + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::OpenTokenL(TInt aTokenIndex) +// Retrieves the appropriate token based on the index. +// ----------------------------------------------------------------------------- +// +void CSecModUIModel::OpenTokenL(TInt aTokenIndex) + { + ResetAndDestroyAOs(); + iKeyStore = iAOKeyStores[aTokenIndex]; + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::CheckCodeViewStringsL() +// Initialize the auth objects and return the total count. +// ----------------------------------------------------------------------------- +// +TInt CSecModUIModel::CheckCodeViewStringsL() + { + InitAuthObjectsL(); + ListAuthObjectsL(); + return iAOArray.Count(); + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::InitAuthObjectsL() +// Retrieve the authentication object associated with the appropriate key store +// implementation. +// ----------------------------------------------------------------------------- +// +void CSecModUIModel::InitAuthObjectsL() + { + TInt err = KErrNone; + // Symbian's file key store does not support + // MCTAuthenticationObjectList interface, so we need to use + // other way to get AO. + if (iKeyStore->Token().TokenType().Type().iUid == KTokenTypeFileKeystore) + { + if (iAOArray.Count()==0) + { + RMPointerArray keyInfos; + CleanupClosePushL(keyInfos); + TCTKeyAttributeFilter filter; + TInt keyInfoCount = 0; + filter.iPolicyFilter = TCTKeyAttributeFilter::EAllKeys; + err = iWrapper->ListKeys(*iKeyStore, keyInfos, filter); + ShowErrorNote(err); + User::LeaveIfError(err); + keyInfoCount = keyInfos.Count(); + for (TInt j = 0; j < keyInfoCount; j++) + { + // Check that keystore has at least one AO. + if (NULL != keyInfos[j]->Protector()) + { + // If keystore has AO, add it to the array. + User::LeaveIfError(iAOArray.Append(keyInfos[j]->Protector())); + break; + } + } + CleanupStack::PopAndDestroy(&keyInfos); //keyInfos + } + } + else + { + if (NULL == iAOList) + { + MCTTokenInterface* tokenInterface = NULL; + err = iWrapper->GetAuthObjectInterface( + iKeyStore->Token(), tokenInterface); + if ( KErrNone != err || NULL == tokenInterface ) + { + ShowErrorNote(err); + User::Leave(err); + } + iAOList = (MCTAuthenticationObjectList*)tokenInterface; + } + } + } +// ----------------------------------------------------------------------------- +// CSecModUIModel::ListAuthObjectsL() +// list the auth objects. +// ----------------------------------------------------------------------------- +// +void CSecModUIModel::ListAuthObjectsL() + { + if (0 >= iAOArray.Count()) + { + __ASSERT_ALWAYS(iAOList, Panic(EPanicNullPointer)); + TInt err = iWrapper->ListAuthObjects(*iAOList, iAOArray); + if (err) + { + ShowErrorNote(err); + User::Leave(err); + } + } + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::TokenLabelForTitle() const +// Retrieves description of the token based on UID of the current active keystore. +// ----------------------------------------------------------------------------- +// +QString CSecModUIModel::TokenLabelForTitle() const + { + QString qLabel; + if (iKeyStore->Token().TokenType().Type().iUid + == KTokenTypeFileKeystore) + { + qLabel = "Phone keystore"; + } + else + { + const TDesC& label = iKeyStore->Token().Label(); + qLabel = QString((QChar*)label.Ptr(),label.Length()); + } + return qLabel; + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::AuthStatus(TInt aIndex) const +// Returns status of the selected auth object. +// ----------------------------------------------------------------------------- +// +TUint32 CSecModUIModel::AuthStatus(TInt aIndex) const + { + return iAOArray[aIndex]->Status(); + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::PINStatus( TInt aIndex, TBool aShowBlockedNote ) const +// Returns status of the auth object based on its persistent properties set +// by security module implementation. +// ----------------------------------------------------------------------------- +// +QString CSecModUIModel::PINStatus( TInt aIndex, TBool aShowBlockedNote ) const + { + __ASSERT_ALWAYS(aIndex < iAOArray.Count(), Panic(EPanicIndexOutOfRange)); + QString pinStatus; + TUint32 status = iAOArray[aIndex]->Status(); + + if (status & EAuthObjectBlocked) + { + if (aShowBlockedNote) + { + QString information = 0; + if (status & EUnblockDisabled) + { + information = " totalblocked, contact your module vendor."; + } + else + { + information = " is blocked. PUK code is needed to unblock the code"; + } + information.prepend(QString( (QChar*)(iAOArray[aIndex]->Label()).Ptr(),iAOArray[aIndex]->Label().Length() ) ); + HbMessageBox::information(information); + } + pinStatus = "Blocked"; + } + else if ( PinOpen(aIndex) ) + { + pinStatus = "Open"; + } + else + { + pinStatus = "Closed"; + } + return pinStatus; + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::PinOpen(TInt aIndex) const +// Checks whether the Pin is still available. +// ----------------------------------------------------------------------------- +// +TBool CSecModUIModel::PinOpen(TInt aIndex) const + { + __ASSERT_ALWAYS(aIndex < iAOArray.Count(), Panic(EPanicIndexOutOfRange)); + TInt timeRemaining = 0; + TInt err = iWrapper->TimeRemaining(*(iAOArray[aIndex]), timeRemaining); + TBool ret = ETrue; + if ( 0 < timeRemaining ) + { + ret = ETrue; + } + else if( timeRemaining == -1 ) + { + ret = ETrue; + } + else + { + ret = EFalse; + } + return ret; + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::ChangeOrUnblockPinL(TInt aIndex) +// Based on the property of auth object the pin can be changed or unblocked. +// ----------------------------------------------------------------------------- +// +void CSecModUIModel::ChangeOrUnblockPinL(TInt aIndex) + { + __ASSERT_ALWAYS(aIndex < iAOArray.Count(), Panic(EPanicIndexOutOfRange)); + TUint32 status = iAOArray[aIndex]->Status(); + + if ((status & EAuthObjectBlocked) && (status & EUnblockDisabled)) + { + return; // We cannot do anything. PIN is total bolcked. + } + else if (status & EAuthObjectBlocked) + { + // Let's unblock the PIN + UnblockPinL(aIndex); + } + else if (status & EEnabled) + { + // PIN is enabled. Let's change the PIN. + ChangePinL(aIndex); + } + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::UnblockPinL(TInt aIndex) +// Unblocks PIN. +// ----------------------------------------------------------------------------- +// +void CSecModUIModel::UnblockPinL(TInt aIndex) + { + __ASSERT_ALWAYS(aIndex < iAOArray.Count(), Panic(EPanicIndexOutOfRange)); + TInt err = iWrapper->UnblockAuthObject(*(iAOArray[aIndex])); + if (KErrNone == err) + { + HbMessageBox::information("Code unblocked"); + } + else + { + ShowErrorNote(err); + } + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::ChangePinL(TInt aIndex) +// Changes the value of the PIN. +// ----------------------------------------------------------------------------- +// +void CSecModUIModel::ChangePinL(TInt aIndex) + { + __ASSERT_ALWAYS(aIndex < iAOArray.Count(), Panic(EPanicIndexOutOfRange)); + TInt err = KErrNone; + + err = iWrapper->ChangeReferenceData(*(iAOArray[aIndex])); + if (err) + { + ShowErrorNote(err); + } + else + { + HbMessageBox::information("Code changed"); + } + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::ChangeCodeRequestL(TInt aIndex) +// Toggles the value of auth object if possible. +// ----------------------------------------------------------------------------- +// +TInt CSecModUIModel::ChangeCodeRequest(TInt aIndex) + { + __ASSERT_ALWAYS(aIndex < iAOArray.Count(), Panic(EPanicIndexOutOfRange)); + TUint32 status = iAOArray[aIndex]->Status(); + TInt err = KErrNone; + if (status & EDisableAllowed && !(status & EAuthObjectBlocked)) + { + if ( status & EEnabled ) + { + err = iWrapper->DisableAuthObject(*(iAOArray[aIndex])); + } + else + { + err = iWrapper->EnableAuthObject(*(iAOArray[aIndex])); + } + ShowErrorNote(err); + } + return err; + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::CloseAuthObjL(TInt aIndex) +// If the auth object is open then closes it. +// ----------------------------------------------------------------------------- +// +void CSecModUIModel::CloseAuthObjL(TInt aIndex) + { + if (PinOpen(aIndex)) + { + __ASSERT_ALWAYS(aIndex < iAOArray.Count(), Panic(EPanicIndexOutOfRange)); + TInt err = iWrapper->CloseAuthObject(*(iAOArray[aIndex])); + if (err) + { + ShowErrorNote(err); + User::Leave(err); + } + } + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::DeleteKeysL(TInt aTokenIndex) +// Deletes key from the appropriate keystore. +// ----------------------------------------------------------------------------- +// +void CSecModUIModel::DeleteKeysL(TInt aTokenIndex) + { + __ASSERT_ALWAYS(aTokenIndex < iAOKeyStores.Count(), Panic(EPanicIndexOutOfRange)); + RMPointerArray keyInfos; + CleanupClosePushL(keyInfos); + TCTKeyAttributeFilter filter; + filter.iPolicyFilter = TCTKeyAttributeFilter::EAllKeys; + TInt err = iWrapper->ListKeys(*iAOKeyStores[aTokenIndex], keyInfos, filter); + ShowErrorNote(err); + User::LeaveIfError(err); + for (TInt i = 0; i < keyInfos.Count(); ++i) + { + err = iWrapper->DeleteKey(*iUnifiedKeyStore, keyInfos[i]->Handle()); + ShowErrorNote(err); + + if (KErrHardwareNotAvailable == err ) + { + break; // Break the loop, if keystore not available + } + } + CleanupStack::PopAndDestroy(&keyInfos); //keyInfos + ResetAndDestroyCTObjects(); + InitializeKeyStoreL(); + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::SecModDetailsL(TInt aTokenIndex) +// Retrieve security module details and cleansup all currently held auth objects. +// ----------------------------------------------------------------------------- +// +QVector< QPair > CSecModUIModel::SecModDetailsL(TInt aTokenIndex) + { + iKeyStore = iAOKeyStores[aTokenIndex]; + InitAuthObjectsL(); + ListAuthObjectsL(); + QVector< QPair > securityDetails = GetSecModDetailsL(); + iKeyStore = NULL; // not owned + if (iAOList) + { + iAOList->Release(); + iAOList = NULL; + } + iAOArray.Reset(); + return securityDetails; + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::GetSecModDetailsL() +// Retrieve security module details. +// ----------------------------------------------------------------------------- +// +QVector< QPair > CSecModUIModel::GetSecModDetailsL() + { + MCTToken& token = iKeyStore->Token(); + QVector< QPair > securityModDetails; + + if (token.TokenType().Type().iUid == KTokenTypeFileKeystore) + { + QPair name("Name:","Phone keystore"); + securityModDetails.append(name); + } + else + { + QPair name("Name:","(No label)"); + securityModDetails.append(name); + } + + AppendItem(securityModDetails, "Version:", token.Information( MCTToken::EVersion ), "(Not defined)" ); + AppendLocation(securityModDetails, token.TokenType().Type(), QString("Security module location:")); + + if (token.TokenType().Type().iUid == KTokenTypeFileKeystore) + { + QPair accessCode("Access code:","Phone keystore code"); + securityModDetails.append(accessCode); + } + else + { + AppendItem(securityModDetails, "Access code:", iAOArray[0]->Label(), "Access code:" ); + } + + AppendPinNRs(securityModDetails); + + AppendItem( securityModDetails, "Serial number:", + token.Information( MCTToken::ESerialNo), + "(Not defined)"); + + AppendItem( securityModDetails, "Manufacturer:", + token.Information( MCTToken::EManufacturer), + "(Not defined)"); + return securityModDetails; + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::AppendLocation() +// Appends the location of the keystore. +// ----------------------------------------------------------------------------- +// +void CSecModUIModel::AppendLocation( QVector< QPair >& aSecModDetails, + TUid aLocUid, + QString aCertDisplayDetails ) + { + QString locationDetails = "(Not defined)"; + + switch ( aLocUid.iUid ) + { + case KTokenTypeFileKeystore: + locationDetails = "Phone memory"; + break; + + case KWIMStoreUid: + locationDetails = "Smart card"; + break; + + default: + break; + } + aSecModDetails.append(QPair(aCertDisplayDetails, locationDetails)); + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::AppendItem() +// Appends the value of a label if present otherwise appends empty descriotion. +// ----------------------------------------------------------------------------- +// +void CSecModUIModel::AppendItem( QVector< QPair >& aSecModDetails, + QString aLabel, + const TDesC& aValue, + QString aNullDescription) + { + if( aValue.Length() == 0 ) + { + aSecModDetails.append(QPair(aLabel, aNullDescription)); + } + else + { + QString value = QString((QChar*) aValue.Ptr(),aValue.Length()); + aSecModDetails.append(QPair(aLabel, value)); + } + } + +// ------------------------------------------------------------------------------- +// CSecModUIModel::AppendPinNRs(QVector< QPair >& aSecModDetails) +// Generate details of signing security module. +// ------------------------------------------------------------------------------- +// +void CSecModUIModel::AppendPinNRs(QVector< QPair >& aSecModDetails) + { + TInt pinCount = iAOArray.Count(); + TInt j = 0; + + for (TInt i=1; iLabel(); + if(label.Length() == 0) + { + noLabelDetails.append(++j); + } + QString signingCode = "Signing code:"; + AppendItem(aSecModDetails, signingCode , iAOArray[i]->Label(), noLabelDetails); + } + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::AuthDetails() const +// Return the list of pair of description and status of each auth object. +// ----------------------------------------------------------------------------- +// +QVector > CSecModUIModel::AuthDetails() + { + QVector > authDetails; + + // Here is assumed that the first AO is always PIN-G + for (TInt i = 1; i < iAOArray.Count(); i++) + { + const TDesC& label = iAOArray[i]->Label(); + TUint32 status = iAOArray[i]->Status(); + QString sLabel = QString((QChar*) label.Ptr(), label.Length()); + QPair pair(sLabel, status); + authDetails.append(pair); + } + return authDetails; + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::ChangePinNrL(TInt aIndex) +// Change the pin value for the singing module. +// ----------------------------------------------------------------------------- +// +void CSecModUIModel::ChangePinNrL(TInt aIndex) + { + ChangePinL(aIndex+1); + } + + +// ----------------------------------------------------------------------------- +// CSecModUIModel::UnblockPinNrL(TInt aIndex) +// Unblock the value for the signing code module. +// ----------------------------------------------------------------------------- +// +void CSecModUIModel::UnblockPinNrL(TInt aIndex) + { + UnblockPinL(aIndex+1); + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::KeyStoreUID() +// Retrieves the UID of the current active keystore. +// ----------------------------------------------------------------------------- +// +TInt CSecModUIModel::KeyStoreUID() + { + return iKeyStore->Token().TokenType().Type().iUid; + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::AuthObj(TInt aIndex) +// Retrieves the auth object at the speficied index. +// ----------------------------------------------------------------------------- +// +const MCTAuthenticationObject& CSecModUIModel::AuthObj(TInt aIndex) + { + return *iAOArray[aIndex]; + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::PinChangeable(TInt aIndex) const +// Returns the status accordingly if the pin is changeable or not. +// ----------------------------------------------------------------------------- +// +TBool CSecModUIModel::PinChangeable(TInt aIndex) const + { + __ASSERT_ALWAYS(aIndex < iAOArray.Count(), Panic(EPanicIndexOutOfRange)); + TUint32 status = iAOArray[aIndex]->Status(); + TBool ret = ETrue; + if ( (status & EAuthObjectBlocked) || (status & EChangeDisabled) ) + { + ret = EFalse; + } + else if ( status & EEnabled ) + { + ret = ETrue; + } + else // PIN is disabled; + { + ret = EFalse; + } + return ret; + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::PinUnblockable(TInt aIndex) const +// Returns the status accordingly if the pin is unblockable or not. +// ----------------------------------------------------------------------------- +// +TBool CSecModUIModel::PinUnblockable(TInt aIndex) const + { + TUint32 status = iAOArray[aIndex]->Status(); + TBool ret = ETrue; + if ( status & EUnblockDisabled ) + { + ret = EFalse; + } + else if ( status & EAuthObjectBlocked ) + { + ret = ETrue; + } + else // PIN is not blocked; + { + ret = EFalse; + } + return ret; + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::PinRequestChangeable(TInt aIndex) const +// Returns the status accordingly if the pin is changeable or not. +// ----------------------------------------------------------------------------- +// +TBool CSecModUIModel::PinRequestChangeable(TInt aIndex) const + { + __ASSERT_ALWAYS(aIndex < iAOArray.Count(), Panic(EPanicIndexOutOfRange)); + TUint32 status = iAOArray[aIndex]->Status(); + TBool ret = EFalse; + if ( status & EAuthObjectBlocked ) + { + ret = EFalse; + } + else if ( status & EDisableAllowed ) + { + ret = ETrue; + } + else // Disable not allowed; + { + ret = EFalse; + } + return ret; + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::IsTokenDeletable(TInt aTokenIndex) +// Returns the status accordingly if the token is deletable or not. +// ----------------------------------------------------------------------------- +// +TBool CSecModUIModel::IsTokenDeletable(TInt aTokenIndex) + { + __ASSERT_ALWAYS(aTokenIndex < iAOKeyStores.Count(), Panic(EPanicIndexOutOfRange)); + TBool ret = EFalse; + if (iAOKeyStores[aTokenIndex]->Token().TokenType().Type().iUid + == KTokenTypeFileKeystore) + { + ret = ETrue; + } + else + { + ret = EFalse; + } + return ret; + } + +// End of File + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/src/cpsecmodsyncwrapper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/src/cpsecmodsyncwrapper.cpp Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,392 @@ +/* +* Copyright (c) 2005-2010 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: Implementation of the CSecModUISyncWrapper class +* Implements a synchronous wrapper for easier use of Symbian's +* Security Frameworks's API's. +* +*/ + + +#include "cpsecmodsyncwrapper.h" +#include +#include +#include +#include +#include +#include +#include + + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CSecModUISyncWrapper::CSecModUISyncWrapper() +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CSecModUISyncWrapper::CSecModUISyncWrapper() : CActive( EPriorityStandard ) + { + CActiveScheduler::Add(this); + } + + +// ----------------------------------------------------------------------------- +// CSecModUISyncWrapper::NewLC +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CSecModUISyncWrapper* CSecModUISyncWrapper::NewLC() + { + CSecModUISyncWrapper* wrap = new (ELeave) CSecModUISyncWrapper(); + CleanupStack::PushL(wrap); + return wrap; + } + +// ----------------------------------------------------------------------------- +// CSecModUISyncWrapper::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CSecModUISyncWrapper* CSecModUISyncWrapper::NewL() + { + CSecModUISyncWrapper* wrap = CSecModUISyncWrapper::NewLC(); + CleanupStack::Pop(wrap); + return wrap; + } + +// Destructor +CSecModUISyncWrapper::~CSecModUISyncWrapper() + { + Cancel(); + iOperation = EOperationNone; + } + +// ----------------------------------------------------------------------------- +// CSecModUISyncWrapper::Initialize(CUnifiedKeyStore& aKeyStore) +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// + +TInt CSecModUISyncWrapper::Initialize(CUnifiedKeyStore& aKeyStore) + { + if( !IsActive() && !iWait.IsStarted() ) + { + iOperation = EOperationInit; + iObject = STATIC_CAST(TAny*, &aKeyStore); + aKeyStore.Initialize(iStatus); + SetActive(); + iWait.Start(); + iOperation = EOperationNone; + return iStatus.Int(); + } + return KErrInUse; + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::GetAuthObjectInterface(...) +// ----------------------------------------------------------------------------- +// +TInt CSecModUISyncWrapper::GetAuthObjectInterface( + MCTToken& aToken, MCTTokenInterface*& aTokenInterface) + { + if( !IsActive() && !iWait.IsStarted() ) + { + iOperation = EOperationGetAOInterface; + iObject = STATIC_CAST(TAny*, &aToken); + const TUid KUidInterfaceAO = { KCTInterfaceAuthenticationObject }; + aToken.GetInterface(KUidInterfaceAO, aTokenInterface, iStatus); + iOperation = EOperationGetAOInterface; + SetActive(); + iWait.Start(); + iOperation = EOperationNone; + return iStatus.Int(); + } + return KErrInUse; + } + +// ----------------------------------------------------------------------------- +// CSecModUISyncWrapper::ListAuthObjects(...) +// ----------------------------------------------------------------------------- +// +TInt CSecModUISyncWrapper::ListAuthObjects( + MCTAuthenticationObjectList& aAuthObjList, + RMPointerArray& aAuthObjects) + { + if( !IsActive() && !iWait.IsStarted() ) + { + iOperation = EOperationListAOs; + iObject = STATIC_CAST(TAny*, &aAuthObjList); + aAuthObjList.List( aAuthObjects, iStatus ); + iOperation = EOperationListAOs; + SetActive(); + iWait.Start(); + iOperation = EOperationNone; + return iStatus.Int(); + } + return KErrInUse; + } + +// ----------------------------------------------------------------------------- +// CSecModUISyncWrapper::ListKeys(...) +// ----------------------------------------------------------------------------- +// +TInt CSecModUISyncWrapper::ListKeys( + MCTKeyStore& aKeyStore, + RMPointerArray& aKeysInfos, + const TCTKeyAttributeFilter& aFilter) + { + if( !IsActive() && !iWait.IsStarted() ) + { + iOperation = EOperationListKeys; + iObject = STATIC_CAST(TAny*, &aKeyStore); + aKeyStore.List(aKeysInfos, aFilter, iStatus); + SetActive(); + iWait.Start(); + iOperation = EOperationNone; + return iStatus.Int(); + } + return KErrInUse; + } + +// ----------------------------------------------------------------------------- +// CSecModUISyncWrapper::DeleteKey(...) +// ----------------------------------------------------------------------------- +// +TInt CSecModUISyncWrapper::DeleteKey( + CUnifiedKeyStore& aKeyStore, + TCTTokenObjectHandle aHandle) + { + if( !IsActive() && !iWait.IsStarted() ) + { + iOperation = EOperationDelKey; + iObject = STATIC_CAST(TAny*, &aKeyStore); + aKeyStore.DeleteKey(aHandle, iStatus); + SetActive(); + iWait.Start(); + iOperation = EOperationNone; + return iStatus.Int(); + } + return KErrInUse; + } + +// ----------------------------------------------------------------------------- +// CSecModUISyncWrapper::ChangeReferenceData(MCTAuthenticationObject& aAuthObject) +// ----------------------------------------------------------------------------- +// +TInt CSecModUISyncWrapper::ChangeReferenceData( + MCTAuthenticationObject& aAuthObject) + { + if( !IsActive() && !iWait.IsStarted() ) + { + iOperation = EOperationChangeReferenceData; + iObject = STATIC_CAST(TAny*, &aAuthObject); + aAuthObject.ChangeReferenceData(iStatus); + SetActive(); + iWait.Start(); + iOperation = EOperationNone; + return iStatus.Int(); + } + return KErrInUse; + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::UnblockAuthObject(MCTAuthenticationObject& aAuthObject) +// ----------------------------------------------------------------------------- +// +TInt CSecModUISyncWrapper::UnblockAuthObject( + MCTAuthenticationObject& aAuthObject) + { + if( !IsActive() && !iWait.IsStarted() ) + { + iOperation = EOperationUnblockAO; + iObject = STATIC_CAST(TAny*, &aAuthObject); + aAuthObject.Unblock(iStatus); + SetActive(); + iWait.Start(); + iOperation = EOperationNone; + return iStatus.Int(); + } + return KErrInUse; + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::EnableAuthObject(MCTAuthenticationObject& aAuthObject) +// ----------------------------------------------------------------------------- +// +TInt CSecModUISyncWrapper::EnableAuthObject( + MCTAuthenticationObject& aAuthObject) + { + if( !IsActive() && !iWait.IsStarted() ) + { + iOperation = EOperationEnableAO; + iObject = STATIC_CAST(TAny*, &aAuthObject); + aAuthObject.Enable(iStatus); + iOperation = EOperationUnblockAO; + SetActive(); + iWait.Start(); + iOperation = EOperationNone; + return iStatus.Int(); + } + return KErrInUse; + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::DisableAuthObject(MCTAuthenticationObject& aAuthObject) +// ----------------------------------------------------------------------------- +// +TInt CSecModUISyncWrapper::DisableAuthObject( + MCTAuthenticationObject& aAuthObject) + { + if( !IsActive() && !iWait.IsStarted() ) + { + iOperation = EOperationDisableAO; + iObject = STATIC_CAST(TAny*, &aAuthObject); + aAuthObject.Disable(iStatus); + SetActive(); + iWait.Start(); + iOperation = EOperationNone; + return iStatus.Int(); + } + return KErrInUse; + } + +// ----------------------------------------------------------------------------- +// CSecModUISyncWrapper::CloseAuthObject(MCTAuthenticationObject& aAuthObject) +// ----------------------------------------------------------------------------- +// +TInt CSecModUISyncWrapper::CloseAuthObject( + MCTAuthenticationObject& aAuthObject) + { + if( !IsActive() && !iWait.IsStarted() ) + { + iOperation = EOperationCloseAO; + iObject = STATIC_CAST(TAny*, &aAuthObject); + aAuthObject.Close(iStatus); + SetActive(); + iWait.Start(); + iOperation = EOperationNone; + return iStatus.Int(); + } + return KErrInUse; + } + +// ----------------------------------------------------------------------------- +// CSecModUIModel::TimeRemaining(...) +// ----------------------------------------------------------------------------- +// +TInt CSecModUISyncWrapper::TimeRemaining( + MCTAuthenticationObject& aAuthObject, + TInt& aStime ) + { + if( !IsActive() && !iWait.IsStarted() ) + { + iOperation = EOperationTimeRemAO; + iObject = STATIC_CAST(TAny*, &aAuthObject); + aAuthObject.TimeRemaining(aStime, iStatus); + SetActive(); + iWait.Start(); + iOperation = EOperationNone; + return iStatus.Int(); + } + return KErrInUse; + } + +// ----------------------------------------------------------------------------- +// CSecModUISyncWrapper::DoCancel +// Cancels the ongoing operation if possible. +// ----------------------------------------------------------------------------- +// +void CSecModUISyncWrapper::DoCancel() + { + switch ( iOperation ) + { + case EOperationInit: + { + STATIC_CAST(CUnifiedKeyStore*, iObject)->CancelInitialize(); + break; + } + case EOperationGetAOInterface: + { + STATIC_CAST(MCTToken*, iObject)->CancelGetInterface(); + break; + } + case EOperationListAOs: + { + STATIC_CAST(MCTAuthenticationObjectList*, iObject)->CancelList(); + break; + } + case EOperationListKeys: + { + STATIC_CAST(MCTKeyStore*, iObject)->CancelList(); + break; + } + case EOperationDelKey: + { + STATIC_CAST(CUnifiedKeyStore*, iObject)->CancelDeleteKey(); + break; + } + case EOperationChangeReferenceData: + { + STATIC_CAST(MCTAuthenticationObject*, iObject)-> + CancelChangeReferenceData(); + break; + } + case EOperationUnblockAO: + { + STATIC_CAST(MCTAuthenticationObject*, iObject)->CancelUnblock(); + break; + } + case EOperationEnableAO: + { + STATIC_CAST(MCTAuthenticationObject*, iObject)->CancelEnable(); + break; + } + case EOperationDisableAO: + { + STATIC_CAST(MCTAuthenticationObject*, iObject)->CancelDisable(); + break; + } + case EOperationCloseAO: + { + STATIC_CAST(MCTAuthenticationObject*, iObject)->CancelClose(); + break; + } + case EOperationTimeRemAO: + { + STATIC_CAST(MCTAuthenticationObject*, iObject)->CancelTimeRemaining(); + break; + } + default: + { + break; + } + } + if (iWait.IsStarted()) + { + iWait.AsyncStop(); + } + } + +// ----------------------------------------------------------------------------- +// CSecModUISyncWrapper::RunL +// If no errors happened, stop. Show an error note if needed. +// ----------------------------------------------------------------------------- +// +void CSecModUISyncWrapper::RunL() + { + iWait.AsyncStop(); + } + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/src/cpsecmoduleinfoview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/src/cpsecmoduleinfoview.cpp Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,84 @@ + +/* +* Copyright (c) 2010 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: +* +*/ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "cpsecmoduleinfoview.h" + + +CpSecmoduleInfoView::CpSecmoduleInfoView(const QVector< QPair >& securityDetails, QGraphicsItem *parent /*= 0*/) + : CpBaseSettingView(0,parent) + { + setTitle(tr("Module info")); + + std::auto_ptr layout(q_check_ptr(new QGraphicsLinearLayout(Qt::Vertical))); + HbListWidget* listSecurityDetails = q_check_ptr(new HbListWidget(this)); + + QVectorIterator< QPair > secDetIter(securityDetails); + while(secDetIter.hasNext()) + { + QPair pair = secDetIter.next(); + + std::auto_ptr label(q_check_ptr(new HbListWidgetItem())); + label->setText(pair.first); + listSecurityDetails->addItem(label.get()); + label.release(); + + std::auto_ptr description(q_check_ptr(new HbListWidgetItem())); + description->setText(pair.second); + listSecurityDetails->addItem(description.get()); + description.release(); + } + + layout->addItem(listSecurityDetails); + setLayout(layout.get()); + layout.release(); + } + +CpSecmoduleInfoView::~CpSecmoduleInfoView() + {} + +// End of file + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/src/cpsecmodview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/src/cpsecmodview.cpp Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,140 @@ +/* +* Copyright (c) 2010 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: +* +*/ + +#include + + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "cpsecmodview.h" +#include "cpsecmodmodel.h" +#include "cpmoduleview.h" + +CpSecModView::CpSecModView(TInt currentPos, CSecModUIModel& secModUIModel, QGraphicsItem *parent /*= 0*/) +: CpBaseSettingView(0,parent), + mSecModUIModel(secModUIModel), + mPos(currentPos), + mCurrentView(EAccessView), + mAccessView(NULL), + mPrevView(NULL) + { + try + { + QT_TRAP_THROWING(mSecModUIModel.OpenTokenL(mPos)); + QString title = mSecModUIModel.TokenLabelForTitle(); + setTitle(title); + + TInt count = 0; + // display code view + QT_TRAP_THROWING(count = mSecModUIModel.CheckCodeViewStringsL()); + + std::auto_ptr layout(q_check_ptr(new QGraphicsLinearLayout(Qt::Vertical))); + HbListWidget* listSecView = q_check_ptr(new HbListWidget(this)); + + std::auto_ptr moduleWidget(q_check_ptr(new HbListWidgetItem())); + moduleWidget->setText("\tModule PIN"); + listSecView->addItem(moduleWidget.get()); + moduleWidget.release(); + + if( count == 2 ) + { + std::auto_ptr signingWidget(q_check_ptr(new HbListWidgetItem())); + signingWidget->setText("\tSigning PIN"); + listSecView->addItem(signingWidget.get()); + signingWidget.release(); + } + + connect(listSecView, SIGNAL(activated(QModelIndex)), this, SLOT(showNextView(QModelIndex))); + + layout->addItem(listSecView); + setLayout(layout.get()); + layout.release(); + } + catch(const std::exception& exception) + { + QString error(exception.what()); + HbMessageBox::information(error); + QT_RETHROW; + } + } + +CpSecModView::~CpSecModView() + { + if(mAccessView) + { + mAccessView->deleteLater(); + mAccessView = NULL; + } + if(mPrevView) + { + mPrevView->deleteLater(); + mPrevView = NULL; + } + } + + +void CpSecModView::showNextView( const QModelIndex& modelIndex ) + { + try + { + mAccessView = q_check_ptr(new CpModuleView((TSecModViews)modelIndex.row(),mSecModUIModel)); + QObject::connect(mAccessView , SIGNAL(aboutToClose()), this, SLOT(displayPrevious())); + mPrevView = mainWindow()->currentView(); //suppose iPreView is member variable of CpSecurityView + mainWindow()->addView(mAccessView); + mainWindow()->setCurrentView(mAccessView); + } + catch(const std::exception& exception) + { + HbMessageBox::information(exception.what()); + } + } + +void CpSecModView::displayPrevious() + { + try + { + mainWindow()->removeView(mAccessView); + } + catch(const std::exception& exception) + { + HbMessageBox::information(exception.what()); + } + } + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/src/cpsecurityview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/src/cpsecurityview.cpp Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,358 @@ +/* +* Copyright (c) 2010 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: +* +*/ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "cpsecurityview.h" +#include "cpsecmodview.h" +#include "cpcertview.h" +#include "cpsecmodmodel.h" +#include "cpsecmoduleinfoview.h" + +CpSecurityView::CpSecurityView(QGraphicsItem *parent /*= 0*/) + : CpBaseSettingView(0,parent), + mSecModUIModel(NULL), + mSecModView(NULL), + mPreView(NULL), + mCertView(NULL), + mCurrentView(NULL), + mPos(0) + { + setTitle(hbTrId("txt_certificate_manager_setlabel_advanced_security")); + + std::auto_ptr layout(q_check_ptr(new QGraphicsLinearLayout(Qt::Vertical))); + HbListWidget* listCertView = q_check_ptr(new HbListWidget(this)); + + std::auto_ptr authcert(q_check_ptr(new HbListWidgetItem())); + authcert->setText(hbTrId("txt_certificate_manager_list_authority_certificate")); + + std::auto_ptr trustedsitecert(q_check_ptr(new HbListWidgetItem())); + trustedsitecert->setText(hbTrId("txt_certificate_manager_list_trusted_site_certific")); + + std::auto_ptr personalcert(q_check_ptr(new HbListWidgetItem())); + personalcert->setText(hbTrId("txt_certificate_manager_list_personal_certificates")); + + std::auto_ptr devicecert(q_check_ptr(new HbListWidgetItem())); + devicecert->setText(hbTrId("txt_certificate_manager_list_device_certificates")); + + listCertView->addItem(authcert.get()); + authcert.release(); + listCertView->addItem(trustedsitecert.get()); + trustedsitecert.release(); + listCertView->addItem(personalcert.get()); + personalcert.release(); + listCertView->addItem(devicecert.get()); + devicecert.release(); + + connect(listCertView, SIGNAL(released(QModelIndex)), this, SLOT(displayCert(QModelIndex))); + + HbListWidget* listSecView = q_check_ptr(new HbListWidget(this)); + QMap keystoreLabels; + + try + { + QT_TRAP_THROWING( + mSecModUIModel = CSecModUIModel::NewL(); + keystoreLabels = mSecModUIModel->LoadTokenLabelsL(); ) + } + catch(const std::exception& exception) + { + QString error(exception.what()); + HbMessageBox::information(error); + QT_RETHROW; + } + + QMapIterator labelIter(keystoreLabels); + if(keystoreLabels.count() != 0) + { + while(labelIter.hasNext()) + { + labelIter.next(); + std::auto_ptr widget(q_check_ptr(new HbListWidgetItem())); + widget->setText(labelIter.key()); + widget->setSecondaryText(labelIter.value()); + listSecView->addItem(widget.get()); + widget.release(); + } + connect(listSecView, SIGNAL(activated(QModelIndex)), this, SLOT(showCodeView(QModelIndex))); + connect(listSecView, SIGNAL(longPressed(HbAbstractViewItem*, QPointF )), this, SLOT(indicateLongPress(HbAbstractViewItem*, QPointF))); + } + else + { + std::auto_ptr emptyWidget(q_check_ptr(new HbListWidgetItem())); + emptyWidget->setText("(no security modules)"); + listSecView->addItem(emptyWidget.get()); + emptyWidget.release(); + } + + std::auto_ptr certificatesList(q_check_ptr(new HbGroupBox())); + certificatesList->setHeading(hbTrId("txt_certificate_manager_setlabel_certificates")); + certificatesList->setContentWidget(listCertView); + certificatesList->setCollapsed(true); + layout->addItem(certificatesList.get()); + certificatesList.release(); + + std::auto_ptr protectedContentList(q_check_ptr(new HbGroupBox())); + protectedContentList->setHeading("Protected Content"); + protectedContentList->setCollapsed(true); + layout->addItem(protectedContentList.get()); + protectedContentList.release(); + + std::auto_ptr securityModuleList(q_check_ptr(new HbGroupBox())); + securityModuleList->setHeading("Security Module"); + securityModuleList->setContentWidget(listSecView); + securityModuleList->setCollapsed(true); + layout->addItem(securityModuleList.get()); + securityModuleList.release(); + + setLayout(layout.get()); + layout.release(); + } + + +CpSecurityView::~CpSecurityView() + { + if(mSecModView) + { + mSecModView->deleteLater(); + mSecModView= NULL; + } + + if(mPreView) + { + mPreView->deleteLater(); + mPreView= NULL; + } + + if(mCertView) + { + mCertView->deleteLater(); + mCertView= NULL; + } + + if(mCurrentView) + { + mCurrentView->deleteLater(); + mCurrentView= NULL; + } + + delete mSecModUIModel; + mSecModUIModel = NULL; + } + +void CpSecurityView::showCodeView() + { + try + { + mSecModView = q_check_ptr(new CpSecModView(mPos, *mSecModUIModel)); + QObject::connect(mSecModView , SIGNAL(aboutToClose()), this, SLOT(viewDone())); + mPreView = mainWindow()->currentView(); //suppose mPreView is member variable of CpSecurityView + mainWindow()->addView(mSecModView); + mainWindow()->setCurrentView(mSecModView); + } + catch(const std::exception& exception) + { + HbMessageBox::information(exception.what()); + } + } + +void CpSecurityView::showCodeView( const QModelIndex& aModelIndex) + { + mPos = aModelIndex.row(); + showCodeView(); + } + +void CpSecurityView::showWIMview() + { + try + { + QObject::connect(mSecModView , SIGNAL(aboutToClose()), this, SLOT(viewDone())); + mPreView = mainWindow()->currentView(); //suppose mPreView is member variable of CpSecurityView + mainWindow()->addView(mSecModView); + mainWindow()->setCurrentView(mSecModView); + } + catch(const std::exception& exception) + { + HbMessageBox::information(exception.what()); + } + } + +void CpSecurityView::viewDone() + { + try + { + mainWindow()->removeView(mSecModView); + mSecModView->deleteLater(); + mSecModView= NULL; + mainWindow()->setCurrentView(mPreView); + } + catch(const std::exception& exception) + { + HbMessageBox::information(exception.what()); + } + } + +void CpSecurityView::displayCert(const QModelIndex& modelIndex) + { + try + { + mCertView = q_check_ptr(new CpCertView(modelIndex)); + connect(mCertView , SIGNAL(aboutToClose()), this, SLOT(displayPrevious())); + mPreView = mainWindow()->currentView(); + mainWindow()->addView(mCertView); + mainWindow()->setCurrentView(mCertView); + } + catch(const std::exception& exception) + { + HbMessageBox::information(exception.what()); + } + } + +void CpSecurityView::displayPrevious() + { + try + { + mainWindow()->removeView(mCertView); + mCertView->deleteLater(); + mCertView= NULL; + mainWindow()->setCurrentView(mPreView); + } + catch(const std::exception& exception) + { + HbMessageBox::information(exception.what()); + } + } + +void CpSecurityView::indicateLongPress(HbAbstractViewItem *item,QPointF coords) + { + try + { + std::auto_ptr contextMenu(q_check_ptr(new HbMenu())); + mPos = item->modelIndex().row(); + + std::auto_ptr openModule(q_check_ptr(new HbAction("Open"))); + connect(openModule.get(), SIGNAL(triggered()), this, SLOT( showCodeView())); + contextMenu->addAction(openModule.get()); + openModule.release(); + + if(mSecModUIModel->IsTokenDeletable(mPos)) + { + std::auto_ptr deleteModule(q_check_ptr(new HbAction("Delete"))); + connect(deleteModule.get(), SIGNAL(triggered()), this, SLOT( deleteModule())); + contextMenu->addAction(deleteModule.get()); + deleteModule.release(); + } + + std::auto_ptr moduleInfo(q_check_ptr(new HbAction("Module Info"))); + connect(moduleInfo.get(), SIGNAL(triggered()), this, SLOT( moduleDetails())); + contextMenu->addAction(moduleInfo.get()); + moduleInfo.release(); + + contextMenu->open(); + contextMenu->setPreferredPos(coords); + } + catch(const std::exception& exception) + { + HbMessageBox::information(exception.what()); + } + } + +void CpSecurityView::deleteModule() + { + try + { + HbMessageBox note(HbMessageBox::MessageTypeQuestion); + note.setHeadingWidget(q_check_ptr(new HbLabel(tr("Delete...")))); + note.setText("Delete keystore and password?"); + note.setPrimaryAction(q_check_ptr(new HbAction("Yes"))); + note.setSecondaryAction(q_check_ptr(new HbAction("No"))); + note.setTimeout(HbPopup::NoTimeout); + note.setIconVisible (EFalse); + HbAction* result = note.exec(); + + if (result != note.primaryAction()) + { + return; + } + + QT_TRAP_THROWING(mSecModUIModel->DeleteKeysL(mPos)); + } + catch(const std::exception& exception) + { + HbMessageBox::information(exception.what()); + } + // refresh current view + } + +void CpSecurityView::moduleDetails() + { + try + { + QVector< QPair > securityDetails; + QT_TRAP_THROWING(securityDetails = mSecModUIModel->SecModDetailsL(mPos)); + mModuleinfoView = q_check_ptr(new CpSecmoduleInfoView(securityDetails)); + + connect(mModuleinfoView , SIGNAL(aboutToClose()), this, SLOT(displayPreviousFromModInfo())); + mPreView = mainWindow()->currentView(); + mainWindow()->addView(mModuleinfoView); + mainWindow()->setCurrentView(mModuleinfoView); + } + catch(const std::exception& exception) + { + HbMessageBox::information(exception.what()); + } + } + +void CpSecurityView::displayPreviousFromModInfo() + { + try + { + mainWindow()->removeView(mModuleinfoView); + mCertView->deleteLater(); + mCertView= NULL; + mainWindow()->setCurrentView(mPreView); + } + catch(const std::exception& exception) + { + HbMessageBox::information(exception.what()); + } + } + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_ar.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_ar.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_bg.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_bg.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_ca.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_ca.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_cs.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_cs.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_da.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_da.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_de.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_de.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_el.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_el.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_en.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_en.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_en_US.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_en_US.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_es.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_es.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_es_419.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_es_419.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_et.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_et.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_eu.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_eu.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_fi.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_fi.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_fr.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_fr.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_fr_CA.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_fr_CA.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_gl.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_gl.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_he.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_he.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_hi.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_hi.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_hr.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_hr.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_hu.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_hu.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_id.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_id.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_is.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_is.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_it.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_it.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_ja.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_ja.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_ko.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_ko.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_lt.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_lt.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_lv.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_lv.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_ms.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_ms.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_nl.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_nl.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_no.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_no.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_pl.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_pl.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_pt.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_pt.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_pt_BR.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_pt_BR.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_ro.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_ro.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_ru.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_ru.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_sk.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_sk.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_sl.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_sl.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_sr.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_sr.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_sv.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_sv.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_th.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_th.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_tl.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_tl.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_tr.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_tr.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_uk.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_uk.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_ur.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_ur.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_vi.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_vi.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_zh.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_zh.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_zh_HK.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_zh_HK.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpadvancedsecplugin/translations/certificate_management_zh_TW.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpadvancedsecplugin/translations/certificate_management_zh_TW.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,216 @@ + + + + + + + Device certificates can be used without user confirmation. Use of device lock recommended. Proceed? + + qtl_dialog_pri5 + Certificate manager_09 + info + Ce + False + + + Simple label + Authority certificates + + qtl_groupbox_simple_sec + Certificate manager_02 + subhead + Ce + False + + + verfying keystore PIN + Verify Keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_2 + Ce + False + + + Message box heading + Move....... + + qtl_dialog_pri_heading + Certificate manager_09 + info + Ce + False + + + Item specific for personal certificates + Move to device certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Personal certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Item specific for device certificates + Move to personal certificates + + qtl_menu_sec + Certificate manager_06 + menu + Ce + False + + + First list item in Certificate group box + Trusted site certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Simple lable + Personal certificate + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Item specific menu item. Note! Only use this text ID if there are no icons. Opens a highlighted item such as an application, folder, or message + Trust settings + + qtl_menu_sec + Certificate manager_02 + menu + Ce + False + + + Simple lable + Device certificates + + qtl_groupbox_simple_sec + Certificate manager_06 + subhead + Ce + False + + + Simple label + Trusted site certificates + + qtl_groupbox_simple_sec + Certificate manager_04 + subhead + Ce + False + + + Set keystore PIN + Unable to use private key. Set keystore PIN: + + qtl_dialog_sec + Certificate manager_07 + dialog_1 + Ce + False + + + Simple label + Advanced security + + qtl_groupbox_simple_sec + Certificate manager_01 + subhead + Ce + False + + + heading for input dialog + Set + + qtl_dialog_pri_heading + Certificate manager_07 + dialog + Ce + False + + + First list item in Certificate group box + Authority certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + Input dialog heading + Keystore PIN + + qtl_dialog_pri_heading + Certificate manager_08 + dialog + Ce + False + + + Notification for PIN doesn't match + Keystore PIN does not match + + qtl_notifdialog_pri2 + Certificate manager_10 + dpopinfo + Ce + False + + + First list item in Certificate group box + Device certificates + + qtl_list_pri + Certificate manager_01 + list + Ce + False + + + label + Enter keystore PIN: + + qtl_dialog_sec + Certificate manager_08 + dialog_1 + Ce + False + + + Certificate group box + Certificates + + qtl_groupbox_expand_pri + Certificate manager_01 + subhead + Ce + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpplugincommon.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpplugincommon.pri Fri May 14 16:43:26 2010 +0300 @@ -0,0 +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: controlpanel plugin project qmake common settings +# +include (common.pri) + + +LIBS += -lcpframework -lcpcategorymodel + +symbian: plugin { # copy qtstub and manifest + + PLUGIN_STUB_PATH = /resource/qt/plugins/controlpanel + + deploy.path = C: + pluginstub.sources = $${TARGET}.dll + pluginstub.path = $$PLUGIN_STUB_PATH + DEPLOYMENT += pluginstub + + qtplugins.path = $$PLUGIN_STUB_PATH + qtplugins.sources += qmakepluginstubs/$${TARGET}.qtplugin + + for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin $$deploy.path$$qtplugins.path/$$basename(qtplugin)" +} diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/cpsecplugins.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/cpsecplugins.pro Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,22 @@ +# +# Copyright (c) 2010 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: Security Settings plugins +# + +TEMPLATE = subdirs + +# temporarilly skip, because too many deprecations +# SUBDIRS += devicelockplugin/devicelockplugin.pro +# SUBDIRS += simpincodeplugin/pincodeplugin.pro +# SUBDIRS += cpadvancedsecplugin/group/advancedsecplugin.pro diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/devicelockplugin/devicelocking.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/devicelockplugin/devicelocking.ts Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,556 @@ + + + + + + Error note when trying to change lock code + Lock code can be changed %L1n times in %L2n hours + + qtl_dialog_pri5_large_graphic + devicelocking_22 + info + de + False + + + Error note when creating new lock code + Characters cannot be repeated + + qtl_dialog_pri5_large_graphic + devicelocking_21 + info + de + False + + + Value for combobox of device locking + 30 minutes + + qtl_dataform_heading_combobox_sec + devicelocking_04 + setlabel_3_val + de + False + + + Label for new lock code query + New lock code + + qtl_dialog_sec + devicelocking_06 + dialog + de + False + + + Error note when creating new lock code + Must include upper and lower case characters + + qtl_dialog_pri5_large_graphic + devicelocking_21 + info + de + False + + + Label for lock code query + Lock code + + qtl_dialog_sec + devicelocking_05 + dialog + de + False + + + Error note when creating new lock code + Lock code cannot be same as previous %Ln lock codes + + qtl_dialog_pri5_large_graphic + devicelocking_21 + info + de + False + + + NotificationDialog shown when creating locking messages + Messages do not match + + qtl_notifdialog_pri_medium_graphic + devicelocking_19 + dpophead + de + False + + + NotificationDialog shown when locking message is created successfully + Locking message created + + qtl_notifdialog_pri_medium_graphic + devicelocking_20 + dpophead + de + False + + + + Cancel + + + common + button + co + False + + + Label for Device lock settings in Control Panel + Device Locking + + qtl_dataform_pri + devicelocking_01 + subhead + de + False + + + Device lock item in Control Panel + Device lock + + qtl_list_pri_large_graphic + CP_01 + dblist_1 + CP + False + + + Label for Automatic locking combobox + Automatic locking + + qtl_dataform_heading_pri + devicelocking_04 + formlabel_3 + de + False + + + Label for remote locking message creation dialog + New locking message + + qtl_dialog_sec + device_locking_04 + dialog + de + False + + + Label for Remote locking field + Remote locking + + qtl_dataform_heading_pri + devicelocking_04 + formlabel_5 + de + False + + + Secondary text for wrong code dialog + Try again + + qtl_notifdialog_sec_medium_graphic + devicelocking_08 + dpopinfo + de + False + + + Error note when creating new lock code + Information included in the lock code is not allowed + + qtl_dialog_pri5_large_graphic + devicelocking_21 + info + de + False + + + Label for Remote locking message field + Locking message + + qtl_dataform_heading_pri + devicelocking_04 + formlabel_6 + de + False + + + Descriptive text for device lock code in control panel + Lock code can be used for protecting the device from unauthorized use + + qtl_dataform_description_sec + devicelocking_01 + info + de + False + + + Notification text for lock code query if field has numbers (other than emergency number) and hw call key is pressed + Emergency calls only + + qtl_notifdialog_pri_medium_graphic + devicelocking_13 + dpophead + de + False + + + Secondary text for blocked code note + Wait %Ln minutes + + qtl_notifdialog_sec_medium_graphic + devicelocking_15 + dpopinfo + de + False + + + Label for verifying new lock message query + Retype locking message + + qtl_dialog_sec + device_locking_04 + dialog + de + False + + + Call button for emergency calls in lock code query + Call + + common + common + button + co + False + + + Notification dialog for wrong lock code primary text + Wrong lock code + + qtl_notifdialog_pri_medium_graphic + devicelocking_08 + dpophead + de + False + + + Label in Device Locking view of Control Panel + Remote locking + + qtl_dataform_pri + devicelocking_04 + subhead + de + False + + + Error note when creating new lock code + Characters cannot be repeated more than %L1 times + + qtl_dialog_pri5_large_graphic + devicelocking_21 + info + de + False + + + Button label for Lock when SIM changed button + On + + qtl_dataform_button_sec + devicelocking_04 + button + de + False + + + NotificationDialog shown when lock code is created successfully + Lock code created + + qtl_notifdialog_pri_medium_graphic + devicelocking_10 + dpophead + de + False + + + Error note when creating new lock code + The security code must be alphanumeric + + qtl_dialog_pri5_large_graphic + devicelocking_21 + info + de + False + + + Error note when creating new lock code + Code must contain at least %L1 special characters + + qtl_dialog_pri5_large_graphic + devicelocking_21 + info + de + False + + + Button label for enabled remote locking + On + + qtl_dataform_button_sec + devicelocking_04 + button + de + False + + + Error message shown when giving the wrong code too many times + Incorrect lock code. One attempt left before data is erased. + + qtl_dialog_pri5_large_graphic + devicelocking_23 + info + de + False + + + Button text for activated device locking + On + + qtl_dataform_button_sec + devicelocking_04 + button + de + False + + + Error note when creating new lock code + Must be at least %L1 characters + + qtl_dialog_pri5_large_graphic + devicelocking_21 + info + de + False + + + Label for lock code field + Lock code + + qtl_dataform_heading_pri + devicelocking_04 + formlabel_2 + de + False + + + Value for combobox in device locking + 60 minutes + + qtl_dataform_heading_combobox_sec + devicelocking_04 + setlabel_4_val + de + False + + + Label for disabled device locking in Control Panel + Off + + qtl_dataform_button_sec + devicelocking_04 + button + de + False + + + Error note when creating new lock code + More than two consecutive numbers not allowed + + qtl_dialog_pri5_large_graphic + devicelocking_21 + info + de + False + + + Message Box shown when lock code expires + Lock code is expired. + + qtl_dialog_pri5_large_graphic + devicelocking_24 + info + de + False + + + Create locking code button in Control Panel + Create lock code + + qtl_dataform_button_sec + devicelocking_01 + button + de + False + + + + Codes do not match + + qtl_notifdialog_pri_medium_graphic + devicelocking_09 + dpophead + de + False + + + Notification text for blocked lock code query. Timed blocking starts from 5 minutes. + Lock code is blocked + + qtl_notifdialog_pri2 + devicelocking_15 + dpophead + de + False + + + ComboBox value for device locking + When keys & screen locked + + qtl_dataform_heading_combobox_sec + devicelocking_04 + setlabel_1_val + de + False + + + Button label for Lock when SIM changed button + Off + + qtl_dataform_button_sec + devicelocking_04 + button + de + False + + + Label for verifying new lock code query + Retype new lock code + + qtl_dialog_sec + devicelocking_07 + dialog + de + False + + + Label for lock if SIM changed field + Lock when SIM changed + + qtl_dataform_heading_pri + devicelocking_04 + formlabel_4 + de + False + + + Combobox value for device locking + 5 minutes + + qtl_dataform_heading_combobox_sec + devicelocking_04 + setlabel_2_val + de + False + + + Error note when creating new lock code + Code must not contain consecutive characters + + qtl_dialog_pri5_large_graphic + devicelocking_21 + info + de + False + + + Error note when creating new lock code + Must include letters and numbers + + qtl_dialog_pri5_large_graphic + devicelocking_21 + info + de + False + + + Label for Device Locking button + Device locking + + qtl_dataform_heading_pri + devicelocking_04 + formlabel_1 + de + False + + + Error note for creating locking message + The locking message and the lock code should not be equal + + qtl_dialog_pri5 + devicelocking_18 + info + de + False + + + Error note when creating new lock code + Cannot contain more than %L1 characters + + qtl_dialog_pri5_large_graphic + devicelocking_21 + info + de + False + + + Button label for disabled remote locking button + Off + + qtl_dataform_button_sec + devicelocking_04 + button + de + False + + + Error note when creating new lock code + Code must not contain single repeated character + + qtl_dialog_pri5_large_graphic + devicelocking_21 + info + de + False + + + + OK + + + common + button + co + False + + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/devicelockplugin/devicelockplugin.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/devicelockplugin/devicelockplugin.pri Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,25 @@ +# +# 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: cpdevicelockplugin source files +# + +# Input +HEADERS += src/*.h +SOURCES += src/*.cpp + +INCLUDEPATH += ../../seccodeui/src \ + ../../seccodeui/inc \ + /sf/mw/securitysrv/securitydialogs + + \ No newline at end of file diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/devicelockplugin/devicelockplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/devicelockplugin/devicelockplugin.pro Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,39 @@ +# +# 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: +# + +TEMPLATE = lib +TARGET = devicelockplugin + +CONFIG += hb plugin + +LIBS += -lseccodeui \ + -lsecuinotificationdialogplugin \ + -lsecui \ + -letelmm \ + -letel \ + -lcustomapi \ + -lrlocksettings \ + -lcentralrepository \ + -lRLockSettings \ + -lflogger +// TRANSLATIONS += devicelocking.ts +include ( ../cpplugincommon.pri ) +include ( devicelockplugin.pri ) +include ( rom/devicelockplugin_rom.pri ) + +symbian { + TARGET.UID3 = 0X2002E68 +} \ No newline at end of file diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/devicelockplugin/devicelockplugin_installer.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/devicelockplugin/devicelockplugin_installer.pkg Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,29 @@ +; devicelockplugin_installer.pkg generated by qmake at 2010-04-27T17:12:14 +; This file is generated by qmake and should not be modified by the user +; + +; Language +&EN + +; SIS header: name, uid, version +#{"devicelockplugin installer"},(0xA000D7CE),1,0,0 + +; Localised Vendor name +%{"Vendor"} + +; Unique Vendor name +:"Vendor" + + +; Manual PKG pre-rules from PRO files +; Default HW/platform dependencies +[0x101F7961],0,0,0,{"S60ProductID"} +[0x102032BE],0,0,0,{"S60ProductID"} +[0x102752AE],0,0,0,{"S60ProductID"} +[0x1028315F],0,0,0,{"S60ProductID"} + +; Default dependency to Qt libraries + + +"M:/sf/app/settingsuis/controlpanelui/src/cpplugins/devicelockplugin/devicelockplugin.sis" - "c:\adm\devicelockplugin.sis" +@"M:/sf/mw/qt/smartinstaller.sis",(0x2002CCCD) diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/devicelockplugin/qmakepluginstubs/devicelockplugin.qtplugin --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/devicelockplugin/qmakepluginstubs/devicelockplugin.qtplugin Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,1 @@ +This file is a Qt plugin stub file. The real Qt plugin is located in /sys/bin. Created:2010-04-28T08:30:55 diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/devicelockplugin/rom/devicelockplugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/devicelockplugin/rom/devicelockplugin.iby Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,29 @@ +/* +* 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: +* +*/ + +#ifndef __DEVICELOCKPLUGIN_IBY__ +#define __DEVICELOCKPLUGIN_IBY__ + +#include +#include + +file=ABI_DIR\BUILD_DIR\devicelockplugin.dll SHARED_LIB_DIR\devicelockplugin.dll + +data=\epoc32\data\c\resource\qt\plugins\controlpanel\devicelockplugin.qtplugin +resource\qt\plugins\controlpanel\devicelockplugin.qtplugin + +#endif diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/devicelockplugin/rom/devicelockplugin_rom.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/devicelockplugin/rom/devicelockplugin_rom.pri Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,21 @@ +# +# 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: +# + +symbian { + BLD_INF_RULES.prj_exports += \ + "$${LITERAL_HASH}include" \ + "rom/devicelockplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(devicelockplugin.iby)" +} \ No newline at end of file diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/devicelockplugin/secuidevicelockplugin_installer.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/devicelockplugin/secuidevicelockplugin_installer.pkg Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,29 @@ +; secuidevicelockplugin_installer.pkg generated by qmake at 2010-04-26T15:36:02 +; This file is generated by qmake and should not be modified by the user +; + +; Language +&EN + +; SIS header: name, uid, version +#{"secuidevicelockplugin installer"},(0xA000D7CE),1,0,0 + +; Localised Vendor name +%{"Vendor"} + +; Unique Vendor name +:"Vendor" + + +; Manual PKG pre-rules from PRO files +; Default HW/platform dependencies +[0x101F7961],0,0,0,{"S60ProductID"} +[0x102032BE],0,0,0,{"S60ProductID"} +[0x102752AE],0,0,0,{"S60ProductID"} +[0x1028315F],0,0,0,{"S60ProductID"} + +; Default dependency to Qt libraries + + +"M:/sf/app/settingsuis/controlpanelui/src/cpplugins/devicelockplugin/secuidevicelockplugin.sis" - "c:\adm\secuidevicelockplugin.sis" +@"M:/sf/mw/qt/smartinstaller.sis",(0x2002CCCD) diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/devicelockplugin/src/cpdevicelockplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/devicelockplugin/src/cpdevicelockplugin.cpp Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,63 @@ +/* + * 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: + * + */ +#include "cpdevicelockplugin.h" +#include "cpdevicelockpluginview.h" +#include + + + +/* + ***************************************************************** + * Name : CpDeviceLockPlugin + * Parameters : None + * Return value: None + * Description : constructor + ***************************************************************** + */ +CpDeviceLockPlugin::CpDeviceLockPlugin() +{ +} + + +/* + ***************************************************************** + * Name : ~CpDeviceLockPlugin + * Parameters : None + * Return value: None + * Description : destructor + ***************************************************************** + */ +CpDeviceLockPlugin::~CpDeviceLockPlugin() +{ +} + + +/* + ***************************************************************** + * Name : createSettingFormItemData + * Parameters : CpItemDataHelper + * Return value: QLsit* + * Description : creates a data form for device lock settings + ***************************************************************** + */ +QList CpDeviceLockPlugin::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const +{ + return QList() + << new CpSettingFormEntryItemDataImpl(itemDataHelper,tr("Device lock"), QString()); +} + +Q_EXPORT_PLUGIN2(cpdevicelockplugin, CpDeviceLockPlugin); diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/devicelockplugin/src/cpdevicelockplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/devicelockplugin/src/cpdevicelockplugin.h Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,37 @@ +/* + * 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: + * + */ + +#ifndef CPDEVICELOCKPLUGIN_H +#define CPDEVICELOCKPLUGIN_H + +#include +#include + +class CpDeviceLockPlugin : public QObject, public CpPluginInterface +{ + Q_OBJECT + Q_INTERFACES(CpPluginInterface) +public: + /* construtor */ + CpDeviceLockPlugin(); + /* destructor */ + virtual ~CpDeviceLockPlugin(); + /* creates a data form item for device lock settings */ + virtual QList createSettingFormItemData(CpItemDataHelper &itemDataHelper) const; +}; + +#endif //CPDEVICELOCKPLUGIN_H diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/devicelockplugin/src/cpdevicelockpluginview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/devicelockplugin/src/cpdevicelockpluginview.cpp Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,564 @@ +/* + * 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: + * + */ + +#include "cpdevicelockpluginview.h" +#include +#include +#include +#include +#include +#include "cpremotelockdataformviewitem.h" +#include +#include +#include +#include +#include +//#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "debug.h" +#include +#include + + + +/* + ***************************************************************** + * Name : CpDeviceLockPluginView() + * Parameters : QGraphicsItem* + * Return value: None + * Description : constructor + ***************************************************************** + */ +CpDeviceLockPluginView::CpDeviceLockPluginView(QGraphicsItem *parent /*= 0*/) +: CpBaseSettingView(0,parent) +{ + QTranslator *translator = new QTranslator(); + QString lang = QLocale::system().name(); + QString path = "Z:/resource/qt/translations/"; + bool fine = translator->load("devicelocking_en.qm", path); + if (fine) + qApp->installTranslator(translator); + + QTranslator *commontranslator = new QTranslator(); + + fine = commontranslator->load("common_" + lang, path); + if (fine) + qApp->installTranslator(commontranslator); + + + + TSecUi::InitializeLibL(); + mUiSecuSettings = CSecuritySettings::NewL(); + mRemoteLockSettings = CRemoteLockSettings::NewL(); + iALPeriodRep = CRepository::NewL( KCRUidSecuritySettings ); + + + mRemoteLockSettingClicked = false; + mHack = 0; + if (HbDataForm *form = settingForm()) + { + QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical); + QList protoTypeList = form->itemPrototypes(); + protoTypeList.append(new CpRemoteLockDataFormViewItem()); + form->setItemPrototypes(protoTypeList); + form->setHeading(hbTrId("txt_cp_dblist_device_lock")); + + //DataFormModel + formModel = new HbDataFormModel(); + + + //lockcode + HbDataFormModelItem *lockCodeItem = new HbDataFormModelItem( + static_cast(CpRemoteLockDataFormViewItem::CpCodeEditItem), + hbTrId("txt_devicelocking_dialog_lock_code")); + lockCodeItem->setContentWidgetData("echomode",HbLineEdit::Password); + lockCodeItem->setContentWidgetData("text","1234"); + lockCodeItem->setContentWidgetData("readonly",true); + form->addConnection(lockCodeItem,SIGNAL(clicked()),this,SLOT(onLockCodeClicked())); + formModel->appendDataFormItem(lockCodeItem); + + + //Autolock period + mAutolockPeriodItem= new HbDataFormModelItem(HbDataFormModelItem::ComboBoxItem, + hbTrId("txt_devicelocking_formlabel_automatic_locking")); + TInt autoLockVal; + TInt err = iALPeriodRep->Get(KSettingsAutoLockTime, autoLockVal); + TInt index = GetAutoLockIndex(autoLockVal); + Dprint((_L("Current AL period value %d"),autoLockVal)); + //TODO: need to set autoLockVal in editor + QStringList autolockPeriodList; + autolockPeriodList<< hbTrId("txt_devicelocking_button_off") + << hbTrId("txt_devicelocking_setlabel_val_when_keys_screen") + << hbTrId("txt_devicelocking_setlabel_val_5_minutes") + << hbTrId("txt_devicelocking_setlabel_val_30_minutes") + << hbTrId("txt_devicelocking_setlabel_val_60_minutes"); + mAutolockPeriodItem->setContentWidgetData(QString("items"),autolockPeriodList); + mAutolockPeriodItem->setContentWidgetData(QString("currentIndex"),index); + mAutolockPeriodItem->setContentWidgetData(QString("editable"),true); + QVariant themeComboData = mAutolockPeriodItem->contentWidgetData(QString("currentIndex")); + mThemeComboPrevIndex = themeComboData.toInt(); + + form->addConnection(mAutolockPeriodItem,SIGNAL(currentIndexChanged(int)),this,SLOT(onAutoLockChanged(int))); + //form->addConnection(mAutolockPeriodItem,SIGNAL(editTextChanged(const QString&)), this, SLOT(onAutoTextChanged(const QString&))); + formModel->appendDataFormItem(mAutolockPeriodItem); + + + //LockWhenSimChange + mLockWhenSimChangeItem = new HbDataFormModelItem(HbDataFormModelItem::ToggleValueItem, + hbTrId("txt_devicelocking_formlabel_lock_when_sim_changed")); + TBool lockVal = mUiSecuSettings->IsLockEnabledL(RMobilePhone::ELockPhoneToICC); + Dprint((_L("LockWhenSimChange enabled %d"),lockVal)); + if(lockVal) + { + mLockWhenSimChangeItem->setContentWidgetData("text",hbTrId("txt_remotelocking_button_sim_changed_on")); + mLockWhenSimChangeItem->setContentWidgetData("additionalText", + hbTrId("txt_devicelocking_button_sim_changed_off")); + } + else + { + mLockWhenSimChangeItem->setContentWidgetData("text",hbTrId("txt_devicelocking_button_sim_changed_off")); + mLockWhenSimChangeItem->setContentWidgetData("additionalText", + hbTrId("txt_remotelocking_button_sim_changed_on")); + } + mLockWhenSimChangeItem->setContentWidgetData("readonly",true); + mPrevSIMLockData = mLockWhenSimChangeItem->contentWidgetData(QString("text")); + + connect(formModel,SIGNAL(dataChanged(QModelIndex, QModelIndex)), + this,SLOT(onSIMLockDataChanged(QModelIndex,QModelIndex))); + formModel->appendDataFormItem(mLockWhenSimChangeItem); + + + + //Remote Lock Setting + TBool enabled = true; + TBool val = mRemoteLockSettings->GetEnabled(enabled); + Dprint((_L("Remote Lock Setting enabled %d"),val)); + mDeviceRemoteLockItem = new HbDataFormModelItem(HbDataFormModelItem::ToggleValueItem, + hbTrId("txt_devicelocking_subhead_remote_locking")); + + if(val && enabled) + { + mDeviceRemoteLockItem->setContentWidgetData("text",hbTrId("txt_devicelocking_button_remote_on")); + mDeviceRemoteLockItem->setContentWidgetData("additionalText",hbTrId("txt_devicelocking_button_remote_off")); + } + else + { + mDeviceRemoteLockItem->setContentWidgetData("text",hbTrId("txt_devicelocking_button_remote_off")); + mDeviceRemoteLockItem->setContentWidgetData("additionalText",hbTrId("txt_devicelocking_button_remote_on")); + } + + mPrevRemLockData = mDeviceRemoteLockItem->contentWidgetData(QString("text")); + QString s = mPrevRemLockData.toString(); + connect(formModel,SIGNAL(dataChanged(QModelIndex, QModelIndex)),this,SLOT(onRemoteLockDataChanged(QModelIndex,QModelIndex))); + formModel->appendDataFormItem(mDeviceRemoteLockItem); + + //Remote lock message + mRemoteLockMessageItem = new HbDataFormModelItem( + static_cast(CpRemoteLockDataFormViewItem::CpCodeEditItem), + hbTrId("txt_devicelocking_formlabel_locking_message")); + mRemoteLockMessageItem->setContentWidgetData("echoMode",HbLineEdit::Password); + mRemoteLockMessageItem->setContentWidgetData("text","1111"); + mRemoteLockMessageItem->setContentWidgetData("readOnly",true); + + if(mPrevRemLockData.toString()== hbTrId("txt_devicelocking_button_remote_on")) + mRemoteLockMessageItem->setEnabled(true); + else + mRemoteLockMessageItem->setEnabled(false); + + form->addConnection(mRemoteLockMessageItem,SIGNAL(clicked()),this,SLOT(onLockMessageClicked())); + formModel->appendDataFormItem(mRemoteLockMessageItem); + + form->setModel(formModel); + layout->addItem(form); + setLayout(layout); + } +} + + +/* + ***************************************************************** + * Name : ~CpDeviceLockPluginView() + * Parameters : None + * Return value: None + * Description : destructor + ***************************************************************** + */ +CpDeviceLockPluginView::~CpDeviceLockPluginView() +{ + TSecUi::UnInitializeLib(); +} + + +/* + ***************************************************************** + * Name : onLockCodeClicked() + * Parameters : None + * Return value: None + * Description : Enables user to change the lock code + ***************************************************************** + */ +void CpDeviceLockPluginView::onLockCodeClicked() +{ + Dprint(_L("CpDeviceLockPluginView::onLockCodeClicked()..Enter")); + mUiSecuSettings->ChangeSecCodeL(); + Dprint(_L("CpDeviceLockPluginView::onLockCodeClicked()..Exit")); +} + + +/* + ************************************************************************ + * Name : onAutoLockChanged() + * Parameters : int + * Return value: None + * Description : handles the data when automatic lock timings are changed + ************************************************************************ + */ +void CpDeviceLockPluginView::onAutoLockChanged(int index) + { + Dprint(_L("CpDeviceLockPluginView::onAutoLockChanged()..Enter")); + if (index != mThemeComboPrevIndex) + { + //TODO: need to set user entered/selected value + TInt lockValue = GetValueAtIndex(index); + TInt newAutoLockVal = mUiSecuSettings->ChangeAutoLockPeriodL( + lockValue); + if (newAutoLockVal == lockValue) + { + Dprint(_L("onAutoLockChanged().AL setting success !!")); + TInt err = iALPeriodRep->Set(KSettingsAutoLockTime, lockValue); + mThemeComboPrevIndex = index; + } + else + { + Dprint(_L("onAutoLockChanged()..Setting to previous value")); + QVariant data(mThemeComboPrevIndex); + mAutolockPeriodItem->setContentWidgetData( + QString("currentIndex"), data); + } + + } + Dprint(_L("CpDeviceLockPluginView::onAutoLockChanged()..Exit")); +} + + +/* + ************************************************************************* + * Name : onLockMessageClicked() + * Parameters : None + * Return value: None + * Description : verifies security code and enables user to change the lock + * message + ************************************************************************** + */ +void CpDeviceLockPluginView::onLockMessageClicked() + { + Dprint(_L("CpDeviceLockPluginView::onLockMessageClicked()..Exit")); + TBuf remoteLockCode; + TBool remoteLockStatus(EFalse); + TInt retVal = KErrNone; + TInt autoLockVal = -1; + retVal = mUiSecuSettings->ChangeRemoteLockStatusL(remoteLockStatus, + remoteLockCode, autoLockVal); + if (retVal) + { + Dprint(_L("CpDeviceLockPluginView::onLockMessageClicked()..ChangeRemoteLockStatusL sucess")); + } + else + { + Dprint(_L("CpDeviceLockPluginView::onLockMessageClicked()..ChangeRemoteLockStatusL failed")); + } + Dprint(_L("CpDeviceLockPluginView::onLockMessageClicked()..Exit")); + } + + +/* + ************************************************************************* + * Name : onAutoTextChanged() + * Parameters : QString& + * Return value: None + * Description : + ************************************************************************** + */ +/* + *This slot can be enabled once fix from obit team for this siganl is available + */ + +#if 0 +void CpDeviceLockPluginView::onAutoTextChanged(const QString& aText) + { + Dprint(_L("CpDeviceLockPluginView::onAutoTextChanged()..Enter")); + //TBool ret = DisplaySecurityDialog(); + Dprint(_L("CpDeviceLockPluginView::onAutoTextChanged()..Exit")); + + } +#endif + +/* + ************************************************************************* + * Name : onRemoteLockDataChanged() + * Parameters : QModelIndex + * Return value: None + * Description : handles the data when remote lock settings is changed + ************************************************************************** + */ +void CpDeviceLockPluginView::onRemoteLockDataChanged(QModelIndex aStartIn,QModelIndex aEndIn) + { + Q_UNUSED(aEndIn); + Dprint(_L("CpDeviceLockPluginView::onRemoteLockDataChanged..Enter")); + HbDataFormModelItem *item = formModel->itemFromIndex(aStartIn); + + if ((item->type() == HbDataFormModelItem::ToggleValueItem) + && (item->data(HbDataFormModelItem::LabelRole).toString() + == hbTrId("txt_devicelocking_subhead_remote_locking"))) + { + + //The following If-Else condition should be removed once orbit team fix the issue with datachanged() signal + /****************************************************************************************************************/ + if ((mHack % 2) == 0) //need to capture second datachanged() signal , not first one. + { + mHack++; + return; + } + else + { + mHack++; + } + /****************************************************************************************************************/ + TInt autoLockVal; + TInt retVal = KErrNone; + TBuf remoteLockCode; + TBool remoteLockStatus(EFalse); + CRemoteLockSettings *remoteLockSetting = CRemoteLockSettings::NewL(); + TInt err = iALPeriodRep->Get(KSettingsAutoLockTime, autoLockVal); + QVariant remLockData = mDeviceRemoteLockItem->contentWidgetData( + QString("text")); + if (remLockData.toString() == hbTrId("txt_devicelocking_button_remote_on")) + { + remoteLockStatus = ETrue; + retVal = mUiSecuSettings->ChangeRemoteLockStatusL( + remoteLockStatus, remoteLockCode, autoLockVal); + } + else + { + remoteLockStatus = EFalse; + retVal = mUiSecuSettings->ChangeRemoteLockStatusL( + remoteLockStatus, remoteLockCode, autoLockVal); + } + if (retVal == KErrNone) + { + if (remoteLockStatus) + { + if (remoteLockSetting->SetEnabledL(remoteLockCode)) + { + Dprint(_L("CpDeviceLockPluginView::onRemoteLockDataChanged..remoteLockSetting->SetEnabledL success")); + mPrevRemLockData + = mDeviceRemoteLockItem->contentWidgetData( + QString("text")); + } + else + { + RollbackRemoteLockSettingState(); + Dprint(_L("CpDeviceLockPluginView::onRemoteLockDataChanged..remoteLockSetting->SetEnabledL failed")); + } + } + else + { + if (mRemoteLockSettings->SetDisabled()) + { + Dprint(_L("CpDeviceLockPluginView::onRemoteLockDataChanged..remoteLockSetting->SetDisabled success")); + mPrevRemLockData + = mDeviceRemoteLockItem->contentWidgetData( + QString("text")); + } + else + { + RollbackRemoteLockSettingState(); + Dprint(_L("CpDeviceLockPluginView::onRemoteLockDataChanged..remoteLockSetting->SetDisabled failed")); + } + } + } + else + { + Dprint(_L("CpDeviceLockPluginView::onRemoteLockDataChanged..RollbackRemoteLockSettingState")); + RollbackRemoteLockSettingState(); + } + delete remoteLockSetting; + } + Dprint(_L("CpDeviceLockPluginView::onRemoteLockDataChanged..Exit")); +} + + +/* + ************************************************************************* + * Name : onSIMLockDataChanged() + * Parameters : QModelIndex + * Return value: None + * Description : handles the data afer Lock when SIM changed settings is + * changed + ************************************************************************** + */ +void CpDeviceLockPluginView::onSIMLockDataChanged(QModelIndex aStartIn, QModelIndex aEndIn) + { + Q_UNUSED(aEndIn); + HbDataFormModelItem *item = formModel->itemFromIndex(aStartIn); + + if ((item->type() == HbDataFormModelItem::ToggleValueItem) + && (item->data(HbDataFormModelItem::LabelRole).toString() + == hbTrId("txt_devicelocking_formlabel_lock_when_sim_changed"))) + { + //The following If-Else condition should be removed once orbit team fix the issue with datachanged() signal + /****************************************************************************************************************/ + if ((mHack % 2) == 0) //need to capture second datachanged() signal , not first one. + { + mHack++; + return; + } + else + { + mHack++; + } + /****************************************************************************************************************/ + + TBool ret = mUiSecuSettings->ChangeSimSecurityL(); + if (!ret) + { + /* + * disconnect to datachanged() signal as we are not interested in this signal + * generated as a part of setContentWidgetData() API call below + */ + disconnect(formModel,SIGNAL(dataChanged(QModelIndex, QModelIndex)), this,SLOT(onSIMLockDataChanged(QModelIndex,QModelIndex))); + QVariant txt = mLockWhenSimChangeItem->contentWidgetData(QString("text")); + QVariant additionalText =mLockWhenSimChangeItem->contentWidgetData(QString("additionalText")); + + mLockWhenSimChangeItem->setContentWidgetData(QString("text"),additionalText); + mLockWhenSimChangeItem->setContentWidgetData(QString("additionalText"), txt); + /* + * Now connect back to datachanged() signal . + */ + connect(formModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)),this, SLOT(onSIMLockDataChanged(QModelIndex,QModelIndex))); + } + } + } + + +/* + ************************************************************************* + * Name : GetAutoLockIndex() + * Parameters : TInt + * Return value: TInt + * Description : returns corresponding index for the given autolock value + ************************************************************************** + */ +TInt CpDeviceLockPluginView::GetAutoLockIndex(TInt aValue) + { + TInt index = 0; + switch(aValue) + { + case 0: + index = 0; + break; + case 65535: + index = 1; + break; + case 5: + index = 2; + break; + case 30: + index = 3; + break; + case 60: + index = 4; + break; + default: + break; + } + + return index; + } + + +/* + ************************************************************************* + * Name : GetValueAtIndex() + * Parameters : TInt + * Return value: TInt + * Description : returns the corresponding autolock value for the given + * index. + ************************************************************************** + */ +TInt CpDeviceLockPluginView::GetValueAtIndex(TInt aIndex) + { + TInt value = 0; + + switch(aIndex) + { + case 0: + value = 0; + break; + case 1: + value = 65535; + break; + case 2: + value = 5; + break; + case 3: + value = 30; + break; + case 4: + value = 60; + break; + default: + break; + } + + return value; + } +void CpDeviceLockPluginView::RollbackRemoteLockSettingState() + { + /* + * disconnect to datachanged() signal as we are not interested in this signal + * generated as a part of setContentWidgetData() API call below + */ + disconnect(formModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)),this, SLOT(onRemoteLockDataChanged(QModelIndex,QModelIndex))); + + QVariant txt = mDeviceRemoteLockItem->contentWidgetData(QString("text")); + QVariant additionaltxt = mDeviceRemoteLockItem->contentWidgetData(QString("additionalText")); + mDeviceRemoteLockItem->setContentWidgetData(QString("text"),additionaltxt); + mDeviceRemoteLockItem->setContentWidgetData(QString("additionalText"),txt); + /* + * Now connect back to datachanged() signal . + */ + connect(formModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this,SLOT(onRemoteLockDataChanged(QModelIndex,QModelIndex))); + + if (mPrevRemLockData.toString() == hbTrId("txt_devicelocking_button_remote_on")) + mRemoteLockMessageItem->setEnabled(true); + else + mRemoteLockMessageItem->setEnabled(false); + + } diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/devicelockplugin/src/cpdevicelockpluginview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/devicelockplugin/src/cpdevicelockpluginview.h Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,100 @@ +/* + * 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: + * + */ +#ifndef CPDEVICELOCKPLUGINVIEW_H +#define CPDEVICELOCKPLUGINVIEW_H + +#include +#include + +class HbDataFormModel; +class HbDataFormModelItem; +class CSecurityHandler; +class CSecuritySettings; +class SecCodeSettings; +class CRemoteLockSettings; +class CRepository; +class RMobilePhone; + +class CpDeviceLockPluginView : public CpBaseSettingView +{ + Q_OBJECT +public: + explicit CpDeviceLockPluginView(QGraphicsItem *parent = 0); + virtual ~CpDeviceLockPluginView(); +private: + /* Sets the remote lock setting state to previous value */ + void RollbackRemoteLockSettingState(); +private slots: + /* Displays security code dialog and enables user to change the lock code */ + void onLockCodeClicked(); + /* Aske for Security code dialog when Automatic Lock timings are changed*/ + void onAutoLockChanged(int); + /* Displays security Code dialog and then a Input dialog when Remote Lock + * settings is clicked + */ + void onLockMessageClicked(); + /* When Automatic Lock timings text is changed.*/ + /* + * This slot can be enabled once fix from obit team for this siganl is available + */ + // void onAutoTextChanged(const QString& aText); + /* Displays Security code dialog and handles the changed value of the Remote Lock*/ + void onRemoteLockDataChanged(QModelIndex,QModelIndex); + /* Displayes Security code dialog for Lock when SIM changed settings*/ + void onSIMLockDataChanged(QModelIndex,QModelIndex); + /* Returns the index of automatic lock timings for the given autoLock value*/ + TInt GetAutoLockIndex(TInt); + /* Returns the auto lcok value for the given automatic lock timings index*/ + TInt GetValueAtIndex(TInt); +private: + /*Handler for remote lock class*/ + CRemoteLockSettings* mRemoteLockSettings; + /* Handler for Securit Settings class*/ + CSecuritySettings *mUiSecuSettings; + /*Handler to Repository Class*/ + CRepository* iALPeriodRep; + + /* Data Model for DataForm*/ + HbDataFormModel *formModel; + /* Data Item for RemoteLock message*/ + HbDataFormModelItem *mRemoteLockMessageItem; + /* Data Item Remote Lock*/ + HbDataFormModelItem *mDeviceRemoteLockItem; + /* Data item for automatic lock timings*/ + HbDataFormModelItem *mAutolockPeriodItem; + /* Data item for Lock when SIM changed settings*/ + HbDataFormModelItem *mLockWhenSimChangeItem; + /* Input dalog for user to enter Lock message*/ + HbInputDialog* ipDialog; + + /* holds Lock when SIM changed data*/ + QVariant mPrevSIMLockData; + /* holds Remote Lock Value*/ + QVariant mPrevRemLockData; + /* holds the previous Automatic Lock timings index*/ + int mThemeComboPrevIndex; + /* holds the user defined Lock Message*/ + QString mLockMsg; + /* flag set on Remote Lock data changed*/ + TBool mRemoteLockSettingClicked; + /* + * Need to remove this variabl once fix available from orbit team + */ + TInt mHack; +}; + +#endif diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/devicelockplugin/src/cpremotelockdataformviewitem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/devicelockplugin/src/cpremotelockdataformviewitem.cpp Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,155 @@ +/* + * 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: + * + */ + +#include "cpremotelockdataformviewitem.h" +#include +#include + + + +/* + ***************************************************************** + * Name : CpRemoteLockDataFormViewItem + * Parameters : QGraphicsItem* + * Return value: None + * Description : constructor + ***************************************************************** + */ +CpRemoteLockDataFormViewItem::CpRemoteLockDataFormViewItem(QGraphicsItem *parent ) +: HbDataFormViewItem(parent) +{ +} + + +/* + ***************************************************************** + * Name : ~CpRemoteLockDataFormViewItem + * Parameters : None + * Return value: None + * Description : destructor + ***************************************************************** + */ +CpRemoteLockDataFormViewItem::~CpRemoteLockDataFormViewItem() +{ +} + + +/* + ***************************************************************** + * Name : createItem + * Parameters : None + * Return value: HbAbstractViewItem* + * Description : creates a HbAbstractViewItem + ***************************************************************** + */ +HbAbstractViewItem* CpRemoteLockDataFormViewItem::createItem() +{ + return new CpRemoteLockDataFormViewItem(*this); +} + + +/* + ***************************************************************** + * Name : canSetModelIndex + * Parameters : QModelIndex& + * Return value: bool + * Description : + ***************************************************************** + */ +bool CpRemoteLockDataFormViewItem::canSetModelIndex(const QModelIndex &index) const +{ + int type = index.data(HbDataFormModelItem::ItemTypeRole).toInt(); + return ((type == CpRemoteLockItem) || (type == CpCodeEditItem)); +} + + +/* + ***************************************************************** + * Name : createCustomWidget + * Parameters : None + * Return value: HbWidget + * Description : creates a custom widget + ***************************************************************** + */ +HbWidget *CpRemoteLockDataFormViewItem::createCustomWidget() + { + int type = modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt(); + if (type == CpCodeEditItem) + { + CpLockEdit *edit = new CpLockEdit("1234"); + edit->setEchoMode(HbLineEdit::Password); + edit->setReadOnly(true); + return edit; + } + else + { + return 0; + } +} + + +/* + ***************************************************************** + * Name : CpLockEdit + * Parameters : QString&, QGraphicsitem + * Return value: None + * Description : constructor + ***************************************************************** + */ +CpLockEdit::CpLockEdit(const QString &text, QGraphicsItem *parent /*= 0*/) +: HbLineEdit(text,parent) +{ +} + + +/* + ***************************************************************** + * Name : CpLockEdit + * Parameters : None + * Return value: None + * Description : destructor + ***************************************************************** + */ +CpLockEdit::~CpLockEdit() + { + + } + + +/* + ***************************************************************** + * Name : mousePressEvent + * Parameters : QGraphicsSceneMouseEvent* + * Return value: None + * Description : handles mouse events + ***************************************************************** + */ +void CpLockEdit::mousePressEvent(QGraphicsSceneMouseEvent *event) +{ + if (event->button() != Qt::LeftButton) { + event->ignore(); + return; + } + + if (rect().contains(event->pos())) { + emit clicked(); + event->accept(); + } + else { + event->ignore(); + } +} diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/devicelockplugin/src/cpremotelockdataformviewitem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/devicelockplugin/src/cpremotelockdataformviewitem.h Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,64 @@ +/* + * 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: + * + */ + + +#ifndef CPREMOTELOCKDATAFORMVIEWITEM_H +#define CPREMOTELOCKDATAFORMVIEWITEM_H + +//#include +#include +#include +#include + +class CpRemoteLockDataFormViewItem : public HbDataFormViewItem +{ + Q_OBJECT +public: + enum { CpRemoteLockItem = HbDataFormModelItem::CustomItemBase + 10, + CpCodeEditItem = CpRemoteLockItem + 1 }; + + /* Constructor */ + explicit CpRemoteLockDataFormViewItem(QGraphicsItem *parent = 0); + /* Destructor */ + virtual ~CpRemoteLockDataFormViewItem(); + /* creates a view item */ + virtual HbAbstractViewItem* createItem(); + /**/ + virtual bool canSetModelIndex(const QModelIndex &index) const; +protected: + /* creates a custom widget */ + virtual HbWidget* createCustomWidget(); +}; + + +class CpLockEdit : public HbLineEdit +{ + Q_OBJECT +public: + /* constructor */ + explicit CpLockEdit(const QString &text, QGraphicsItem *parent = 0); + /* destructor */ + virtual ~CpLockEdit(); + /* handles mouse events*/ + void mousePressEvent(QGraphicsSceneMouseEvent *event); +signals: + /* signal when edit box is clicked*/ + void clicked(); +}; + +#endif //CPREMOTELOCKDATAFORMVIEWITEM_H + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/devicelockplugin/src/debug.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/devicelockplugin/src/debug.h Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,58 @@ +/* + * 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: + * + */ + +#if 0 +#ifndef DEBUG_H_ +#define DEBUG_H_ + +#define DL_TRACE( x ) RDebug::Printf( "%s %s (%u) %s", __FILE__, __PRETTY_FUNCTION__, __LINE__, x ); +#define DL_TRACE_NUM( x, y ) RDebug::Printf( "%s %s (%u) %s=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, x, y ); + + +#endif /* DEBUG_H_ */ +#endif + + + + + +#ifndef SCPDEBUG_H +#define SCPDEBUG_H + + _LIT( KLogFile, "SCP.log" ); + _LIT( KLogDir, "tarm" ); + + + +#include +#include +#include +#include + + inline void FWrite (TRefByValue aFmt,...) + { + VA_LIST list; + VA_START( list, aFmt ); + RFileLogger::WriteFormat( KLogDir,KLogFile,EFileLoggingModeAppend ,TPtrC(aFmt) ,list ); + } + + #define Dprint(arg...) FWrite arg; +#else + #define Dprint(arg...) +#endif // _DEBUG + + diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/simpincodeplugin/inc/cppincodeplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/simpincodeplugin/inc/cppincodeplugin.h Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2010 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: + * + */ + +#ifndef CPPINCODEPLUGIN_H +#define CPPINCODEPLUGIN_H + +// System includes +#include + +// User includes +#include + +// Class declaration +class CpPinCodePlugin : public QObject, public CpPluginInterface +{ + Q_OBJECT + Q_INTERFACES(CpPluginInterface) + +public: + CpPinCodePlugin(); + virtual ~CpPinCodePlugin(); + virtual QList createSettingFormItemData( + CpItemDataHelper &itemDataHelper) const; +}; + +#endif //CPPINCODEPLUGIN_H diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/simpincodeplugin/inc/cppincodepluginview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/simpincodeplugin/inc/cppincodepluginview.h Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2010 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: + * + */ + +#ifndef CPPINCODEPLUGINVIEW_H +#define CPPINCODEPLUGINVIEW_H + +// System includes +#include + +// Forward declarations +class SecCodeSettings; +class HbDataFormModelItem; + +// Class declaration +class CpPinCodePluginView : public CpBaseSettingView +{ + Q_OBJECT + +public: + explicit CpPinCodePluginView(QGraphicsItem *parent = 0); + virtual ~CpPinCodePluginView(); + +private slots: + void changePinCode(); + void changePin2Code(); + void changePinCodeRequest(); + +private: + SecCodeSettings *mSecCodeSettings; + HbDataFormModelItem *mPinCodeRequestItem; +}; + +#endif //CPPINCODEPLUGINVIEW_H diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/simpincodeplugin/inc/seccodeedit.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/simpincodeplugin/inc/seccodeedit.h Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2010 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: + * + */ + +#ifndef SECCODEEDIT_H +#define SECCODEEDIT_H + +// System includes +#include + +// Class declaration +class SecCodeEdit : public HbLineEdit +{ + Q_OBJECT + +public: + explicit SecCodeEdit(const QString &text, QGraphicsItem *parent = 0); + virtual ~SecCodeEdit(); + void mousePressEvent(QGraphicsSceneMouseEvent *event); + +signals: + void clicked(); +}; + +#endif //SECCODEEDIT_H diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/simpincodeplugin/inc/seccodeeditdataformviewitem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/simpincodeplugin/inc/seccodeeditdataformviewitem.h Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2010 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: + * + */ + +#ifndef SECCODEEDITDATAFORMVIEWITEM_H +#define SECCODEEDITDATAFORMVIEWITEM_H + +// System includes +#include +#include + +// User includes +#include "seccodeuiglobal.h" + +// Class declaration +class SecCodeEditDataFormViewItem : public HbDataFormViewItem +{ + Q_OBJECT + +public: + enum { SecCodeEditItem = HbDataFormModelItem::CustomItemBase + 1 }; + explicit SecCodeEditDataFormViewItem(QGraphicsItem *parent = 0); + virtual ~SecCodeEditDataFormViewItem(); + virtual HbAbstractViewItem* createItem(); + virtual bool canSetModelIndex(const QModelIndex &index) const; + +protected: + virtual HbWidget* createCustomWidget(); +}; + +#endif //SECCODEEDITDATAFORMVIEWITEM_H diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/simpincodeplugin/inc/seccodemodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/simpincodeplugin/inc/seccodemodel.h Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2010 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: + * + */ + +#ifndef SECCODEMODEL_H +#define SECCODEMODEL_H + +// System includes +#include + +// Forward declarations +class SecCodeModelPrivate; + +// Class declaration +class SecCodeModel : public QObject +{ + Q_OBJECT + +public: + SecCodeModel(QObject *parent = 0); + virtual ~SecCodeModel(); + bool pinCodeRequest() const; + bool changePinCodeRequest(); + int changePinCode(); + int changePin2Code(); + +private: // data + SecCodeModelPrivate *d_ptr; +}; + +#endif //SECCODEMODEL_H diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/simpincodeplugin/inc/seccodemodel_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/simpincodeplugin/inc/seccodemodel_p.h Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2010 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: + * + */ + +#ifndef SECCODEMODEL_P_H +#define SECCODEMODEL_P_H + +// System includes +#include +#include +// Class declaration +class SecCodeModelPrivate +{ +public: + static SecCodeModelPrivate* NewL(); + SecCodeModelPrivate(); + ~SecCodeModelPrivate(); + bool pinCodeRequest() const; + bool changePinCodeRequest(); + int changePinCode(); + int changePin2Code(); + +private: + void ConstructL(); + +private: // data + //to launch SecUI + CSecuritySettings* iSecurity; +}; + +#endif //SECCODEMODEL_P_H diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/simpincodeplugin/inc/seccodesettings.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/simpincodeplugin/inc/seccodesettings.h Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2010 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: + * + */ + +#ifndef SECCODESETTINGS_H +#define SECCODESETTINGS_H + +// System includes +#include +#include "seccodeuiglobal.h" + +// Forward declarations +class SecCodeSettingsPrivate; + +// Class declaration +class SecCodeSettings : public QObject +{ + Q_OBJECT + +public: + explicit SecCodeSettings(QObject *parent = 0); + virtual ~SecCodeSettings(); + bool pinCodeRequest() const; + bool changePinCodeRequest(); + void changePinCode(); + void changePin2Code(); + +private: + SecCodeSettingsPrivate *d_ptr; +}; + +#endif //SECCODESETTINGS_H diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/simpincodeplugin/inc/seccodeuiglobal.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/simpincodeplugin/inc/seccodeuiglobal.h Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,39 @@ +/* + * 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: + * + */ + +#ifndef SECCODEUIGLOBAL_H +#define SECCODEUIGLOBAL_H + +// System includes +#include + +namespace SecCode +{ + enum SecCodeErr + { + ErrNone = 0, + ErrGsm0707IncorrectPassword, + ErrAccessDenied, + ErrGsmSSPasswordAttemptsViolation, + ErrLocked, + ErrGsm0707OperationNotAllowed, + ErrGsm0707SIMPuk2Required, + ErrAbort, + }; +} + +#endif //SECCODEUIGLOBAL_H diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/simpincodeplugin/pincodeplugin.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/simpincodeplugin/pincodeplugin.pri Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,33 @@ +# +# Copyright (c) 2010 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: cppincodeplugin source files +# + +# Input +HEADERS += inc/*.h + +SOURCES += src/cppincodeplugin.cpp \ + src/cppincodepluginview.cpp \ + src/seccodesettings.cpp \ + src/seccodeedit.cpp \ + src/seccodeeditdataformviewitem.cpp \ + src/seccodemodel.cpp + +symbian : { + SOURCES += src/seccodemodel_symbian.cpp +} + +win32 : { + SOURCES += src/seccodemodel_win.cpp +} \ No newline at end of file diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/simpincodeplugin/pincodeplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/simpincodeplugin/pincodeplugin.pro Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,30 @@ +# +# Copyright (c) 2010 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: +# + +TEMPLATE = lib +TARGET = cppincodeplugin + +CONFIG += hb plugin + +include ( ../cpplugincommon.pri ) +include ( pincodeplugin.pri ) +include ( rom/pincodeplugin_rom.pri ) + +LIBS += -lsecui + +symbian : { + TARGET.UID3 = 0x2002E682 +} diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/simpincodeplugin/rom/pincodeplugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/simpincodeplugin/rom/pincodeplugin.iby Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,29 @@ +/* +* 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: +* +*/ + +#ifndef __PINCODEPLUGIN_IBY__ +#define __PINCODEPLUGIN_IBY__ + +#include +#include + +file=ABI_DIR\BUILD_DIR\pincodeplugin.dll SHARED_LIB_DIR\pincodeplugin.dll + +data=\epoc32\data\c\resource\qt\plugins\controlpanel\pincodeplugin.qtplugin +resource\qt\plugins\controlpanel\pincodeplugin.qtplugin + +#endif diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/simpincodeplugin/rom/pincodeplugin_rom.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/simpincodeplugin/rom/pincodeplugin_rom.pri Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,21 @@ +# +# 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: +# + +symbian { + BLD_INF_RULES.prj_exports += \ + "$${LITERAL_HASH}include" \ + "rom/pincodeplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(pincodeplugin.iby)" +} \ No newline at end of file diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/simpincodeplugin/src/cppincodeplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/simpincodeplugin/src/cppincodeplugin.cpp Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2010 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: + * + */ + +// System includes +#include + +// User includes +#include "cppincodeplugin.h" +#include "cppincodepluginview.h" + +/*! + \class CpPinCodePlugin + \brief Pin Code Setting plugin class + + This class is used to create PIN code setting +*/ + +// ======== LOCAL FUNCTIONS ======== + +/*! + Constructor +*/ +CpPinCodePlugin::CpPinCodePlugin() +{ +} + +/*! + Destructor +*/ +CpPinCodePlugin::~CpPinCodePlugin() +{ +} + +/*! + Create PinCode setting +*/ +QList CpPinCodePlugin::createSettingFormItemData( + CpItemDataHelper &itemDataHelper) const +{ + return QList() + << new CpSettingFormEntryItemDataImpl + (itemDataHelper, tr("PIN code"), QString()); +} + +/*! + Export plugin +*/ +Q_EXPORT_PLUGIN2(cppincodeplugin, CpPinCodePlugin); diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/simpincodeplugin/src/cppincodepluginview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/simpincodeplugin/src/cppincodepluginview.cpp Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2010 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: + * + */ + +// System includes +#include +#include +#include +#include +#include +#include + +// User includes +#include "cppincodepluginview.h" + +/*! + \class CpPinCodePluginView + \brief Pin Code Setting view class + + This class is used to create PIN code setting view +*/ + +// ======== LOCAL FUNCTIONS ======== + +/*! + Constructor +*/ +CpPinCodePluginView::CpPinCodePluginView(QGraphicsItem *parent /*= 0*/) + : CpBaseSettingView(0,parent), mSecCodeSettings(new SecCodeSettings()) +{ + HbDataForm *form = settingForm(); + if (form) { + QList protoTypeList = form->itemPrototypes(); + protoTypeList.append(new SecCodeEditDataFormViewItem()); + form->setItemPrototypes(protoTypeList); + form->setHeading(tr("PIN code")); + + HbDataFormModel *formModel = new HbDataFormModel(); + mPinCodeRequestItem = new HbDataFormModelItem( + HbDataFormModelItem::ToggleValueItem, tr("PIN code requests")); + + bool currentPinCodeRequest = mSecCodeSettings->pinCodeRequest(); + if (currentPinCodeRequest) { + mPinCodeRequestItem->setContentWidgetData("text", tr("On")); + mPinCodeRequestItem->setContentWidgetData("additionalText", tr("On")); + } else { + mPinCodeRequestItem->setContentWidgetData("text",tr("Off")); + mPinCodeRequestItem->setContentWidgetData("additionalText", tr("Off")); + } + + form->addConnection(mPinCodeRequestItem, SIGNAL(clicked()), this, + SLOT(changePinCodeRequest())); + formModel->appendDataFormItem(mPinCodeRequestItem); + + HbDataFormModelItem *pinCodeItem = new HbDataFormModelItem( + static_cast + (SecCodeEditDataFormViewItem::SecCodeEditItem), tr("PIN code")); + pinCodeItem->setContentWidgetData("echoMode", HbLineEdit::Password); + pinCodeItem->setContentWidgetData("text", "1111"); + pinCodeItem->setContentWidgetData("readOnly", true); + form->addConnection(pinCodeItem, SIGNAL(clicked()), this, + SLOT(changePinCode())); + formModel->appendDataFormItem(pinCodeItem); + + HbDataFormModelItem *pin2CodeItem = new HbDataFormModelItem( + static_cast + (SecCodeEditDataFormViewItem::SecCodeEditItem), tr("PIN2 code")); + pin2CodeItem->setContentWidgetData("echoMode", HbLineEdit::Password); + pin2CodeItem->setContentWidgetData("text", "1111"); + pin2CodeItem->setContentWidgetData("readOnly", true); + form->addConnection(pin2CodeItem, SIGNAL(clicked()), this, + SLOT(changePin2Code())); + formModel->appendDataFormItem(pin2CodeItem); + + form->setModel(formModel); + } +} + +/*! + Destructor +*/ +CpPinCodePluginView::~CpPinCodePluginView() +{ + delete mSecCodeSettings; +} + +/*! + response for click pin code +*/ +void CpPinCodePluginView::changePinCode() +{ + mSecCodeSettings->changePinCode(); +} + +/*! + response for click pin2 code +*/ +void CpPinCodePluginView::changePin2Code() +{ + mSecCodeSettings->changePin2Code(); +} + +/*! + response for click pin code request +*/ +void CpPinCodePluginView::changePinCodeRequest() +{ + if (mSecCodeSettings->changePinCodeRequest()) { + QString text = mPinCodeRequestItem->contentWidgetData("text").toString(); + if (0 == text.compare("On")) { + mPinCodeRequestItem->setContentWidgetData("text", + tr("Off")); + mPinCodeRequestItem->setContentWidgetData("additionalText", + tr("Off")); + } else { + mPinCodeRequestItem->setContentWidgetData("text", + tr("On")); + mPinCodeRequestItem->setContentWidgetData("additionalText", + tr("On")); + } + } +} diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/simpincodeplugin/src/seccodeedit.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/simpincodeplugin/src/seccodeedit.cpp Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2010 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: + * + */ + +// System includes +#include + +// User includes +#include "seccodeedit.h" + +// ======== MEMBER FUNCTIONS ======== + +/*! + Constructor +*/ +SecCodeEdit::SecCodeEdit(const QString &text, QGraphicsItem *parent/*= 0*/) + : HbLineEdit(text, parent) +{ +} + +/*! + Destructor +*/ +SecCodeEdit::~SecCodeEdit() +{ +} + +/*! + Mouse Press Event +*/ +void SecCodeEdit::mousePressEvent(QGraphicsSceneMouseEvent *event) +{ + if (event->button() != Qt::LeftButton) { + event->ignore(); + return; + } + + if (rect().contains(event->pos())) { + emit clicked(); + event->accept(); + } else { + event->ignore(); + } +} diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/simpincodeplugin/src/seccodeeditdataformviewitem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/simpincodeplugin/src/seccodeeditdataformviewitem.cpp Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2010 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: + * + */ + +// User includes +#include "seccodeeditdataformviewitem.h" +#include "seccodeedit.h" + +// ======== MEMBER FUNCTIONS ======== + +/*! + Constructor +*/ +SecCodeEditDataFormViewItem::SecCodeEditDataFormViewItem( + QGraphicsItem *parent): HbDataFormViewItem(parent) +{ +} + +/*! + Destructor +*/ +SecCodeEditDataFormViewItem::~SecCodeEditDataFormViewItem() +{ +} + +/*! + Create Item +*/ +HbAbstractViewItem *SecCodeEditDataFormViewItem::createItem() +{ + return new SecCodeEditDataFormViewItem( *this); +} + +/*! + Create Item +*/ +bool SecCodeEditDataFormViewItem::canSetModelIndex( + const QModelIndex &index) const +{ + int type = index.data(HbDataFormModelItem::ItemTypeRole).toInt(); + return type == SecCodeEditItem; +} + +/*! + Create Custom Widget +*/ +HbWidget *SecCodeEditDataFormViewItem::createCustomWidget() +{ + int type = modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt(); + + if (type == SecCodeEditItem) { + SecCodeEdit *edit = new SecCodeEdit("1234"); + edit->setEchoMode(HbLineEdit::Password); + edit->setReadOnly(true); + return edit; + } + + return 0; +} diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/simpincodeplugin/src/seccodemodel.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/simpincodeplugin/src/seccodemodel.cpp Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2010 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: + * + */ + +// User includes +#include "seccodemodel.h" +#include "seccodemodel_p.h" + +// ======== MEMBER FUNCTIONS ======== + +/*! + Constructor +*/ +SecCodeModel::SecCodeModel(QObject *parent/*= 0*/) + : QObject(parent) +{ + QT_TRAP_THROWING(d_ptr = SecCodeModelPrivate::NewL()); +} + +/*! + Destructor +*/ +SecCodeModel::~SecCodeModel() +{ + delete d_ptr; +} + +/*! + Get Pin Code Request State +*/ +bool SecCodeModel::pinCodeRequest() const +{ + return d_ptr->pinCodeRequest(); +} + +/*! + Change Pin Code +*/ +bool SecCodeModel::changePinCodeRequest() +{ + return d_ptr->changePinCodeRequest(); +} + +/*! + Change Pin Code +*/ +int SecCodeModel::changePinCode() +{ + return d_ptr->changePinCode(); +} + +/*! + Change Pin2 Code +*/ +int SecCodeModel::changePin2Code() +{ + return d_ptr->changePin2Code(); +} diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/simpincodeplugin/src/seccodemodel_symbian.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/simpincodeplugin/src/seccodemodel_symbian.cpp Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2010 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: + * + */ + +// System includes +#include +#include +#include + +// User includes +#include "seccodemodel_p.h" +#include "seccodeuiglobal.h" + +// ======== MEMBER FUNCTIONS ======== + +/*! + NewL +*/ +SecCodeModelPrivate* SecCodeModelPrivate::NewL() +{ + SecCodeModelPrivate* self = new (ELeave) SecCodeModelPrivate(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); //self + return self; +} + +/*! + SecCodeModelPrivate +*/ +SecCodeModelPrivate::SecCodeModelPrivate() +{ +} + +/*! + ConstructL +*/ +void SecCodeModelPrivate::ConstructL() +{ + iSecurity = CSecuritySettings::NewL(); +} + +/*! + Destructor +*/ +SecCodeModelPrivate::~SecCodeModelPrivate() +{ + if (iSecurity) { + delete iSecurity; + } +} + +/*! + Get Pin Code Request State +*/ +bool SecCodeModelPrivate::pinCodeRequest() const +{ + bool isLockEnabled = false; + QT_TRAP_THROWING(isLockEnabled = iSecurity->IsLockEnabledL( + RMobilePhone::ELockICC)); + return isLockEnabled; +} + +/*! + Get the Change Pin Remaining Attempts +*/ +bool SecCodeModelPrivate::changePinCodeRequest() +{ + bool result = false; + QT_TRAP_THROWING(result =iSecurity->ChangePinRequestL()); + return result; +} + +/*! + Change Pin Code +*/ +int SecCodeModelPrivate::changePinCode() +{ + QT_TRAP_THROWING(iSecurity->ChangePinL()); + return 0; +} + +/*! + Change Pin2 Code +*/ +int SecCodeModelPrivate::changePin2Code() +{ + QT_TRAP_THROWING(iSecurity->ChangePin2L()); + return 0; +} diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/simpincodeplugin/src/seccodemodel_win.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/simpincodeplugin/src/seccodemodel_win.cpp Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2010 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: + * + */ + +// User includes +#include "seccodemodel_p.h" + +// ======== MEMBER FUNCTIONS ======== +/*! + NewL +*/ +SecCodeModelPrivate* SecCodeModelPrivate::NewL() +{ + return NULL; +} + +/*! + Constructor +*/ +SecCodeModelPrivate::SecCodeModelPrivate() +{ +} + +/*! + ConstructL +*/ +void SecCodeModelPrivate::ConstructL() +{ + +} + +/*! + Destructor +*/ +SecCodeModelPrivate::~SecCodeModelPrivate() +{ +} + +/*! + Get Pin Code Request State +*/ +bool SecCodeModelPrivate::pinCodeRequest() const +{ + QString information; + information = QString("Emulator NOT supported!"); + HbMessageBox messageBox(information); + messageBox.exec(); + return false; +} + +/*! + Get the Change Pin Remaining Attempts +*/ +bool SecCodeModelPrivate::changePinCodeRequest() +{ + QString information; + information = QString("Emulator NOT supported!"); + HbMessageBox messageBox(information); + messageBox.exec(); + return true; +} + +/*! + Change Pin Code +*/ +int SecCodeModelPrivate::changePinCode() +{ + QString information; + information = QString("Emulator NOT supported!"); + HbMessageBox messageBox(information); + messageBox.exec(); + return 0; +} + +/*! + Change Pin2 Code +*/ +int SecCodeModelPrivate::changePin2Code() +{ + QString information; + information = QString("Emulator NOT supported!"); + HbMessageBox messageBox(information); + messageBox.exec(); + return 0; +} diff -r 8957df7b0072 -r 098e361762d2 cpsecplugins/simpincodeplugin/src/seccodesettings.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cpsecplugins/simpincodeplugin/src/seccodesettings.cpp Fri May 14 16:43:26 2010 +0300 @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2010 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: + * + */ + +// User includes +#include "seccodesettings.h" +#include "seccodemodel.h" + +// Class declaration +class SecCodeSettingsPrivate +{ +public: + SecCodeSettingsPrivate() + { + mSecCodeModel = new SecCodeModel(); + } + + ~SecCodeSettingsPrivate() + { + delete mSecCodeModel; + } + + SecCodeModel *mSecCodeModel; +}; + +// ======== MEMBER FUNCTIONS ======== + +/*! + Constructor +*/ +SecCodeSettings::SecCodeSettings(QObject * parent /*= 0*/) + : QObject(parent), d_ptr(new SecCodeSettingsPrivate()) +{ + +} + +/*! + Destructor +*/ +SecCodeSettings::~SecCodeSettings() +{ + delete d_ptr; +} + +/*! + Get Pin Code Request +*/ +bool SecCodeSettings::pinCodeRequest() const +{ + return d_ptr->mSecCodeModel->pinCodeRequest(); +} + +/*! + Change Pin Code request +*/ +bool SecCodeSettings::changePinCodeRequest() +{ + return d_ptr->mSecCodeModel->changePinCodeRequest(); +} + +/*! + Change Pin Code +*/ +void SecCodeSettings::changePinCode() +{ + d_ptr->mSecCodeModel->changePinCode(); +} + +/*! + Change Pin2 Code +*/ +void SecCodeSettings::changePin2Code() +{ + d_ptr->mSecCodeModel->changePin2Code(); +} diff -r 8957df7b0072 -r 098e361762d2 securitydialogs/Autolock/src/AutoKeyguardObserver.cpp --- a/securitydialogs/Autolock/src/AutoKeyguardObserver.cpp Mon May 03 13:20:16 2010 +0300 +++ b/securitydialogs/Autolock/src/AutoKeyguardObserver.cpp Fri May 14 16:43:26 2010 +0300 @@ -27,7 +27,7 @@ #include #include #include -#include +// #include #include // #include #include @@ -349,8 +349,8 @@ //See whether we are in idle value = 0; - RProperty::Get(KPSUidAiInformation, KActiveIdleState, value); - idle = (value == EPSAiForeground); + // RProperty::Get(KPSUidAiInformation, KActiveIdleState, value); + // idle = (value == EPSAiForeground); idle = ETrue; // don't care about idle state. Phone should autolock on any UI, not only HomeSreeen. value = 0; diff -r 8957df7b0072 -r 098e361762d2 securitydialogs/AutolockSrv/indicatortestplugin.zip Binary file securitydialogs/AutolockSrv/indicatortestplugin.zip has changed diff -r 8957df7b0072 -r 098e361762d2 securitydialogs/AutolockSrv/src/AutolockSrv.cpp --- a/securitydialogs/AutolockSrv/src/AutolockSrv.cpp Mon May 03 13:20:16 2010 +0300 +++ b/securitydialogs/AutolockSrv/src/AutolockSrv.cpp Fri May 14 16:43:26 2010 +0300 @@ -45,8 +45,6 @@ #include #include -#include "../../SecUi/inc/SecQueryUi.h" - #include #include @@ -61,7 +59,6 @@ #include "autolockuseractivityservice.h" #include // CenRep keys - #include #include @@ -84,28 +81,26 @@ #include -const TInt KPhoneIndex( 0 ); -const TInt KTriesToConnectServer( 2 ); -const TInt KTimeBeforeRetryingServerConnection( 50000 ); +const TInt KPhoneIndex(0); +const TInt KTriesToConnectServer(2); +const TInt KTimeBeforeRetryingServerConnection(50000); #define ESecUiTypeLock 0x00100000 -_LIT( KMmTsyModuleName, "PhoneTsy"); - +_LIT( KMmTsyModuleName, "PhoneTsy"); #define XQSERVICE_DEBUG_PRINT(a) qDebug() << (a) -AutolockSrv::AutolockSrv(QWidget *parent, Qt::WFlags f) - : QWidget(parent, f), - mService(NULL) -{ +AutolockSrv::AutolockSrv(QWidget *parent, Qt::WFlags f) : + QWidget(parent, f), mService(NULL) + { XQSERVICE_DEBUG_PRINT("AutolockSrv::AutolockSrv"); - RDEBUG( "start", 0 ); + RDEBUG("start", 0); mService = new AutolockSrvService(this); /* Adjust the palette */ #if defined(Q_WS_S60) - RDEBUG( "Q_WS_S60", 1 ); + RDEBUG( "Q_WS_S60", 1 ); QPalette p = qApp->palette(); QColor color(192,192,192); QColor bg(201,250,250); @@ -133,32 +128,34 @@ connect(unguardButton, SIGNAL(clicked()), this, SLOT(unguardAction())); connect(test1Button, SIGNAL(clicked()), this, SLOT(test1Action())); connect(test2Button, SIGNAL(clicked()), this, SLOT(test2Action())); - RDEBUG( "connect", 1 ); + RDEBUG("connect", 1); - /* there's no use for this */ - /* - bool isService = XQServiceUtil::isService(); - - QString t = "SERVICEAPP:\n"; - t = t + (isService ? " LAUNCHED AS SERVICE\n" : " LAUNCHED NORMALLY\n"); - t = t + (XQServiceUtil::isEmbedded() ? " EMBEDDED\n" : " NOT EMBEDDED\n"); - - QStringList args = QApplication::arguments(); - foreach (QString arg, args) - { - t += "cmdline arg=" + arg + "\n"; - } - - QLabel *title = new QLabel(t); - */ + /* there's no use for this */ + /* + bool isService = XQServiceUtil::isService(); + + QString t = "SERVICEAPP:\n"; + t = t + (isService ? " LAUNCHED AS SERVICE\n" : " LAUNCHED NORMALLY\n"); + t = t + (XQServiceUtil::isEmbedded() ? " EMBEDDED\n" : " NOT EMBEDDED\n"); + + QStringList args = QApplication::arguments(); + foreach (QString arg, args) + { + t += "cmdline arg=" + arg + "\n"; + } + + QLabel *title = new QLabel(t); + */ mLabel = new QLabel(""); mNumberEdit = new QLineEdit(""); - + QVBoxLayout *vl = new QVBoxLayout; + RDEBUG("QVBoxLayout", 1); vl->setMargin(0); vl->setSpacing(0); + RDEBUG("setSpacing", 1); vl->addWidget(lockButton); vl->addWidget(unlockButton); @@ -166,47 +163,48 @@ vl->addWidget(quitButton); vl->addWidget(test1Button); vl->addWidget(test2Button); - RDEBUG( "added test2Button", 1 ); + RDEBUG("added test2Button", 1); mLabelIcon = new QToolButton; - mLabelIcon->setIcon(QIcon(":/AutolockSrv_hbicon/qtg_large_device_lock.svg")); - mLabelIcon->setIconSize(QSize(300,300)); - + mLabelIcon->setIcon(QIcon( + ":/AutolockSrv_hbicon/qtg_large_device_lock.svg")); + mLabelIcon->setIconSize(QSize(300, 300)); + vl->addWidget(mLabelIcon); - RDEBUG( "added mLabelIcon", 1 ); + RDEBUG("added mLabelIcon", 1); -/* vl->addItem(title); - vl->addWidget(mLabel); - vl->addWidget(mNumberEdit); -*/ + /* vl->addItem(title); + vl->addWidget(mLabel); + vl->addWidget(mNumberEdit); + */ setLayout(vl); - + #if defined(Q_WS_X11) || defined(Q_WS_WIN) setFixedSize(QSize(360,640)); // nHD #elif defined(Q_WS_S60) // showMaximized(); showFullScreen(); #endif - mLabelIcon_visible=1; - serviceKeyguard = new AutolockUserActivityService(); - serviceDevicelock = new AutolockUserActivityService(); + mLabelIcon_visible = 1; + serviceKeyguard = new AutolockUserActivityService(); + serviceDevicelock = new AutolockUserActivityService(); - TInt lockValue = 0; - TInt lightsTimeout = 0; + TInt lockValue = 0; + TInt lightsTimeout = 0; CRepository* repository; - TInt cRresult=0; - - iLockStatusPrev=ELockNotActive; - iLockStatus=ELockNotActive; + TInt cRresult = 0; + + iLockStatusPrev = ELockNotActive; + iLockStatus = ELockNotActive; repository = CRepository::NewL(KCRUidSecuritySettings); cRresult = repository->Get(KSettingsAutolockStatus, lockValue); - RDEBUG( "KSettingsAutolockStatus", KSettingsAutolockStatus ); - RDEBUG( "cRresult", cRresult ); - RDEBUG( "lockValue", lockValue ); + RDEBUG("KSettingsAutolockStatus", KSettingsAutolockStatus); + RDEBUG("cRresult", cRresult); + RDEBUG("lockValue", lockValue); iLockStatus = lockValue; // the settings says to lock delete repository; - + adjustInactivityTimers(0); repository = CRepository::NewL(KCRUidProfileEngine); @@ -217,388 +215,453 @@ cRresult = repository->Get(KDisplayLightsTimeout, lightsTimeout); delete repository; - // TODO flip - - subscriberKSettingsAutolockStatus = new QValueSpaceSubscriber("/KCRUidSecuritySettings/KSettingsAutolockStatus", this); - connect(subscriberKSettingsAutolockStatus, SIGNAL(contentsChanged()), this, SLOT(subscriberKSettingsAutolockStatusChanged())); - subscriberKSettingsAutoLockTime = new QValueSpaceSubscriber("/KCRUidSecuritySettings/KSettingsAutoLockTime", this); - connect(subscriberKSettingsAutoLockTime, SIGNAL(contentsChanged()), this, SLOT(subscriberKSettingsAutoLockTimeChanged())); - subscriberKSettingsAutomaticKeyguardTime = new QValueSpaceSubscriber("/KCRUidSecuritySettings/KSettingsAutomaticKeyguardTime", this); - connect(subscriberKSettingsAutomaticKeyguardTime, SIGNAL(contentsChanged()), this, SLOT(subscriberKSettingsAutomaticKeyguardTimeChanged())); - subscriberKDisplayLightsTimeout = new QValueSpaceSubscriber("/KCRUidLightSettings/KDisplayLightsTimeout", this); - connect(subscriberKDisplayLightsTimeout, SIGNAL(contentsChanged()), this, SLOT(subscriberKDisplayLightsTimeoutChanged())); - subscriberKProEngActiveProfile = new QValueSpaceSubscriber("/KCRUidProfileEngine/KProEngActiveProfile", this); - connect(subscriberKProEngActiveProfile, SIGNAL(contentsChanged()), this, SLOT(subscriberKProEngActiveProfileChanged())); + // TODO flip + subscriberKSettingsAutolockStatus = new QValueSpaceSubscriber( + "/KCRUidSecuritySettings/KSettingsAutolockStatus", this); + connect(subscriberKSettingsAutolockStatus, SIGNAL(contentsChanged()), + this, SLOT(subscriberKSettingsAutolockStatusChanged())); + subscriberKSettingsAutoLockTime = new QValueSpaceSubscriber( + "/KCRUidSecuritySettings/KSettingsAutoLockTime", this); + connect(subscriberKSettingsAutoLockTime, SIGNAL(contentsChanged()), this, + SLOT(subscriberKSettingsAutoLockTimeChanged())); + subscriberKSettingsAutomaticKeyguardTime = new QValueSpaceSubscriber( + "/KCRUidSecuritySettings/KSettingsAutomaticKeyguardTime", this); + connect(subscriberKSettingsAutomaticKeyguardTime, SIGNAL( + contentsChanged()), this, SLOT( + subscriberKSettingsAutomaticKeyguardTimeChanged())); + subscriberKDisplayLightsTimeout = new QValueSpaceSubscriber( + "/KCRUidLightSettings/KDisplayLightsTimeout", this); + connect(subscriberKDisplayLightsTimeout, SIGNAL(contentsChanged()), this, + SLOT(subscriberKDisplayLightsTimeoutChanged())); + subscriberKProEngActiveProfile = new QValueSpaceSubscriber( + "/KCRUidProfileEngine/KProEngActiveProfile", this); + connect(subscriberKProEngActiveProfile, SIGNAL(contentsChanged()), this, + SLOT(subscriberKProEngActiveProfileChanged())); - TSecurityPolicy readPolicy( ECapabilityReadDeviceData ); - TSecurityPolicy writePolicy( ECapabilityWriteDeviceData ); - TInt ret = RProperty::Define( KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, RProperty::EInt, readPolicy, writePolicy ); - RDEBUG( "defined KSecurityUIsSecUIOriginatedQuery", ret ); - ret = RProperty::Define( KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, RProperty::EInt, readPolicy, writePolicy ); - RDEBUG( "defined KSecurityUIsQueryRequestCancel", ret ); + TSecurityPolicy readPolicy(ECapabilityReadDeviceData); + TSecurityPolicy writePolicy(ECapabilityWriteDeviceData); + TInt ret = RProperty::Define(KPSUidSecurityUIs, + KSecurityUIsSecUIOriginatedQuery, RProperty::EInt, readPolicy, + writePolicy); + RDEBUG("defined KSecurityUIsSecUIOriginatedQuery", ret); + ret = RProperty::Define(KPSUidSecurityUIs, + KSecurityUIsQueryRequestCancel, RProperty::EInt, readPolicy, + writePolicy); + RDEBUG("defined KSecurityUIsQueryRequestCancel", ret); - _LIT_SECURITY_POLICY_PASS(KReadPolicy); + _LIT_SECURITY_POLICY_PASS( KReadPolicy); _LIT_SECURITY_POLICY_C1(KWritePolicy, ECapabilityWriteDeviceData); - ret = RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, RProperty::EInt, KReadPolicy, KWritePolicy); - RDEBUG( "defined KCoreAppUIsAutolockStatus", ret ); + ret = RProperty::Define(KPSUidCoreApplicationUIs, + KCoreAppUIsAutolockStatus, RProperty::EInt, KReadPolicy, + KWritePolicy); + RDEBUG("defined KCoreAppUIsAutolockStatus", ret); + + ret = RProperty::Define(KPSUidAvkonDomain, KAknKeyguardStatus, + RProperty::EInt, TSecurityPolicy(TSecurityPolicy::EAlwaysPass), + KWritePolicy); + RDEBUG("defined KAknKeyguardStatus", ret); - ret = RProperty::Define(KPSUidAvkonDomain, KAknKeyguardStatus, RProperty::EInt, TSecurityPolicy(TSecurityPolicy::EAlwaysPass), KWritePolicy); - RDEBUG( "defined KAknKeyguardStatus", ret ); - - // inactivity - connect(serviceKeyguard, SIGNAL(active()), this, SLOT(activeKeyguard()) ); - connect(serviceKeyguard, SIGNAL(notActive()), this, SLOT(notActiveKeyguard()) ); - connect(serviceDevicelock, SIGNAL(active()), this, SLOT(activeDevicelock()) ); - connect(serviceDevicelock, SIGNAL(notActive()), this, SLOT(notActiveDevicelock()) ); + ret = RProperty::Define(KPSUidSecurityUIs, + KSecurityUIsLockInitiatorUID, RProperty::EInt, readPolicy, + writePolicy); + RDEBUG("defined KSecurityUIsLockInitiatorUID", ret); + + ret = RProperty::Define(KPSUidSecurityUIs, + KSecurityUIsLockInitiatorTimeHigh, RProperty::EInt, readPolicy, + writePolicy); + RDEBUG("defined KSecurityUIsLockInitiatorTimeHigh", ret); + ret = RProperty::Define(KPSUidSecurityUIs, + KSecurityUIsLockInitiatorTimeLow, RProperty::EInt, readPolicy, + writePolicy); + RDEBUG("defined KSecurityUIsLockInitiatorTimeLow", ret); - RWindowGroup& groupWin=CEikonEnv::Static()->RootWin(); - RDEBUG( "got groupWin", 1 ); + ret = RProperty::Define(KPSUidSecurityUIs, KSecurityUIsLights, + RProperty::EInt, TSecurityPolicy(TSecurityPolicy::EAlwaysPass), + TSecurityPolicy(TSecurityPolicy::EAlwaysPass)); + RDEBUG("defined KAknKeyguardStatus", ret); + + // inactivity + connect(serviceKeyguard, SIGNAL(active()), this, SLOT(activeKeyguard())); + connect(serviceKeyguard, SIGNAL(notActive()), this, SLOT( + notActiveKeyguard())); + connect(serviceDevicelock, SIGNAL(active()), this, SLOT( + activeDevicelock())); + connect(serviceDevicelock, SIGNAL(notActive()), this, SLOT( + notActiveDevicelock())); + + RWindowGroup& groupWin = CEikonEnv::Static()->RootWin(); + RDEBUG("got groupWin", 1); // TODO if I want to release, I should do: mKeyCaptureHandle = env->RootWin().CaptureKey(EKeyBackspace, 0, 0); - groupWin.CaptureKey(EKeyBackspace,0,0); - groupWin.CaptureKey(EKeyDeviceF,0,0); - groupWin.CaptureKey(EKeyBell,0,0); - groupWin.CaptureKey(EKeyTab,0,0); - groupWin.CaptureKey(EKeyInsert,0,0); - RDEBUG( "got mKeyCaptureHandle", 1 ); + groupWin.CaptureKey(EKeyBackspace, 0, 0); + groupWin.CaptureKey(EKeyDeviceF, 0, 0); + groupWin.CaptureKey(EKeyBell, 0, 0); + groupWin.CaptureKey(EKeyTab, 0, 0); + groupWin.CaptureKey(EKeyInsert, 0, 0); + RDEBUG("got mKeyCaptureHandle", 1); - iSecQueryUiCreated=-1; - iDeviceDialogCreated = -1; - // TODO for now, always starts unlocked - // TryChangeStatus(iLockStatus); - TryChangeStatus(ELockNotActive); - lower(); + iSecQueryUiCreated = -1; + iDeviceDialogCreated = -1; + // TODO for now, always starts unlocked + // TryChangeStatus(iLockStatus); + TryChangeStatus( ELockNotActive); + lower(); hide(); - // not needed: new AutolockSrvService(this); -} - + // not needed: new AutolockSrvService(this); + } AutolockSrv::~AutolockSrv() -{ - RDEBUG( "0", 0 ); + { + RDEBUG("0", 0); delete mService; -} + } void AutolockSrv::adjustInactivityTimers(int aReason) -{ - RDEBUG( "aReason", aReason ); - TInt keyguardTime = 0; - TInt lockTime = 0; + { + RDEBUG("aReason", aReason); + TInt keyguardTime = 0; + TInt lockTime = 0; CRepository* repository; - TInt cRresult = 0; + TInt cRresult = 0; repository = CRepository::NewL(KCRUidSecuritySettings); - cRresult = repository->Get(KSettingsAutoLockTime, lockTime); - RDEBUG( "KSettingsAutoLockTime", KSettingsAutoLockTime ); - RDEBUG( "cRresult", cRresult ); - RDEBUG( "lockTime", lockTime ); - if(lockTime>0 && lockTime<1000) - { - serviceDevicelock->setInactivityPeriod(lockTime); - } - else - { - serviceDevicelock->setInactivityPeriod(12*31*24*60*60); - } + cRresult = repository->Get(KSettingsAutoLockTime, lockTime); // in minutes, handled internally as seconds + lockTime *= 60; + RDEBUG("KSettingsAutoLockTime", KSettingsAutoLockTime); + RDEBUG("cRresult", cRresult); + RDEBUG("lockTime", lockTime); + if (lockTime > 60 && lockTime < 24*60*60) // lock timer can't be bigger than 1 day + { + serviceDevicelock->setInactivityPeriod(lockTime); + } + else + { + serviceDevicelock->setInactivityPeriod(12 * 31 * 24 * 60 * 60); // 0x1ea6e00 + } - cRresult = repository->Get(KSettingsAutomaticKeyguardTime, keyguardTime); - RDEBUG( "KSettingsAutomaticKeyguardTime", KSettingsAutomaticKeyguardTime ); - RDEBUG( "cRresult", cRresult ); - RDEBUG( "keyguardTime", keyguardTime ); - if(keyguardTime>0 && keyguardTime<1000) - { - serviceKeyguard->setInactivityPeriod(keyguardTime); - } - else - { - serviceKeyguard->setInactivityPeriod(12*31*24*60*60); - } + cRresult = repository->Get(KSettingsAutomaticKeyguardTime, keyguardTime); // in seconds + RDEBUG("KSettingsAutomaticKeyguardTime", KSettingsAutomaticKeyguardTime); + RDEBUG("cRresult", cRresult); + RDEBUG("keyguardTime", keyguardTime); + if (keyguardTime > 0 && keyguardTime < 1000) + { + serviceKeyguard->setInactivityPeriod(keyguardTime); + } + else + { + serviceKeyguard->setInactivityPeriod(12 * 31 * 24 * 60 * 60); + } delete repository; -} + } void AutolockSrv::quit() -{ - RDEBUG( "0", 0 ); + { + RDEBUG("0", 0); qApp->quit(); -} + } // from the button void AutolockSrv::unlockAction() -{ - RDEBUG( "0", 0 ); - TryChangeStatus(ELockAppDisableDevicelock); -} + { + RDEBUG("0", 0); + TryChangeStatus( ELockAppDisableDevicelock); + } void AutolockSrv::unguardAction() -{ - RDEBUG( "0", 0 ); - TryChangeStatus(ELockAppDisableKeyguard); -} + { + RDEBUG("0", 0); + TryChangeStatus( ELockAppDisableKeyguard); + } void AutolockSrv::test1Action() -{ - RDEBUG( "Set(KSettingsAutoLockTime, 30000)", 30000 ); + { + RDEBUG("Set(KSettingsAutoLockTime, 2)", 2); CRepository* repositorySet = CRepository::NewL(KCRUidSecuritySettings); - repositorySet->Set(KSettingsAutoLockTime, 10); + repositorySet->Set(KSettingsAutoLockTime, 2); // in minutes delete repositorySet; -} + } void AutolockSrv::test2Action() -{ - RDEBUG( "Set(KSettingsAutoLockTime, 20000)", 20000 ); + { + RDEBUG("Set(KSettingsAutoLockTime, 0)", 0); CRepository* repositorySet = CRepository::NewL(KCRUidSecuritySettings); - repositorySet->Set(KSettingsAutoLockTime, 0); + repositorySet->Set(KSettingsAutoLockTime, 0); // minutes delete repositorySet; -} + } int AutolockSrv::AskValidSecCode(int aReason) -{ - RDEBUG( "aReason", aReason ); -RMobilePhone iPhone; // NULL in emulator + { + RDEBUG("aReason", aReason); + RMobilePhone iPhone; // NULL in emulator #ifdef __WINS__1 -return KErrNone; + return KErrNone; #endif -TInt err( KErrGeneral); -TBool validCode(EFalse); -TInt thisTry( 0); -RTelServer iTelServer; + + TInt err(KErrGeneral); + TBool validCode(EFalse); + TInt thisTry(0); + RTelServer iTelServer; + + err = RProperty::Set(KPSUidSecurityUIs, + KSecurityUIsLights, ESecurityUIsLightsQueryOnRequest); + RDEBUG("KSecurityUIsLights err", err); -RMmCustomAPI iCustomPhone; -while ( ( err = iTelServer.Connect() ) != KErrNone && ( thisTry++ ) <= KTriesToConnectServer ) - { - User::After( KTimeBeforeRetryingServerConnection ); - } -err = iTelServer.LoadPhoneModule( KMmTsyModuleName ); -RTelServer::TPhoneInfo PhoneInfo; - RDEBUG( "err", err ); -err = iTelServer.SetExtendedErrorGranularity( RTelServer::EErrorExtended ) ; - RDEBUG( "err", err ); -err = iTelServer.GetPhoneInfo( KPhoneIndex, PhoneInfo ) ; - RDEBUG( "err", err ); -err = iPhone.Open( iTelServer, PhoneInfo.iName ) ; - RDEBUG( "err", err ); -err = iCustomPhone.Open( iPhone ) ; - RDEBUG( "err", err ); + RMmCustomAPI iCustomPhone; + while ((err = iTelServer.Connect()) != KErrNone && (thisTry++) + <= KTriesToConnectServer) + { + User::After( KTimeBeforeRetryingServerConnection); + } + err = iTelServer.LoadPhoneModule(KMmTsyModuleName); + RTelServer::TPhoneInfo PhoneInfo; + RDEBUG("err", err); + err = iTelServer.SetExtendedErrorGranularity(RTelServer::EErrorExtended); + RDEBUG("err", err); + err = iTelServer.GetPhoneInfo(KPhoneIndex, PhoneInfo); + RDEBUG("err", err); + err = iPhone.Open(iTelServer, PhoneInfo.iName); + RDEBUG("err", err); + err = iCustomPhone.Open(iPhone); + RDEBUG("err", err); - RDEBUG( "CSecurityHandler", 0 ); -CSecurityHandler* handler = new(ELeave) CSecurityHandler(iPhone); -if(aReason==ELockAppDisableDevicelock) - { - RDEBUG( "calling AskSecCodeInAutoLockL", 0 ); - validCode = handler->AskSecCodeInAutoLockL(); // this returns true/false - // TODO should this also do iPhone.SetLockSetting(status, lockType, lockChange); ??? - } -else if(aReason==ELockAppEnableDevicelock) - { - // check whether code is really needed - RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockPhoneDevice; - RMobilePhone::TMobilePhoneLockInfoV1 lockInfo; - RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo); - RMobilePhone::TMobilePhoneLockSetting lockChange(RMobilePhone::ELockSetDisabled); - TRequestStatus status = KRequestPending; - TInt ret=KErrNone; - RDEBUG( "GetLockInfo", 0 ); - iPhone.GetLockInfo(status, lockType, lockInfoPkg); - RDEBUG( "WaitForRequest", 0 ); - User::WaitForRequest( status ); - ret = status.Int(); - RDEBUG( "WaitForRequest ret", ret ); - #ifdef __WINS__ - if(ret==KErrTimedOut) - { - ret = KErrNone; - lockInfo.iSetting = RMobilePhone::ELockSetDisabled; // ask password only if there's no timeout. - } - #endif - if(ret==KErrNone) - { - RDEBUG( "lockInfo.iSetting", lockInfo.iSetting ); - RDEBUG( "RMobilePhone::ELockSetDisabled", RMobilePhone::ELockSetDisabled ); - if(lockInfo.iSetting == RMobilePhone::ELockSetDisabled) // ask password only if there's no timeout - { - lockChange = RMobilePhone::ELockSetEnabled; - RDEBUG( "SetLockSetting lockChange", lockChange ); - #define OLD_METHODx - #ifdef OLD_METHOD - status = KRequestPending; - RDEBUG( "SetLockSetting", 0 ); - iPhone.SetLockSetting(status, lockType, lockChange); // ask for PassPhraseRequiredL - RDEBUG( "WaitForRequestL", 0 ); - User::WaitForRequest( status ); // TODO this waits 33 seconds in WINS and returns ffffffdf = KErrTimedOut - ret = status.Int(); - RDEBUG( "WaitForRequestL ret", ret ); - #else - RDEBUG( "! OLD_METHOD", 0 ); - CWait *iWait = NULL; - iWait = CWait::NewL(); - iWait->SetRequestType(EMobilePhoneSetLockSetting); - iPhone.SetLockSetting(iWait->iStatus, lockType, lockChange); // ask for PassPhraseRequiredL - RDEBUG( "WaitForRequestL", 0 ); - ret = iWait->WaitForRequestL(); - RDEBUG( "WaitForRequestL ret", ret ); - if(iWait) - { - RDEBUG( "IsActive", 0 ); - if(iWait->IsActive()) - { - RDEBUG( "CancelAsyncRequest", 0 ); - iPhone.CancelAsyncRequest(iWait->GetRequestType()); - RDEBUG( "cancelled", 0 ); - } - } - delete iWait; - #endif - - RDEBUG( "WaitForRequestL ret", ret ); - #ifdef __WINS__ - if(ret==KErrTimedOut) - ret = KErrNone; - #endif - if(ret==KErrNone) - validCode = 1; - else - validCode = 0; - } - else - validCode = 0x20; - } - else - validCode = 0x21; + RDEBUG("CSecurityHandler", 0); + CSecurityHandler* handler = new (ELeave) CSecurityHandler(iPhone); + if (aReason == ELockAppDisableDevicelock) + { + RDEBUG("calling AskSecCodeInAutoLockL", 0); + validCode = handler->AskSecCodeInAutoLockL(); // this returns true/false + // TODO should this also do iPhone.SetLockSetting(status, lockType, lockChange); ??? + } + else if (aReason == ELockAppEnableDevicelock) + { + // check whether code is really needed + RMobilePhone::TMobilePhoneLock lockType = + RMobilePhone::ELockPhoneDevice; + RMobilePhone::TMobilePhoneLockInfoV1 lockInfo; + RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo); + RMobilePhone::TMobilePhoneLockSetting lockChange( + RMobilePhone::ELockSetDisabled); + TRequestStatus status = KRequestPending; + TInt ret = KErrNone; + RDEBUG("GetLockInfo", 0); + iPhone.GetLockInfo(status, lockType, lockInfoPkg); + RDEBUG("WaitForRequest", 0); + User::WaitForRequest(status); + ret = status.Int(); + RDEBUG("WaitForRequest ret", ret); +#ifdef __WINS__ + if(ret==KErrTimedOut) + { + ret = KErrNone; + lockInfo.iSetting = RMobilePhone::ELockSetDisabled; // ask password only if there's no timeout. + } +#endif + if (ret == KErrNone) + { + RDEBUG("lockInfo.iSetting", lockInfo.iSetting); + RDEBUG("RMobilePhone::ELockSetDisabled", + RMobilePhone::ELockSetDisabled); + if (lockInfo.iSetting == RMobilePhone::ELockSetDisabled) // ask password only if there's no timeout + { + lockChange = RMobilePhone::ELockSetEnabled; + RDEBUG("SetLockSetting lockChange", lockChange); +#define OLD_METHODx +#ifdef OLD_METHOD + status = KRequestPending; + RDEBUG( "SetLockSetting", 0 ); + iPhone.SetLockSetting(status, lockType, lockChange); // ask for PassPhraseRequiredL + RDEBUG( "WaitForRequestL", 0 ); + User::WaitForRequest( status ); // TODO this waits 33 seconds in WINS and returns ffffffdf = KErrTimedOut + ret = status.Int(); + RDEBUG( "WaitForRequestL ret", ret ); +#else + RDEBUG("! OLD_METHOD", 0); + CWait *iWait = NULL; + iWait = CWait::NewL(); + iWait->SetRequestType(EMobilePhoneSetLockSetting); + iPhone.SetLockSetting(iWait->iStatus, lockType, lockChange); // ask for PassPhraseRequiredL + RDEBUG("WaitForRequestL", 0); + ret = iWait->WaitForRequestL(); + RDEBUG("WaitForRequestL ret", ret); + if (iWait) + { + RDEBUG("IsActive", 0); + if (iWait->IsActive()) + { + RDEBUG("CancelAsyncRequest", 0); + iPhone.CancelAsyncRequest(iWait->GetRequestType()); + RDEBUG("cancelled", 0); + } + } + delete iWait; +#endif - /* Alternative way to ask for password - RMobilePhone::TMobilePhoneSecurityEvent iEvent; - TInt result = KErrNone; - iEvent = RMobilePhone::EPhonePasswordRequired; - RDEBUG( "calling HandleEventL", 0 ); - handler->HandleEventL(iEvent, result); // this is supposed to wait - validCode = false; - if(result) - validCode = true; - RDEBUG( "result", result ); - */ - } -// TODO this doesn't wait on WINS , so how do I get the Acceptation? - RDEBUG( "validCode (true/false)", validCode ); -if(validCode) - return KErrNone; -return KErrCancel; -} + RDEBUG("WaitForRequestL ret", ret); +#ifdef __WINS__ + if(ret==KErrTimedOut) + ret = KErrNone; +#endif + if (ret == KErrNone) + validCode = 1; + else + validCode = 0; + } + else + validCode = 0x20; + } + else + validCode = 0x21; + + /* Alternative way to ask for password + RMobilePhone::TMobilePhoneSecurityEvent iEvent; + TInt result = KErrNone; + iEvent = RMobilePhone::EPhonePasswordRequired; + RDEBUG( "calling HandleEventL", 0 ); + handler->HandleEventL(iEvent, result); // this is supposed to wait + validCode = false; + if(result) + validCode = true; + RDEBUG( "result", result ); + */ + } + // TODO this doesn't wait on WINS , so how do I get the Acceptation? + RDEBUG("validCode (true/false)", validCode); + if (validCode) + return KErrNone; + + // no valid code -> switch off the lights + err = RProperty::Set(KPSUidSecurityUIs, + KSecurityUIsLights, ESecurityUIsLightsLockOffRequest); + RDEBUG("KSecurityUIsLights err", err); + return KErrCancel; + } void AutolockSrv::lockAction() -{ - RDEBUG( "0", 0 ); + { + RDEBUG("0", 0); XQSERVICE_DEBUG_PRINT("AutolockSrv::lockAction"); - TryChangeStatus(ELockAppOfferDevicelock); - -} + TryChangeStatus( ELockAppOfferDevicelock); + + } void AutolockSrv::handleAnswerDelivered() -{ - RDEBUG( "This should never be called", 0 ); + { + RDEBUG("0", 0); // quit(); - -} + } void AutolockSrv::endCall() -{ - RDEBUG( "This should never be called", 0 ); + { + RDEBUG("This should never be called", 0); //QVBoxLayout *vl = qobject_cast(layout()) ; //vl->removeWidget(mEndCallButton); //XQServiceUtil::toBackground(true); -} + } -void AutolockSrv::setLabelNumber(QString label,QString number) -{ - RDEBUG( "0", 0 ); +void AutolockSrv::setLabelNumber(QString label, QString number) + { + RDEBUG("0", 0); mLabel->setText("mLabel=" + label); mNumberEdit->setText("mNumberEdit=" + number); -} + } void AutolockSrv::DebugRequest(int aReason) -{ - switch(aReason) { - case ELockAppEnableKeyguard: - RDEBUG( "ELockAppEnableKeyguard", aReason ); - break; - case ELockAppDisableKeyguard: - RDEBUG( "ELockAppDisableKeyguard", aReason ); - break; - case ELockAppEnableDevicelock: - RDEBUG( "ELockAppEnableDevicelock", aReason ); - break; - case ELockAppDisableDevicelock: - RDEBUG( "ELockAppDisableDevicelock", aReason ); - break; - case ELockAppOfferKeyguard: - RDEBUG( "ELockAppOfferKeyguard", aReason ); - break; - case ELockAppOfferDevicelock: - RDEBUG( "ELockAppOfferDevicelock", aReason ); - break; - case ELockAppShowKeysLockedNote: - RDEBUG( "ELockAppShowKeysLockedNote", aReason ); - break; - default: - RDEBUG( "default", aReason ); - break; + switch (aReason) + { + case ELockAppEnableKeyguard: + RDEBUG("ELockAppEnableKeyguard", aReason); + break; + case ELockAppDisableKeyguard: + RDEBUG("ELockAppDisableKeyguard", aReason); + break; + case ELockAppEnableDevicelock: + RDEBUG("ELockAppEnableDevicelock", aReason); + break; + case ELockAppDisableDevicelock: + RDEBUG("ELockAppDisableDevicelock", aReason); + break; + case ELockAppOfferKeyguard: + RDEBUG("ELockAppOfferKeyguard", aReason); + break; + case ELockAppOfferDevicelock: + RDEBUG("ELockAppOfferDevicelock", aReason); + break; + case ELockAppShowKeysLockedNote: + RDEBUG("ELockAppShowKeysLockedNote", aReason); + break; + default: + RDEBUG("default", aReason); + break; + } } -} void AutolockSrv::DebugStatus(int aReason) -{ - switch(aReason) { - case ELockNotActive: - RDEBUG( "ELockNotActive", aReason ); - break; - case EKeyguardActive: - RDEBUG( "EKeyguardActive", aReason ); - break; - case EDevicelockActive: - RDEBUG( "EDevicelockActive", aReason ); - break; - default: - RDEBUG( "default", aReason ); - break; + switch (aReason) + { + case ELockNotActive: + RDEBUG("ELockNotActive", aReason); + break; + case EKeyguardActive: + RDEBUG("EKeyguardActive", aReason); + break; + case EDevicelockActive: + RDEBUG("EDevicelockActive", aReason); + break; + default: + RDEBUG("default", aReason); + break; + } } -} void AutolockSrv::DebugError(int aReason) -{ - switch(aReason) { - case KErrPermissionDenied: - RDEBUG( "KErrPermissionDenied", aReason ); - break; - case KErrNone: - RDEBUG( "KErrNone", aReason ); - break; - case KErrAlreadyExists: - RDEBUG( "KErrAlreadyExists", aReason ); - break; - default: - RDEBUG( "default", aReason ); - break; + switch (aReason) + { + case KErrNone: + RDEBUG("KErrNone", aReason); + break; + case KErrPermissionDenied: // caller doesn't have enough capabilities + RDEBUG("KErrPermissionDenied", aReason); + break; + case KErrAlreadyExists: // this particular lock is already enabled + RDEBUG("KErrAlreadyExists", aReason); + break; + case KErrInUse: // the dialog is already shown + RDEBUG("KErrInUse", aReason); + break; + default: + RDEBUG("default", aReason); + break; + } } -} int AutolockSrv::CheckIfLegal(int aReason) -{ - RDEBUG( "aReason", aReason ); - switch ( aReason ) + { + RDEBUG("aReason", aReason); + // check whether a dialog is already displayed. This is to prevent timeout-lock and timeout-keyguard for activated on top of a PIN query, in particular at boot-up (TODO Starter) + TInt secUiOriginatedQuery(ESecurityUIsSecUIOriginatedUninitialized); + TInt err = RProperty::Get(KPSUidSecurityUIs, + KSecurityUIsSecUIOriginatedQuery, secUiOriginatedQuery); + RDEBUG("err", err); + RDEBUG("secUiOriginatedQuery", secUiOriginatedQuery); + switch (aReason) { case ELockAppEnableKeyguard: { - RDEBUG( "ELockAppEnableKeyguard iLockStatus", iLockStatus ); - switch ( iLockStatus ) + RDEBUG("ELockAppEnableKeyguard iLockStatus", iLockStatus); + if (secUiOriginatedQuery + != ESecurityUIsSecUIOriginatedUninitialized) + return KErrInUse; // PIN on top. Don't keyguard + switch (iLockStatus) { case ELockNotActive: - if ( 1==0 ) // !CKeyLockPolicyApi::KeyguardAllowed() ) + if (1 == 0) // !CKeyLockPolicyApi::KeyguardAllowed() ) return KErrPermissionDenied; else return KErrNone; @@ -611,8 +674,9 @@ break; case ELockAppDisableKeyguard: { - RDEBUG( "ELockAppDisableKeyguard iLockStatus", iLockStatus ); - switch ( iLockStatus ) + RDEBUG("ELockAppDisableKeyguard iLockStatus", iLockStatus); + // no matter whether PIN is displayed + switch (iLockStatus) { case ELockNotActive: return KErrAlreadyExists; @@ -625,8 +689,13 @@ break; case ELockAppEnableDevicelock: { - RDEBUG( "ELockAppEnableDevicelock iLockStatus", iLockStatus ); - switch ( iLockStatus ) + RDEBUG("ELockAppEnableDevicelock iLockStatus", iLockStatus); + if (secUiOriginatedQuery + != ESecurityUIsSecUIOriginatedUninitialized + && secUiOriginatedQuery + != ESecurityUIsSystemLockOriginated) + return KErrInUse; // PIN on top. Don't devicelock + switch (iLockStatus) { case ELockNotActive: return KErrNone; @@ -639,8 +708,15 @@ break; case ELockAppDisableDevicelock: { - RDEBUG( "ELockAppDisableDevicelock iLockStatus", iLockStatus ); - switch ( iLockStatus ) + RDEBUG("ELockAppDisableDevicelock iLockStatus", iLockStatus); + if (secUiOriginatedQuery + != ESecurityUIsSecUIOriginatedUninitialized + && secUiOriginatedQuery + != ESecurityUIsSystemLockOriginated) + { + // PIN on top and trying to display unlock-code. This is valid + } + switch (iLockStatus) { case ELockNotActive: return KErrAlreadyExists; @@ -653,8 +729,13 @@ break; case ELockAppOfferKeyguard: { - RDEBUG( "ELockAppOfferKeyguard iLockStatus", iLockStatus ); - switch ( iLockStatus ) + RDEBUG("ELockAppOfferKeyguard iLockStatus", iLockStatus); + if (secUiOriginatedQuery + != ESecurityUIsSecUIOriginatedUninitialized + && secUiOriginatedQuery + != ESecurityUIsSystemLockOriginated) + return KErrInUse; // PIN on top. Don't offer + switch (iLockStatus) { case ELockNotActive: return KErrNone; @@ -667,8 +748,13 @@ break; case ELockAppOfferDevicelock: { - RDEBUG( "ELockAppOfferDevicelock iLockStatus", iLockStatus ); - switch ( iLockStatus ) + RDEBUG("ELockAppOfferDevicelock iLockStatus", iLockStatus); + if (secUiOriginatedQuery + != ESecurityUIsSecUIOriginatedUninitialized + && secUiOriginatedQuery + != ESecurityUIsSystemLockOriginated) + return KErrInUse; // PIN on top. Don't offer + switch (iLockStatus) { case ELockNotActive: return KErrNone; @@ -681,8 +767,13 @@ break; case ELockAppShowKeysLockedNote: { - RDEBUG( "ELockAppShowKeysLockedNote iLockStatus", iLockStatus ); - switch ( iLockStatus ) + RDEBUG("ELockAppShowKeysLockedNote iLockStatus", iLockStatus); + if (secUiOriginatedQuery + != ESecurityUIsSecUIOriginatedUninitialized + && secUiOriginatedQuery + != ESecurityUIsSystemLockOriginated) + return KErrInUse; // PIN on top. Don't display + switch (iLockStatus) { case ELockNotActive: return KErrPermissionDenied; @@ -695,601 +786,690 @@ break; default: { - RDEBUG( "default iLockStatus", iLockStatus ); + RDEBUG("default iLockStatus", iLockStatus); return KErrPermissionDenied; } // break; - } // switch + } // switch return KErrPermissionDenied; -} + } int AutolockSrv::publishStatus(int aReason) -{ - RDEBUG( "aReason", aReason ); -const TUid KCRUidCoreApplicationUIsSysAp = { 0x101F8765 }; -const TUint32 KSysApKeyguardActive = 0x00000001; -CRepository* repositoryDevicelock; -CRepository* repositoryKeyguard; -repositoryDevicelock = CRepository::NewL(KCRUidSecuritySettings); -repositoryKeyguard = CRepository::NewL(KCRUidSecuritySettings); -TInt cRresult; + { + RDEBUG("aReason", aReason); + TInt err; + const TUid KCRUidCoreApplicationUIsSysAp = { 0x101F8765 }; + const TUint32 KSysApKeyguardActive = 0x00000001; + CRepository* repositoryDevicelock; + CRepository* repositoryKeyguard; + repositoryDevicelock = CRepository::NewL(KCRUidSecuritySettings); + repositoryKeyguard = CRepository::NewL(KCRUidCoreApplicationUIsSysAp); + TInt cRresult = KErrNone; + if (1 == 1) // this is a quick way to disable this functionality, for testing + { + RDEBUG("publishing", aReason); + if (aReason == ELockNotActive) + { + err = RProperty::Set(KPSUidAvkonDomain, KAknKeyguardStatus, + EKeyguardNotActive); + RDEBUG("err", err); + err = RProperty::Set(KPSUidCoreApplicationUIs, + KCoreAppUIsAutolockStatus, EAutolockOff); + RDEBUG("err", err); + // lights are required ? - if(1==1) - { - RDEBUG( "publishing", aReason ); - if(aReason==ELockNotActive) - { - RProperty::Set(KPSUidAvkonDomain, KAknKeyguardStatus, EKeyguardNotActive); - RProperty::Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, EAutolockOff); - // cRresult = repositoryDevicelock->Set(KSettingsAutolockStatus, 0); // the settings remains. Only ISA changes, as well as the P&S - cRresult = repositoryKeyguard->Set(KSysApKeyguardActive, 0); - } - if(1==0) - { - if(aReason==EKeyguardActive) - { - RProperty::Set(KPSUidAvkonDomain, KAknKeyguardStatus, EKeyguardLocked); - RProperty::Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, EAutolockOff); - // cRresult = repositoryDevicelock->Set(KSettingsAutolockStatus, 0); - cRresult = repositoryKeyguard->Set(KSysApKeyguardActive, 1); - } - else if(aReason>=EDevicelockActive) - { - RProperty::Set(KPSUidAvkonDomain, KAknKeyguardStatus, EKeyguardNotActive); // EKeyguardLocked sure? maybe EKeyguardNotActive ? - RProperty::Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, EManualLocked); - // cRresult = repositoryDevicelock->Set(KSettingsAutolockStatus, 1); - cRresult = repositoryKeyguard->Set(KSysApKeyguardActive, 0); // keyguard disabled, so that user can type and DeviceF can be captured - } - } - } -delete repositoryDevicelock; -delete repositoryKeyguard; -// this is the real point where everything is done. -iLockStatusPrev = iLockStatus; -iLockStatus = aReason; - RDEBUG( "setting iLockStatus", iLockStatus ); -return KErrNone; -} + // cRresult = repositoryDevicelock->Set(KSettingsAutolockStatus, 0); // the settings remains. Only ISA changes, as well as the P&S + cRresult = repositoryKeyguard->Set(KSysApKeyguardActive, 0); + RDEBUG("cRresult", cRresult); + } + if (1 == 1) // this is a quick way to disable this functionality, for testing + { + if (aReason == EKeyguardActive) + { + err = RProperty::Set(KPSUidAvkonDomain, KAknKeyguardStatus, + EKeyguardLocked); + RDEBUG("KAknKeyguardStatus err", err); + err = RProperty::Set(KPSUidCoreApplicationUIs, + KCoreAppUIsAutolockStatus, EAutolockOff); + RDEBUG("KCoreAppUIsAutolockStatus err", err); + err = RProperty::Set(KPSUidSecurityUIs, + KSecurityUIsLights, ESecurityUIsLightsLockOffRequest); // same for keyguard and devicelock + RDEBUG("KSecurityUIsLights err", err); + // cRresult = repositoryDevicelock->Set(KSettingsAutolockStatus, 0); + cRresult = repositoryKeyguard->Set(KSysApKeyguardActive, 1); + RDEBUG("cRresult", cRresult); + } + else if (aReason >= EDevicelockActive) + { + err = RProperty::Set(KPSUidAvkonDomain, KAknKeyguardStatus, + EKeyguardAutolockEmulation); // not EKeyguardLocked, not EKeyguardNotActive + RDEBUG("KAknKeyguardStatus err", err); + err = RProperty::Set(KPSUidCoreApplicationUIs, + KCoreAppUIsAutolockStatus, EManualLocked); + RDEBUG("KCoreAppUIsAutolockStatus err", err); + err = RProperty::Set(KPSUidSecurityUIs, + KSecurityUIsLights, ESecurityUIsLightsLockOffRequest); + RDEBUG(" KSecurityUIsLights err", err); + // cRresult = repositoryDevicelock->Set(KSettingsAutolockStatus, 1); + cRresult = repositoryKeyguard->Set(KSysApKeyguardActive, 0); // keyguard disabled, so that user can type and DeviceF can be captured + RDEBUG("cRresult", cRresult); + } + } + } + delete repositoryDevicelock; + delete repositoryKeyguard; + // this is the real point where everything is done. + iLockStatusPrev = iLockStatus; + iLockStatus = aReason; + RDEBUG("setting iLockStatus", iLockStatus); + return KErrNone; + } /********************/ int AutolockSrv::showNoteIfRequested(int aReason) -{ - RDEBUG( "aReason", aReason ); + { + RDEBUG("aReason", aReason); - if(aReason==ELockNotActive) - { - if(iShowKeyguardNote==1) - { - HbDeviceMessageBox::information ("Keyguard deactivated"); - } - } - else if(aReason==EKeyguardActive) - { - if(iShowKeyguardNote==1) - { - HbDeviceMessageBox::information ("Keyguard activated"); - } - } - else if(aReason>=EDevicelockActive) // this doesn't happen, but we are prepared nevertheless - { - if(iShowKeyguardNote==1) - { - HbDeviceMessageBox::information ("Devicelock activated"); - } - } -return KErrNone; -} + if (aReason == ELockNotActive) + { + if (iShowKeyguardNote == 1) + { + HbDeviceMessageBox::information("Keyguard deactivated"); + } + } + else if (aReason == EKeyguardActive) + { + if (iShowKeyguardNote == 1) + { + HbDeviceMessageBox::information("Keyguard activated"); + } + } + else if (aReason >= EDevicelockActive) // this doesn't happen, but we are prepared nevertheless + { + if (iShowKeyguardNote == 1) + { + HbDeviceMessageBox::information("Devicelock activated"); + } + } + return KErrNone; + } /***********************/ int AutolockSrv::TryChangeStatus(int aReason) -{ - RDEBUG( "aReason", aReason ); - int ret = aReason; - int errorInProcess = KErrNone; - DebugRequest(ret); - - switch(ret) - { - case ELockAppEnableKeyguard: // 1 - { - errorInProcess = CheckIfLegal(ret); - DebugError(errorInProcess); - if(errorInProcess==KErrNone) - { - setLabelIcon(EKeyguardActive); - updateIndicator(EKeyguardActive); - publishStatus(EKeyguardActive); - showNoteIfRequested(EKeyguardActive); - } - } - break; - case ELockAppDisableKeyguard: // 2 - { - errorInProcess = CheckIfLegal(ret); - DebugError(errorInProcess); - if(errorInProcess==KErrNone) - { - setLabelIcon(ELockNotActive); - updateIndicator(ELockNotActive); - publishStatus(ELockNotActive); - showNoteIfRequested(ELockNotActive); - } - } - break; - case ELockAppEnableDevicelock: // 3 - { - errorInProcess = CheckIfLegal(ret); - DebugError(errorInProcess); - if(errorInProcess==KErrNone) - { - if(!callerHasECapabilityWriteDeviceData) // check permissions for calling process, because doesn't AskValidSecCode - errorInProcess=KErrPermissionDenied; - DebugError(errorInProcess); - } - if(errorInProcess==KErrNone) - { - updateIndicator(EDevicelockActive); - publishStatus(EDevicelockActive); - setLabelIcon(EDevicelockActive); - setLockDialog(aReason, 1); - } - // aParam1 is aReason : EDevicelockManual, EDevicelockRemote - // this never shows a note - } - break; - case ELockAppDisableDevicelock: // 4 - { - errorInProcess = CheckIfLegal(ret); - DebugError(errorInProcess); - if(errorInProcess==KErrNone) - { - if(!callerHasECapabilityWriteDeviceData) // check permissions for calling process, because doesn't AskValidSecCode - errorInProcess=KErrPermissionDenied; - DebugError(errorInProcess); - } - if(errorInProcess==KErrNone) - { - RDEBUG( " calling HbDeviceMessageBox::question", 0 ); - bool value = HbDeviceMessageBox::question("Disable Lock?"); - RDEBUG( "value", value ); - if(!value) - errorInProcess = KErrCancel; - } - if(errorInProcess==KErrNone) - { - setLockDialog(aReason, 0); // hide temporarilly because AskValidSecCode doesn't get in top of the Lock-icon. Thus, dismiss it. - RDEBUG( "calling AskValidSecCode", 0 ); - errorInProcess=AskValidSecCode(ELockAppDisableDevicelock); - RDEBUG( "errorInProcess", errorInProcess ); - } - if(errorInProcess==KErrNone) - { - setLabelIcon(ELockNotActive); - updateIndicator(ELockNotActive); - publishStatus(ELockNotActive); - } - if(errorInProcess!=KErrNone) - { // re-lock. For example, if password is wrong - setLockDialog(aReason, 1); - } - // this never shows a note - } - break; - case ELockAppOfferKeyguard: // 5 - { - errorInProcess = CheckIfLegal(ret); - DebugError(errorInProcess); - if(errorInProcess==KErrNone) - { - bool value = HbDeviceMessageBox::question("Enable Keyguard?"); - // TODO what about a nice icon? - RDEBUG( "value", value ); - if(!value) - errorInProcess = KErrCancel; - } - if(errorInProcess==KErrNone) - { - errorInProcess = TryChangeStatus(ELockAppEnableKeyguard); - } - // this never shows a note - } - break; - case ELockAppOfferDevicelock: // 6 - { - errorInProcess = CheckIfLegal(ret); - DebugError(errorInProcess); - setLockDialog(aReason, 0); // hide temporarilly because AskValidSecCode doesn't get in top of the Lock-icon. Thus, dismiss it. - errorInProcess=AskValidSecCode(ELockAppEnableDevicelock); - if(errorInProcess==KErrNone) - { - errorInProcess = TryChangeStatus(ELockAppEnableDevicelock); - } - // this never shows a note. Perhaps ELockAppEnableDevicelock does. - } - break; - case ELockAppShowKeysLockedNote: - { - iShowKeyguardNote=1; // this is not sent as parameter, so we need to fake it: ON - showNoteIfRequested(EKeyguardActive); - } - break; - default: - RDEBUG( "default", ret ); - errorInProcess = KErrNotSupported; - break; + { + RDEBUG("aReason", aReason); + int ret = aReason; + int errorInProcess = KErrNone; + DebugRequest(ret); - } + switch (ret) + { + case ELockAppEnableKeyguard: // 1 + { + errorInProcess = CheckIfLegal(ret); + DebugError(errorInProcess); + if (errorInProcess == KErrNone) + { + setLabelIcon( EKeyguardActive); + updateIndicator(EKeyguardActive); + publishStatus(EKeyguardActive); + showNoteIfRequested(EKeyguardActive); + } + } + break; + case ELockAppDisableKeyguard: // 2 + { + errorInProcess = CheckIfLegal(ret); + DebugError(errorInProcess); + if (errorInProcess == KErrNone) + { + setLabelIcon( ELockNotActive); + updateIndicator(ELockNotActive); + publishStatus(ELockNotActive); + showNoteIfRequested(ELockNotActive); + } + } + break; + case ELockAppEnableDevicelock: // 3 + { + errorInProcess = CheckIfLegal(ret); + DebugError(errorInProcess); + if (errorInProcess == KErrNone) + { + if (!callerHasECapabilityWriteDeviceData) // check permissions for calling process, because doesn't AskValidSecCode + errorInProcess = KErrPermissionDenied; + DebugError(errorInProcess); + } + if (errorInProcess == KErrNone) + { + updateIndicator( EDevicelockActive); + publishStatus(EDevicelockActive); + setLabelIcon(EDevicelockActive); + setLockDialog(aReason, 1); + } + // aParam1 is aReason : EDevicelockManual, EDevicelockRemote + // this never shows a note + } + break; + case ELockAppDisableDevicelock: // 4 + { + errorInProcess = CheckIfLegal(ret); + DebugError(errorInProcess); + if (errorInProcess == KErrNone) + { + if (!callerHasECapabilityWriteDeviceData) // check permissions for calling process, because doesn't AskValidSecCode + errorInProcess = KErrPermissionDenied; + DebugError(errorInProcess); + } + if (errorInProcess == KErrNone) + { + RDEBUG(" calling HbDeviceMessageBox::question", 0); + bool value = HbDeviceMessageBox::question("Disable Lock?"); + RDEBUG("value", value); + if (!value) + errorInProcess = KErrCancel; + } + if (errorInProcess == KErrNone) + { + setLockDialog(aReason, 0); // hide temporarilly because AskValidSecCode doesn't get in top of the Lock-icon. Thus, dismiss it. + RDEBUG("calling AskValidSecCode", 0); + errorInProcess = AskValidSecCode(ELockAppDisableDevicelock); + RDEBUG("errorInProcess", errorInProcess); + } + if (errorInProcess == KErrNone) + { + setLabelIcon( ELockNotActive); + updateIndicator(ELockNotActive); + publishStatus(ELockNotActive); + } + if (errorInProcess != KErrNone) + { // re-lock. For example, if password is wrong + setLockDialog(aReason, 1); + } + // this never shows a note + } + break; + case ELockAppOfferKeyguard: // 5 + { + errorInProcess = CheckIfLegal(ret); + DebugError(errorInProcess); + if (errorInProcess == KErrNone) + { + bool value = HbDeviceMessageBox::question("Enable Keyguard?"); + // TODO what about a nice icon? + RDEBUG("value", value); + if (!value) + errorInProcess = KErrCancel; + } + if (errorInProcess == KErrNone) + { + errorInProcess = TryChangeStatus(ELockAppEnableKeyguard); + } + // this never shows a note + } + break; + case ELockAppOfferDevicelock: // 6 + { + errorInProcess = CheckIfLegal(ret); + DebugError(errorInProcess); + setLockDialog(aReason, 0); // hide temporarilly because AskValidSecCode doesn't get in top of the Lock-icon. Thus, dismiss it. + errorInProcess = AskValidSecCode(ELockAppEnableDevicelock); + if (errorInProcess == KErrNone) + { + errorInProcess = TryChangeStatus(ELockAppEnableDevicelock); + } + // this never shows a note. Perhaps ELockAppEnableDevicelock does. + } + break; + case ELockAppShowKeysLockedNote: + { + iShowKeyguardNote = 1; // this is not sent as parameter, so we need to fake it: ON + showNoteIfRequested( EKeyguardActive); + } + break; + default: + RDEBUG("default", ret); + errorInProcess = KErrNotSupported; + break; + + } return errorInProcess; -} + } /**************************/ int AutolockSrv::setLockDialog(int aReason, int status) -{ - RDEBUG( "aReason", aReason ); - RDEBUG( "status", status ); - RDEBUG( "iDeviceDialogCreated", iDeviceDialogCreated ); - if(status==0) // hide - { - if(iDeviceDialogCreated>0) - { - iDeviceDialogCreated = 0; - iDeviceDialog->cancel(); - } - } - else if(status==1) // show - { - QVariantMap params; - TBool err; - #define ESecUiTypeDeviceLock 0x00100000 - #define ESecUiTypeKeyguard 0x00200000 + { + RDEBUG("aReason", aReason); + RDEBUG("status", status); + RDEBUG("iDeviceDialogCreated", iDeviceDialogCreated); + TInt secUiOriginatedQuery(ESecurityUIsSecUIOriginatedUninitialized); + TInt err = RProperty::Get(KPSUidSecurityUIs, + KSecurityUIsSecUIOriginatedQuery, secUiOriginatedQuery); + RDEBUG("err", err); + RDEBUG("secUiOriginatedQuery", secUiOriginatedQuery); + + if (status == 0) // hide + { + // secUiOriginatedQuery should be ESecurityUIsSystemLockOriginated . If not, this is not correctly setting it + if (iDeviceDialogCreated > 0) + { + iDeviceDialogCreated = 0; + iDeviceDialog->cancel(); + err = iDeviceDialog->error(); + RDEBUG("err", err); + TInt err = RProperty::Set(KPSUidSecurityUIs, + KSecurityUIsSecUIOriginatedQuery, + ESecurityUIsSecUIOriginatedUninitialized); + RDEBUG("err", err); + } + } + else if (status == 1) // show + { + // secUiOriginatedQuery should be ESecurityUIsSecUIOriginatedUninitialized . If not, the validation is not correctly filtering it + QVariantMap params; + TBool err; +#define ESecUiTypeDeviceLock 0x00100000 +#define ESecUiTypeKeyguard 0x00200000 - if(aReason==EKeyguardActive) - params.insert("type", ESecUiTypeKeyguard); - else if(aReason>=EDevicelockActive) - params.insert("type", ESecUiTypeDeviceLock); - else - { - RDEBUG( "error. status=1 but aReason", aReason ); - } - // no need for title. Icon should be explicit enough - // params.insert("title", "Locked"); - if(iDeviceDialogCreated<=0) - { - RDEBUG( "creating iDeviceDialog", 0 ); - iDeviceDialog = new HbDeviceDialog(HbDeviceDialog::NoFlags, this); - iDeviceDialogCreated = 1; - } - else - { - RDEBUG( "raising iDeviceDialog", 0 ); - // confirm that dialog is present - err = iDeviceDialog->error(); - RDEBUG( "err", err ); - iDeviceDialogCreated = 2; - } - const QString KSecQueryUiDeviceDialog("com.nokia.secuinotificationdialog/1.0"); - RDEBUG( "pre show", aReason ); - err = iDeviceDialog->show( KSecQueryUiDeviceDialog, params ); - RDEBUG( "post show. err", err ); - err = iDeviceDialog->error(); - RDEBUG( "err", err ); - } - else - { - RDEBUG( "unknown status", status ); - return KErrNotSupported; - } -return KErrNone; -} + if (aReason == EKeyguardActive) + params.insert("type", ESecUiTypeKeyguard); + else if (aReason >= EDevicelockActive) + params.insert("type", ESecUiTypeDeviceLock); + else + { + RDEBUG("error. status=1 but aReason", aReason); + } + // no need for title. Icon should be explicit enough + // params.insert("title", "Locked"); + if (iDeviceDialogCreated <= 0) + { + RDEBUG("creating iDeviceDialog", 0); + iDeviceDialog = new HbDeviceDialog(HbDeviceDialog::NoFlags, this); + iDeviceDialogCreated = 1; + } + else + { + RDEBUG("raising iDeviceDialog", 0); + // confirm that dialog is present + err = iDeviceDialog->error(); + RDEBUG("err", err); + iDeviceDialogCreated = 2; + } + const QString KSecQueryUiDeviceDialog( + "com.nokia.secuinotificationdialog/1.0"); + RDEBUG("pre show", aReason); + err = iDeviceDialog->show(KSecQueryUiDeviceDialog, params); // and continue processing + RDEBUG("post show. err", err); + err = iDeviceDialog->error(); + RDEBUG("err", err); + // This won't be needed when screensaver is in place, as the dialogs will be different, and therefore both can be present + // Somehow this should be handled by Orbit, but unfortunatelly they don't allow the same dialog twice + err = RProperty::Set(KPSUidSecurityUIs, + KSecurityUIsSecUIOriginatedQuery, + ESecurityUIsSecUIOriginatedUninitialized); + RDEBUG("err", err); + + } + else + { + RDEBUG("unknown status", status); + return KErrNotSupported; + } + return KErrNone; + } void AutolockSrv::setLabelIcon(int aReason) -{ - RDEBUG( "aReason", aReason ); - - if(aReason==ELockNotActive) - { - mLabelIcon->setVisible(false); - setLockDialog(aReason, 0); // TODO isn't this done already at TryChangeStatus ??? - lower(); - hide(); - } - else if(aReason==EKeyguardActive) - { - mLabelIcon->setVisible(true); - setLockDialog(aReason, 1); - raise(); // not repaint(), not show() , not setVisible(true), not showFullScreen() , not ??? - show(); - } - else if(aReason==EDevicelockActive) - { - mLabelIcon->setVisible(true); - raise(); - show(); - } - else - { - RDEBUG( "error: aReason", aReason ); - } -} + { + RDEBUG("aReason", aReason); + + if (aReason == ELockNotActive) + { + mLabelIcon->setVisible(false); + setLockDialog(aReason, 0); // TODO isn't this done already at TryChangeStatus ??? + lower(); + hide(); + } + else if (aReason == EKeyguardActive) + { + mLabelIcon->setVisible(true); + setLockDialog(aReason, 1); + raise(); // not repaint(), not show() , not setVisible(true), not showFullScreen() , not ??? + show(); + } + else if (aReason == EDevicelockActive) + { + mLabelIcon->setVisible(true); + raise(); + show(); + } + else + { + RDEBUG("error: aReason", aReason); + } + } int AutolockSrv::updateIndicator(int aReason) -{ - RDEBUG( "aReason", aReason ); - QList list; - list.insert(0, 1); - list.insert(1, "aaa"); - list.insert(2, 2); - - HbIndicator indicator; - bool success; - if(aReason==ELockNotActive) - success = indicator.deactivate("com.nokia.hb.indicator.autolocksrv.autolocksrv_8/1.0"); // maybe it's already deactivated. Not a problem - else if(aReason==EKeyguardActive) - success = indicator.activate("com.nokia.hb.indicator.autolocksrv.autolocksrv_8/1.0"); - else if(aReason==EDevicelockActive) - success = indicator.activate("com.nokia.hb.indicator.autolocksrv.autolocksrv_8/1.0"); // same. We have just 1 indicator - else - success = 0; - RDEBUG( "success", success ); - return success; -} + { + RDEBUG("aReason", aReason); + QList list; + list.insert(0, 1); + list.insert(1, "aaa"); + list.insert(2, 2); + + HbIndicator indicator; + bool success; + if (aReason == ELockNotActive) + success = indicator.deactivate( + "com.nokia.hb.indicator.autolocksrv.autolocksrv_8/1.0"); // maybe it's already deactivated. Not a problem + else if (aReason == EKeyguardActive) + success = indicator.activate( + "com.nokia.hb.indicator.autolocksrv.autolocksrv_8/1.0"); + else if (aReason == EDevicelockActive) + success = indicator.activate( + "com.nokia.hb.indicator.autolocksrv.autolocksrv_8/1.0"); // same. We have just 1 indicator + else + success = 0; + RDEBUG("success", success); + return success; + } void AutolockSrv::activeKeyguard() -{ - // activity while keyguarded. Nothing to do - RDEBUG( "0", 0 ); -} + { + // activity while keyguarded. Nothing to do + RDEBUG("0", 0); + } void AutolockSrv::notActiveKeyguard() -{ - // inactivity. Keyguard should be activated - RDEBUG( "0", 0 ); - int ret = 0; - DebugStatus(iLockStatus); - if(iLockStatus==ELockNotActive) // not possible if it's keyguarded, or locked - { - ret = TryChangeStatus(ELockAppEnableKeyguard); - } -} - + { + // inactivity. Keyguard should be activated + RDEBUG("0", 0); + int ret = KErrNone; + DebugStatus( iLockStatus); + if (iLockStatus == ELockNotActive) // not possible if it's keyguarded, or locked + { + ret = TryChangeStatus(ELockAppEnableKeyguard); + } + RDEBUG("ret", ret); + } +/* Some activity detected while the deviceLock is enabled */ void AutolockSrv::activeDevicelock() -{ - RDEBUG( "0", 0 ); -} + { + // nothing to do + RDEBUG("0", 0); + } void AutolockSrv::notActiveDevicelock() -{ - // inactivity. Devicelock should be activated - RDEBUG( "0", 0 ); - int ret = 0; - DebugStatus(iLockStatus); - if(iLockStatus==ELockNotActive || iLockStatus==EKeyguardActive ) // not possible if it's locked - { - ret = TryChangeStatus(ELockAppEnableDevicelock); - } -} + { + // inactivity. Devicelock should be activated + RDEBUG("0", 0); + int ret = KErrNone; + DebugStatus( iLockStatus); + if (iLockStatus == ELockNotActive || iLockStatus == EKeyguardActive) // not possible if it's locked + { + ret = TryChangeStatus(ELockAppEnableDevicelock); + } + RDEBUG("ret", ret); + + } // some key is pressed bool AutolockSrv::event(QEvent *ev) -{ + { if (ev) - { - int isSwitchKey=0; - // on device, this doesn't seem to get the EKeyDeviceF key: only 1ffffff - if (ev->type() == QEvent::KeyPress){ - QKeyEvent *keyEvent = static_cast(ev); - qDebug() << QString("KeyPress:%1\n").arg(keyEvent->key(), 0, 16) ; - qDebug() << keyEvent->key(); - qDebug() << EKeyInsert; - qDebug() << (keyEvent->key()&0xFF); - qDebug() << (EKeyInsert&0xFF); - if((keyEvent->key()&0xFF) == (EKeyInsert&0xFF)) - { - qDebug() << "pressed EKeyInsert"; - // only reacts on release, not on press - isSwitchKey=1; - } - if((keyEvent->key()&0xFF) == (EKeyTab&0xFF)) - { - qDebug() << "pressed EKeyTab"; - } - if((keyEvent->key()&0xFF) == (EKeyDeviceF&0xFF)) - { - qDebug() << "pressed EKeyDeviceF"; - } - if( keyEvent->key() ==0x1ffffff ) - { - qDebug() << "pressed EKeyDeviceF-1ffffff"; - isSwitchKey=1; - } - } - else if (ev->type() == QEvent::KeyRelease) - { - QKeyEvent *keyEvent = static_cast(ev); - qDebug() << QString("KeyRelease:%1\n").arg(keyEvent->key(), 0, 16) ; - if( keyEvent->key() ==0x1ffffff ) - { - RDEBUG( "released EKeyDeviceF-1ffffff", 1 ); - // isSwitchKey=1; this should happen is pressed was not processed (hint: if it is/was in background) - } - } - RDEBUG( "isSwitchKey", isSwitchKey ); - if(isSwitchKey) - { - int ret; - DebugStatus(iLockStatus); - if(iLockStatus==ELockNotActive) - { - iShowKeyguardNote = 1; // note on enable keyguard - ret = TryChangeStatus(ELockAppEnableKeyguard); // this should not ask confirmation - } - else if(iLockStatus==EKeyguardActive) - { - iShowKeyguardNote = 1; // note on disable keyguard - ret = TryChangeStatus(ELockAppDisableKeyguard); - } - else if(iLockStatus==EDevicelockActive) - { - ret = TryChangeStatus(ELockAppDisableDevicelock); - } - } // isSwitchKey - } // ev - // Process if not done before. For example, redraw or quit + { + int isSwitchKey = 0; + // on device, this doesn't seem to get the EKeyDeviceF key: only 1ffffff + if (ev->type() == QEvent::KeyPress) + { + QKeyEvent *keyEvent = static_cast (ev); + qDebug() << QString("KeyPress:%1\n").arg(keyEvent->key(), 0, 16); + qDebug() << keyEvent->key(); + qDebug() << EKeyInsert; + qDebug() << (keyEvent->key() & 0xFF); + qDebug() << (EKeyInsert & 0xFF); + if ((keyEvent->key() & 0xFF) == (EKeyInsert & 0xFF)) + { + qDebug() << "pressed EKeyInsert"; + // only reacts on release, not on press + isSwitchKey = 1; + } + if ((keyEvent->key() & 0xFF) == (EKeyTab & 0xFF)) + { + qDebug() << "pressed EKeyTab"; + } + if ((keyEvent->key() & 0xFF) == (EKeyDeviceF & 0xFF)) + { + qDebug() << "pressed EKeyDeviceF"; + } + if (keyEvent->key() == 0x1ffffff) + { + qDebug() << "pressed EKeyDeviceF-1ffffff"; + isSwitchKey = 1; + } + } + else if (ev->type() == QEvent::KeyRelease) + { + QKeyEvent *keyEvent = static_cast (ev); + qDebug() + << QString("KeyRelease:%1\n").arg(keyEvent->key(), 0, 16); + if (keyEvent->key() == 0x1ffffff) + { + RDEBUG("released EKeyDeviceF-1ffffff", 1); + // isSwitchKey=1; this should happen is pressed was not processed (hint: if it is/was in background) + } + } + RDEBUG("isSwitchKey", isSwitchKey); + if (isSwitchKey) + { + int ret = KErrNone; + DebugStatus( iLockStatus); + if (iLockStatus == ELockNotActive) + { + iShowKeyguardNote = 1; // note on enable keyguard + ret = TryChangeStatus(ELockAppEnableKeyguard); // this should not ask confirmation + } + else if (iLockStatus == EKeyguardActive) + { + iShowKeyguardNote = 1; // note on disable keyguard + ret = TryChangeStatus(ELockAppDisableKeyguard); + } + else if (iLockStatus == EDevicelockActive) + { + ret = TryChangeStatus(ELockAppDisableDevicelock); + } + else + { + RDEBUG("unknown iLockStatus", iLockStatus); + } + RDEBUG("ret", ret); + } // isSwitchKey + } // ev + // Process if not done before. For example, redraw or quit return QWidget::event(ev); -} + } bool AutolockSrv::eventFilter(QObject *o, QEvent *ev) -{ - // this never happens - RDEBUG( "0", 0 ); + { + // this never happens + RDEBUG("0", 0); return QWidget::eventFilter(o, ev); - -} + + } void AutolockSrv::subscriberKSettingsAutolockStatusChanged() { - RDEBUG( "0", 0 ); - QVariant v = subscriberKSettingsAutolockStatus->value("/KCRUidSecuritySettings/KSettingsAutolockStatus"); - adjustInactivityTimers(KSettingsAutolockStatus); - qDebug() << "AutolockSrv::subscriberKSettingsAutolockStatusChanged" << v; - } + RDEBUG("0", 0); + QVariant v = subscriberKSettingsAutolockStatus->value( + "/KCRUidSecuritySettings/KSettingsAutolockStatus"); + adjustInactivityTimers( KSettingsAutolockStatus); + qDebug() << "AutolockSrv::subscriberKSettingsAutolockStatusChanged" << v; + } void AutolockSrv::subscriberKSettingsAutoLockTimeChanged() { - RDEBUG( "0", 0 ); - QVariant v = subscriberKSettingsAutoLockTime->value("/KCRUidSecuritySettings/KSettingsAutoLockTime"); - adjustInactivityTimers(KSettingsAutoLockTime); - qDebug() << "AutolockSrv::subscriberKSettingsAutoLockTimeChanged" << v; - } + RDEBUG("0", 0); + QVariant v = subscriberKSettingsAutoLockTime->value( + "/KCRUidSecuritySettings/KSettingsAutoLockTime"); + adjustInactivityTimers( KSettingsAutoLockTime); + qDebug() << "AutolockSrv::subscriberKSettingsAutoLockTimeChanged" << v; + } void AutolockSrv::subscriberKSettingsAutomaticKeyguardTimeChanged() { - RDEBUG( "0", 0 ); - QVariant v = subscriberKSettingsAutomaticKeyguardTime->value("/KCRUidSecuritySettings/KSettingsAutomaticKeyguardTime"); - adjustInactivityTimers(KSettingsAutoLockTime); - qDebug() << "AutolockSrv::subscriberKSettingsAutomaticKeyguardTimeChanged" << v; - } + RDEBUG("0", 0); + QVariant v = subscriberKSettingsAutomaticKeyguardTime->value( + "/KCRUidSecuritySettings/KSettingsAutomaticKeyguardTime"); + adjustInactivityTimers( KSettingsAutoLockTime); + qDebug() + << "AutolockSrv::subscriberKSettingsAutomaticKeyguardTimeChanged" + << v; + } void AutolockSrv::subscriberKDisplayLightsTimeoutChanged() { - RDEBUG( "0", 0 ); - QVariant v = subscriberKDisplayLightsTimeout->value("/KCRUidLightSettings/KDisplayLightsTimeout"); - // nothing to do - qDebug() << "AutolockSrv::subscriberKDisplayLightsTimeoutChanged" << v; - } + RDEBUG("0", 0); + QVariant v = subscriberKDisplayLightsTimeout->value( + "/KCRUidLightSettings/KDisplayLightsTimeout"); + // nothing to do + qDebug() << "AutolockSrv::subscriberKDisplayLightsTimeoutChanged" << v; + } void AutolockSrv::subscriberKProEngActiveProfileChanged() { - RDEBUG( "0", 0 ); - QVariant v = subscriberKProEngActiveProfile->value("/KCRUidProfileEngine/KProEngActiveProfile"); - // nothing to do - qDebug() << "AutolockSrv::subscriberKProEngActiveProfileChanged" << v; - } + RDEBUG("0", 0); + QVariant v = subscriberKProEngActiveProfile->value( + "/KCRUidProfileEngine/KProEngActiveProfile"); + // nothing to do + qDebug() << "AutolockSrv::subscriberKProEngActiveProfileChanged" << v; + } // ----------AutolockSrvService--------------- -AutolockSrvService::AutolockSrvService(AutolockSrv* parent) -: XQServiceProvider(QLatin1String("com.nokia.services.AutolockSrv.AutolockSrv"),parent), - mAutolockSrv(parent), - mAsyncReqId(-1), - mAsyncAnswer(false) -{ - RDEBUG( "0", 0 ); - publishAll(); - connect(this, SIGNAL(returnValueDelivered()), parent, SLOT(handleAnswerDelivered())); -} +AutolockSrvService::AutolockSrvService(AutolockSrv* parent) : + XQServiceProvider(QLatin1String( + "com.nokia.services.AutolockSrv.AutolockSrv"), parent), + mAutolockSrv(parent), mAsyncReqId(-1), mAsyncAnswer(false) + { + RDEBUG("0", 0); + publishAll(); + connect(this, SIGNAL(returnValueDelivered()), parent, SLOT( + handleAnswerDelivered())); + } AutolockSrvService::~AutolockSrvService() -{ - RDEBUG( "0", 0 ); -} + { + RDEBUG("0", 0); + } void AutolockSrvService::complete(QString number) -{ - RDEBUG( "0", 0 ); + { + RDEBUG("0", 0); if (mAsyncReqId == -1) return; XQSERVICE_DEBUG_PRINT("AutolockSrvService::complete"); - completeRequest(mAsyncReqId,number.toInt()); -} + completeRequest(mAsyncReqId, number.toInt()); + } // gor API request -int AutolockSrvService::service(const QString& number, const QString& aParam1, const QString& aParam2 ) -{ - RDEBUG( "0", 0 ); - qDebug() << "number=" << number; - qDebug() << "aParam1=" << aParam1; - qDebug() << "aParam2=" << aParam2; - mAsyncAnswer = false; +int AutolockSrvService::service(const QString& number, + const QString& aParam1, const QString& aParam2) + { + RDEBUG("0", 0); + TInt err = KErrNone; + qDebug() << "number=" << number; + qDebug() << "aParam1=" << aParam1; + qDebug() << "aParam2=" << aParam2; + mAsyncAnswer = false; XQRequestInfo info = requestInfo(); QSet caps = info.clientCapabilities(); - - mAutolockSrv->callerHasECapabilityWriteDeviceData=0; - if(caps.contains(ECapabilityWriteDeviceData)) - { - RDEBUG( "callerHasECapabilityWriteDeviceData", ECapabilityWriteDeviceData ); - mAutolockSrv->callerHasECapabilityWriteDeviceData=1; - } - + + mAutolockSrv->callerHasECapabilityWriteDeviceData = 0; + if (caps.contains(ECapabilityWriteDeviceData)) + { + RDEBUG("callerHasECapabilityWriteDeviceData", + ECapabilityWriteDeviceData); + mAutolockSrv->callerHasECapabilityWriteDeviceData = 1; + } + QString label = "AutolockSrv::service:\n"; label += QString("number=%1\n").arg(number); - - mNumber = number ; + + mNumber = number; mAutolockSrv->setLabelNumber(label, number); int ret = 0; ret = number.toInt(); - mAutolockSrv->mParam1 = aParam1.toInt(); - mAutolockSrv->iShowKeyguardNote = aParam1.toInt(); - mAutolockSrv->mParam2 = aParam2.toInt(); - ret = mAutolockSrv->TryChangeStatus(ret); - RDEBUG( "ret", ret ); + mAutolockSrv->mParam1 = aParam1.toInt(); + mAutolockSrv->iShowKeyguardNote = aParam1.toInt(); + mAutolockSrv->mParam2 = aParam2.toInt(); + TTime myTime; + myTime.HomeTime(); + TInt myTimeHigh = 0; + TInt myTimeLow = 0; + err = RProperty::Get(KPSUidSecurityUIs, KSecurityUIsLockInitiatorTimeHigh, myTimeHigh ); + RDEBUG("err", err); + RDEBUG("myTimeHigh", myTimeHigh); + err = RProperty::Get(KPSUidSecurityUIs, KSecurityUIsLockInitiatorTimeLow, myTimeLow ); + RDEBUG("err", err); + RDEBUG("myTimeLow", myTimeLow); + + myTimeHigh = myTime.Int64() >> 16; + myTimeLow = myTime.Int64() & 0xFFFFFFFF ; + RDEBUG("myTimeHigh", myTimeHigh); + RDEBUG("myTimeLow", myTimeLow); + err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsLockInitiatorTimeHigh, myTimeHigh ); + err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsLockInitiatorTimeLow, myTimeLow ); + + + ret = mAutolockSrv->TryChangeStatus(ret); + RDEBUG("ret", ret); return ret; -} + } void AutolockSrvService::handleClientDisconnect() -{ - RDEBUG( "0", 0 ); + { + RDEBUG("0", 0); // Just quit service application if client ends mAsyncAnswer = false; - RDEBUG( "0", 0 ); + RDEBUG("0", 0); // mAutolockSrv->quit(); -} + } /****************/ CWait* CWait::NewL() { - CWait* self = new(ELeave) CWait(); + CWait* self = new (ELeave) CWait(); CleanupStack::PushL(self); self->ConstructL(); CleanupStack::Pop(); return self; } -void CWait::ConstructL() - { - CActiveScheduler::Add(this); - } -CWait::CWait() : CActive(0) - { - } +void CWait::ConstructL() + { + CActiveScheduler::Add(this); + } +CWait::CWait() : + CActive(0) + { + } CWait::~CWait() { - Cancel(); - } + Cancel(); + } TInt CWait::WaitForRequestL() - { - SetActive(); - iWait.Start(); - return iStatus.Int(); - } + { + SetActive(); + iWait.Start(); + return iStatus.Int(); + } void CWait::RunL() - { - if(iWait.IsStarted()) - iWait.AsyncStop(); - } + { + if (iWait.IsStarted()) + iWait.AsyncStop(); + } void CWait::DoCancel() { - if(iWait.IsStarted()) - iWait.AsyncStop(); + if (iWait.IsStarted()) + iWait.AsyncStop(); } void CWait::SetRequestType(TInt aRequestType) -{ + { iRequestType = aRequestType; -} + } TInt CWait::GetRequestType() -{ + { return iRequestType; -} + } diff -r 8957df7b0072 -r 098e361762d2 securitydialogs/SecUi/Inc/SecQueryUi.h --- a/securitydialogs/SecUi/Inc/SecQueryUi.h Mon May 03 13:20:16 2010 +0300 +++ b/securitydialogs/SecUi/Inc/SecQueryUi.h Fri May 14 16:43:26 2010 +0300 @@ -20,8 +20,9 @@ #define C_SECQUERYUI_H #include // CActive -#include // MHbDeviceDialogObserver +#include // MHbDeviceDialogObserver #include +#include #define ESecUiTypeMask 0x0FFFFFF @@ -34,9 +35,12 @@ #define ESecUiAlphaSupported 0x4000000 #define ESecUiAlphaNotSupported 0x0000000 +#define ESecUiSecretSupported 0x8000000 +#define ESecUiSecretNotSupported 0x0000000 + class MSecQueryUiCertificateDetailsProvider; class MSecQueryUiDrmDetailsProvider; -class CHbDeviceDialog; +class CHbDeviceDialogSymbian; class CHbSymbianVariantMap; class CActiveSchedulerWait; class CApaMaskedBitmap; @@ -195,7 +199,7 @@ TInt WaitUntilDeviceDialogClosed(); private: // data - CHbDeviceDialog* iDeviceDialog; + CHbDeviceDialogSymbian* iDeviceDialog; CHbSymbianVariantMap* iVariantMap; CActiveSchedulerWait* iWait; TBool iIsDisplayingDialog; diff -r 8957df7b0072 -r 098e361762d2 securitydialogs/SecUi/Src/SecQueryUi.cpp --- a/securitydialogs/SecUi/Src/SecQueryUi.cpp Mon May 03 13:20:16 2010 +0300 +++ b/securitydialogs/SecUi/Src/SecQueryUi.cpp Fri May 14 16:43:26 2010 +0300 @@ -17,16 +17,16 @@ #include "SecQueryUi.h" // CSecQueryUi // #include // SIF UI device dialog parameters -#include // CHbDeviceDialog +#include // CHbDeviceDialogSymbian #include // CHbSymbianVariantMap #include // CApaMaskedBitmap +#include #include #include #include "SecUiWait.h" // Variant map keys for notification device dialog -_LIT( KNotifDeviceDialogLiteral, "com.nokia.hb.devicenotificationdialog/1.0" ); _LIT( KNotifDeviceDialogKeyTimeOut, "timeout" ); _LIT( KNotifDeviceDialogKeyIconName, "iconName" ); _LIT( KNotifDeviceDialogKeyText, "text" ); @@ -36,10 +36,10 @@ _LIT( KNotifDeviceDialogKeyActivatedValue, "activated" ); _LIT( KNotifDeviceDialogKeyTitleTextWrapping, "titleTextWrapping" ); -const TInt KMaxNumberOfPINAttempts(3); -const TInt KLastRemainingInputAttempt(1); - -const TUid KSWInstHelpUid = { 0x101F8512 }; // TODO +const TUid KSWInstHelpUid = + { + 0x101F8512 + }; // TODO // ======== MEMBER FUNCTIONS ======== @@ -50,8 +50,8 @@ // EXPORT_C CSecQueryUi* CSecQueryUi::NewLC() { - CSecQueryUi* self = new( ELeave ) CSecQueryUi(); - CleanupStack::PushL( self ); + CSecQueryUi* self = new (ELeave) CSecQueryUi(); + CleanupStack::PushL(self); self->ConstructL(); return self; } @@ -63,11 +63,10 @@ EXPORT_C CSecQueryUi* CSecQueryUi::NewL() { CSecQueryUi* self = CSecQueryUi::NewLC(); - CleanupStack::Pop( self ); + CleanupStack::Pop(self); return self; } - // --------------------------------------------------------------------------- // CSecQueryUi::~CSecQueryUi() // --------------------------------------------------------------------------- @@ -84,54 +83,89 @@ // CSecQueryUi::InstallConfirmationQueryL() // --------------------------------------------------------------------------- // -EXPORT_C TBool CSecQueryUi::InstallConfirmationQueryL( TInt aType, RMobilePhone::TMobilePassword& password ) +EXPORT_C TBool CSecQueryUi::InstallConfirmationQueryL(TInt aType, + RMobilePhone::TMobilePassword& password) /* - const TDesC& aAppName, - const TDesC& aIconFile, const TDesC& aAppVersion, TInt aAppSize, - const TDesC& aAppDetails ) */ + const TDesC& aAppName, + const TDesC& aIconFile, const TDesC& aAppVersion, TInt aAppSize, + const TDesC& aAppDetails ) */ { - - RDEBUG( "This should never be called. Obsolete", 0 ); - return KErrAbort ; + // this is never used. Kept as a reference + RDEBUG("This should never be called. Obsolete aType", aType); + return KErrAbort; } // --------------------------------------------------------------------------- // CSecQueryUi::SecQueryDialog() // --------------------------------------------------------------------------- // -EXPORT_C TInt CSecQueryUi::SecQueryDialog(const TDesC& aCaption, TDes& aDataText, TInt aMinLength,TInt aMaxLength,TInt aMode) +EXPORT_C TInt CSecQueryUi::SecQueryDialog(const TDesC& aCaption, + TDes& aDataText, TInt aMinLength, TInt aMaxLength, TInt aMode) { - RDEBUG( "aCaption", 0 ); - RDebug::Print( aCaption ); - RDEBUG( "aMode", aMode ); + RDEBUG("aCaption", 0); + RDebug::Print(aCaption); + RDEBUG("aMode", aMode); + TInt secUiOriginatedQuery(ESecurityUIsSecUIOriginatedUninitialized); + TInt err = RProperty::Get(KPSUidSecurityUIs, + KSecurityUIsSecUIOriginatedQuery, secUiOriginatedQuery); + RDEBUG("secUiOriginatedQuery", secUiOriginatedQuery); + if (secUiOriginatedQuery != ESecurityUIsSecUIOriginatedUninitialized) + { + // The query is already shown. This is valid for ESecurityUIsSecUIOriginated, and maybe for ESecurityUIsETelAPIOriginated + // For ESecurityUIsSystemLockOriginated it means that the "lock" dialog is already present. + // What to do? Can't dismiss the dialog because it's not owned. Can't device-unlock without asking code. Only can disable keyguard + RDEBUG("!!!! warning: secUiOriginatedQuery", secUiOriginatedQuery); + } + else + { + // set only if not set + err = RProperty::Set(KPSUidSecurityUIs, + KSecurityUIsSecUIOriginatedQuery, + ESecurityUIsETelAPIOriginated); + RDEBUG("setting secUiOriginatedQuery", ESecurityUIsETelAPIOriginated); + } - ClearParamsAndSetNoteTypeL( aMode ); - AddParamL( _L("KSecQueryUiApplicationName"), aCaption ); + ClearParamsAndSetNoteTypeL(aMode); + AddParamL(_L("KSecQueryUiApplicationName"), aCaption); - _LIT(KTitle, "title"); + _LIT(KTitle, "title"); // _LIT(KTitleValue1, "Enter PIN"); - AddParamL( KTitle, aCaption ); - AddParamL( _L("MinLength"), aMinLength ); - AddParamL( _L("MaxLength"), aMaxLength ); - - _LIT( KCodeTop, "codeTop" ); _LIT( KCodeTopValue, "codeTop" ); - AddParamL( KCodeTop, KCodeTopValue ); + AddParamL(KTitle, aCaption); + AddParamL(_L("MinLength"), aMinLength); + AddParamL(_L("MaxLength"), aMaxLength); + + _LIT(KCodeTop, "codeTop"); + _LIT(KCodeTopValue, "codeTop"); + AddParamL(KCodeTop, KCodeTopValue); - if( aCaption.Find(_L("|"))>0 ) - { - RDEBUG( "codeBottom aMode", aMode ); - _LIT( KCodeBottom, "codeBottom" ); _LIT( KCodeBottomValue, "codeBottom" ); - AddParamL( KCodeBottom, KCodeBottomValue ); - } + if (aCaption.Find(_L("|")) > 0) + { + RDEBUG("codeBottom aMode", aMode); + _LIT(KCodeBottom, "codeBottom"); + _LIT(KCodeBottomValue, "codeBottom"); + AddParamL(KCodeBottom, KCodeBottomValue); + } + if (aDataText.Length() > 0) + { + RDEBUG("aDataText", 1); + _LIT(KDefaultCode, "DefaultCode"); + AddParamL(KDefaultCode, aDataText); + } - RDEBUG( "0", 0 ); - DisplayDeviceDialogL(); - TInt error = WaitUntilDeviceDialogClosed(); - RDEBUG( "error", error ); - User::LeaveIfError( error ); + RDEBUG("0", 0); + DisplayDeviceDialogL(); + TInt error = WaitUntilDeviceDialogClosed(); + RDEBUG("error", error); + User::LeaveIfError(error); aDataText.Copy(iPassword); - RDEBUG( "iReturnValue", iReturnValue ); + + err = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, + ESecurityUIsSecUIOriginatedUninitialized); + RDEBUG("clearing secUiOriginatedQuery", + ESecurityUIsSecUIOriginatedUninitialized); + + RDEBUG("iReturnValue", iReturnValue); return iReturnValue; } @@ -139,22 +173,24 @@ // CSecQueryUi::DisplayInformationNoteL() // --------------------------------------------------------------------------- // -EXPORT_C void CSecQueryUi::DisplayInformationNoteL( const TDesC& aText ) +EXPORT_C void CSecQueryUi::DisplayInformationNoteL(const TDesC& aText) { + // this is never used. Kept as a reference + RDEBUG("This should never be called. Obsolete", 0); /* - ClearParamsAndSetNoteTypeL( SecQueryUiInformationNote ); - AddParamL( KNotifDeviceDialogKeyText, aText ); - AddParamL( KNotifDeviceDialogKeyTimeOut, 0 ); - iDeviceDialog->Show( KNotifDeviceDialogLiteral, *iVariantMap, this ); - User::LeaveIfError( WaitUntilDeviceDialogClosed() ); - */ + ClearParamsAndSetNoteTypeL( SecQueryUiInformationNote ); + AddParamL( KNotifDeviceDialogKeyText, aText ); + AddParamL( KNotifDeviceDialogKeyTimeOut, 0 ); + iDeviceDialog->Show( KNotifDeviceDialogLiteral, *iVariantMap, this ); + User::LeaveIfError( WaitUntilDeviceDialogClosed() ); + */ } // --------------------------------------------------------------------------- // CSecQueryUi::DisplayWarningNoteL() // --------------------------------------------------------------------------- // -EXPORT_C void CSecQueryUi::DisplayWarningNoteL( const TDesC& aText ) +EXPORT_C void CSecQueryUi::DisplayWarningNoteL(const TDesC& aText) { } @@ -162,7 +198,7 @@ // CSecQueryUi::DisplayErrorNoteL() // --------------------------------------------------------------------------- // -EXPORT_C void CSecQueryUi::DisplayErrorNoteL( const TDesC& aText ) +EXPORT_C void CSecQueryUi::DisplayErrorNoteL(const TDesC& aText) { } @@ -170,7 +206,7 @@ // CSecQueryUi::DisplayPermanentNoteL() // --------------------------------------------------------------------------- // -EXPORT_C void CSecQueryUi::DisplayPermanentNoteL( const TDesC& aText ) +EXPORT_C void CSecQueryUi::DisplayPermanentNoteL(const TDesC& aText) { } @@ -186,26 +222,27 @@ // CSecQueryUi::DisplayProgressNoteL() // --------------------------------------------------------------------------- // -EXPORT_C void CSecQueryUi::DisplayProgressNoteL( const TDesC& aText, TInt aFinalValue ) +EXPORT_C void CSecQueryUi::DisplayProgressNoteL(const TDesC& aText, + TInt aFinalValue) { -/* - ClearParamsAndSetNoteTypeL( ESecQueryUiProgressNoteType ); - AddParamL( KSecQueryUiProgressNoteText, aText ); - AddParamL( KSecQueryUiProgressNoteFinalValue, aFinalValue ); - DisplayDeviceDialogL(); -*/ } + /* + ClearParamsAndSetNoteTypeL( ESecQueryUiProgressNoteType ); + AddParamL( KSecQueryUiProgressNoteText, aText ); + AddParamL( KSecQueryUiProgressNoteFinalValue, aFinalValue ); + DisplayDeviceDialogL(); + */} // --------------------------------------------------------------------------- // CSecQueryUi::UpdateProgressNoteValueL() // --------------------------------------------------------------------------- // -EXPORT_C void CSecQueryUi::UpdateProgressNoteValueL( TInt aNewValue ) +EXPORT_C void CSecQueryUi::UpdateProgressNoteValueL(TInt aNewValue) { -/* - ClearParamsAndSetNoteTypeL( ESecQueryUiProgressNoteType ); - AddParamL( KSecQueryUiProgressNoteValue, aNewValue ); - DisplayDeviceDialogL(); -*/ } + /* + ClearParamsAndSetNoteTypeL( ESecQueryUiProgressNoteType ); + AddParamL( KSecQueryUiProgressNoteValue, aNewValue ); + DisplayDeviceDialogL(); + */} // --------------------------------------------------------------------------- // CSecQueryUi::CloseProgressNoteL() @@ -219,8 +256,8 @@ // CSecQueryUi::DisplayWaitNoteL() // --------------------------------------------------------------------------- // -EXPORT_C void CSecQueryUi::DisplayWaitNoteL( const TDesC& aText, - TRequestStatus& aStatus ) +EXPORT_C void CSecQueryUi::DisplayWaitNoteL(const TDesC& aText, + TRequestStatus& aStatus) { } @@ -236,7 +273,8 @@ // CSecQueryUi::LaunchHelpL() // --------------------------------------------------------------------------- // -EXPORT_C void CSecQueryUi::LaunchHelpL( const TDesC& aContext, const TUid& aUid ) +EXPORT_C void CSecQueryUi::LaunchHelpL(const TDesC& aContext, + const TUid& aUid) { } @@ -244,9 +282,9 @@ // CSecQueryUi::LaunchHelpL() // --------------------------------------------------------------------------- // -EXPORT_C void CSecQueryUi::LaunchHelpL( const TDesC& aContext ) +EXPORT_C void CSecQueryUi::LaunchHelpL(const TDesC& aContext) { - LaunchHelpL( aContext, KSWInstHelpUid ); + LaunchHelpL(aContext, KSWInstHelpUid); } // --------------------------------------------------------------------------- @@ -255,13 +293,13 @@ // void CSecQueryUi::DoCancel() { - RDEBUG( "0", 0 ); - if( iWait && iWait->IsStarted() && iWait->CanStopNow() ) + RDEBUG("0", 0); + if (iWait && iWait->IsStarted() && iWait->CanStopNow()) { iCompletionCode = KErrCancel; iWait->AsyncStop(); } - RDEBUG( "0", 0 ); + RDEBUG("0", 0); } // --------------------------------------------------------------------------- @@ -270,163 +308,169 @@ // void CSecQueryUi::RunL() { - RDEBUG( "0", 0 ); - if( iWait ) + RDEBUG("0", 0); + if (iWait) { iWait->AsyncStop(); } - RDEBUG( "0", 0 ); + RDEBUG("0", 0); } // --------------------------------------------------------------------------- // CSecQueryUi::DataReceived() // --------------------------------------------------------------------------- // -void CSecQueryUi::DataReceived( CHbSymbianVariantMap& aData ) +void CSecQueryUi::DataReceived(CHbSymbianVariantMap& aData) { - RDEBUG( "0", 0 ); - const CHbSymbianVariant* acceptedVariant = aData.Get( _L("accepted") ); // KSecQueryUiQueryAccepted - RDEBUG( "0", 0 ); - if( acceptedVariant ) + RDEBUG("0", 0); + const CHbSymbianVariant* acceptedVariant = aData.Get(_L("accepted")); // KSecQueryUiQueryAccepted + RDEBUG("0", 0); + if (acceptedVariant) { - RDEBUG( "0", 0 ); - TInt* acceptedValue = acceptedVariant->Value(); - RDEBUG( "acceptedValue", acceptedValue ); - RDEBUG( "*acceptedValue", *acceptedValue ); - if( acceptedValue ) + RDEBUG("0", 0); + TInt* acceptedValue = acceptedVariant->Value (); + RDEBUG("acceptedValue", acceptedValue); + RDEBUG("*acceptedValue", *acceptedValue); + if (acceptedValue) { iReturnValue = *acceptedValue; } } - const CHbSymbianVariant* acceptedVariantTop = aData.Get( _L("codeTop") ); // KSecQueryUiQueryAccepted - RDEBUG( "0", 0 ); - if( acceptedVariantTop ) + const CHbSymbianVariant* acceptedVariantTop = aData.Get(_L("codeTop")); // KSecQueryUiQueryAccepted + RDEBUG("0", 0); + if (acceptedVariantTop) { - TPtrC acceptedValueTop = *acceptedVariantTop->Value(); - RDEBUG( "acceptedValueTop", 0 ); - RDebug::Print( acceptedValueTop ); - iPassword.Copy(acceptedValueTop); - - if(iReturnValue == KErrCompletion ) // the user didn't OK. It was send automatically because validating new lock code - { - _LIT( KInvalidNewLockCode, "invalidNewLockCode" ); - _LIT( KInvalidNewLockCode0, "invalidNewLockCode#0" ); - _LIT( KInvalidNewLockCode1, "invalidNewLockCode#1" ); - _LIT( KInvalidNewLockCode2, "invalidNewLockCode#2" ); - AddParamL( KInvalidNewLockCode, KInvalidNewLockCode0 ); // for starter + TPtrC acceptedValueTop = *acceptedVariantTop->Value (); + RDEBUG("acceptedValueTop", 0); + RDebug::Print(acceptedValueTop); + iPassword.Copy(acceptedValueTop); + + if (iReturnValue == KErrCompletion) // the user didn't OK. It was send automatically because validating new lock code through TARM + { + _LIT(KInvalidNewLockCode, "invalidNewLockCode"); + _LIT(KInvalidNewLockCode0, "invalidNewLockCode#0"); + _LIT(KInvalidNewLockCode1, "invalidNewLockCode#1"); + _LIT(KInvalidNewLockCode2, "invalidNewLockCode#2"); + AddParamL(KInvalidNewLockCode, KInvalidNewLockCode0); // for starter RSCPClient scpClient; TSCPSecCode newCode; - newCode.Copy( acceptedValueTop ); - RDEBUG( "scpClient.Connect", 0 ); - if ( scpClient.Connect() == KErrNone ) + newCode.Copy(acceptedValueTop); + RDEBUG("scpClient.Connect", 0); + if (scpClient.Connect() == KErrNone) { /* - RArray aFailedPolicies; - TDevicelockPolicies failedPolicy; - TInt retLockcode = KErrNone; - RDEBUG( "scpClient.VerifyNewLockcodeAgainstPolicies", 0 ); - retLockcode = scpClient.VerifyNewLockcodeAgainstPolicies( newCode, aFailedPolicies ); - RDEBUG( "retLockcode", retLockcode ); - RDEBUG( "aFailedPolicies.Count()", aFailedPolicies.Count() ); - for(TInt i=0; i KInvalidNewLockCodeX; KInvalidNewLockCodeX.Zero(); KInvalidNewLockCodeX.Append(_L("invalidNewLockCode")); KInvalidNewLockCodeX.Append(_L("#")); - KInvalidNewLockCodeX.AppendNum(failedPolicy); - AddParamL( KInvalidNewLockCode, KInvalidNewLockCodeX ); - } - */ + RArray aFailedPolicies; + TDevicelockPolicies failedPolicy; + TInt retLockcode = KErrNone; + RDEBUG( "scpClient.VerifyNewLockcodeAgainstPolicies", 0 ); + retLockcode = scpClient.VerifyNewLockcodeAgainstPolicies( newCode, aFailedPolicies ); + RDEBUG( "retLockcode", retLockcode ); + RDEBUG( "aFailedPolicies.Count()", aFailedPolicies.Count() ); + for(TInt i=0; i KInvalidNewLockCodeX; KInvalidNewLockCodeX.Zero(); KInvalidNewLockCodeX.Append(_L("invalidNewLockCode")); KInvalidNewLockCodeX.Append(_L("#")); + KInvalidNewLockCodeX.AppendNum(failedPolicy); + AddParamL( KInvalidNewLockCode, KInvalidNewLockCodeX ); + } + */ + // TODO this should be able to modify MinLenght, MaxLenght scpClient.Close(); - } - RDEBUG( "iDeviceDialog->Update", 0 ); - iDeviceDialog->Update( *iVariantMap ); - } // KErrCompletion + } + RDEBUG("iDeviceDialog->Update", 0); + iDeviceDialog->Update(*iVariantMap); + } // KErrCompletion + + if (acceptedValueTop.Length() <= 4) // TODO store aMinLenght and check it here, instead of "4" + { + RDEBUG("CPhCltEmergencyCall", 0); + CPhCltEmergencyCall* emergencyCall = CPhCltEmergencyCall::NewL( + NULL); + RDEBUG("PushL", 0); + CleanupStack::PushL(emergencyCall); + TPhCltEmergencyNumber emNumber; + + // this relies on the fact that emergency has 3 digits, and password needs at least 4 + TBool isEmergency(EFalse); + RDEBUG("calling IsEmergencyPhoneNumber", 0); + TInt error = emergencyCall->IsEmergencyPhoneNumber( + acceptedValueTop, isEmergency); + RDEBUG("error", error); + RDEBUG("emNumber", 0); - if(acceptedValueTop.Length()<=4) // TODO store aMinLenght and check it here, instead of "4" - { - RDEBUG( "CPhCltEmergencyCall", 0 ); - CPhCltEmergencyCall* emergencyCall = CPhCltEmergencyCall::NewL( NULL ); - RDEBUG( "PushL", 0 ); - CleanupStack::PushL( emergencyCall ); - TPhCltEmergencyNumber emNumber; - - // this relies on the fact that emergency has 3 digits, and password needs at least 4 - TBool isEmergency( EFalse ); - RDEBUG( "calling IsEmergencyPhoneNumber", 0 ); - TInt error = emergencyCall->IsEmergencyPhoneNumber( acceptedValueTop, isEmergency ); - RDEBUG( "error", error ); - RDEBUG( "emNumber", 0 ); - - RDEBUG( "isEmergency", isEmergency ); - #ifdef __WINS__ - RDEBUG( "__WINS__ checking", 0 ); - if(!acceptedValueTop.CompareF(_L("112")) || !acceptedValueTop.CompareF(_L("911")) || !acceptedValueTop.CompareF(_L("555")) ) - { - isEmergency = ETrue; - error = KErrNone; - RDEBUG( "__WINS__ isEmergency", isEmergency ); - } - #endif - - if ( !error ) // oddly enough, missing capabilities also gives KErrNone - { - if(iReturnValue == KErrAbort ) // the user didn't OK. It was send automatically because short code - { - _LIT( KEmergency, "emergency" ); _LIT( KEmergencyValueYes, "emergencyYes" ); _LIT( KEmergencyValueNo, "emergencyNo" ); - if(isEmergency) - { - RDEBUG( "KEmergencyValueYes", 1 ); - AddParamL( KEmergency, KEmergencyValueYes ); - } - else - { - RDEBUG( "KEmergencyValueNo", 0 ); - AddParamL( KEmergency, KEmergencyValueNo ); - } - iDeviceDialog->Update( *iVariantMap ); - } - else if(iReturnValue == KErrNone ) - { // user pressed Call and number is valid - if(isEmergency) - { - RDEBUG( "DialEmergencyCallL", isEmergency ); - emergencyCall->DialEmergencyCallL( emNumber ); - iReturnValue = KErrAbort; // this means emergency call - } - } - } // if !error - RDEBUG( "0", 0 ); - CleanupStack::PopAndDestroy( emergencyCall ); - } // lenght<3 - } // acceptedVariantTop - RDEBUG( "iReturnValue", iReturnValue ); + RDEBUG("isEmergency", isEmergency); +#ifdef __WINS__ + RDEBUG( "__WINS__ checking", 0 ); + if(!acceptedValueTop.CompareF(_L("112")) || !acceptedValueTop.CompareF(_L("911")) || !acceptedValueTop.CompareF(_L("555")) ) + { + isEmergency = ETrue; + error = KErrNone; + RDEBUG( "__WINS__ isEmergency", isEmergency ); + } +#endif + + if (!error) // oddly enough, missing capabilities also gives KErrNone + { + if (iReturnValue == KErrAbort) // the user didn't OK. It was send automatically because short code + { + _LIT(KEmergency, "emergency"); + _LIT(KEmergencyValueYes, "emergencyYes"); + _LIT(KEmergencyValueNo, "emergencyNo"); + if (isEmergency) + { + RDEBUG("KEmergencyValueYes", 1); + AddParamL(KEmergency, KEmergencyValueYes); + } + else + { + RDEBUG("KEmergencyValueNo", 0); + AddParamL(KEmergency, KEmergencyValueNo); + } + iDeviceDialog->Update(*iVariantMap); + } + else if (iReturnValue == KErrNone) + { // user pressed Call and number is valid + if (isEmergency) + { + RDEBUG("DialEmergencyCallL", isEmergency); + emergencyCall->DialEmergencyCallL(emNumber); + iReturnValue = KErrAbort; // this means emergency call + } + } + } // if !error + RDEBUG("0", 0); + CleanupStack::PopAndDestroy(emergencyCall); + } // lenght<3 + } // acceptedVariantTop + RDEBUG("iReturnValue", iReturnValue); } // --------------------------------------------------------------------------- // CSecQueryUi::DeviceDialogClosed() // --------------------------------------------------------------------------- // -void CSecQueryUi::DeviceDialogClosed( TInt aCompletionCode ) +void CSecQueryUi::DeviceDialogClosed(TInt aCompletionCode) { - RDEBUG( "aCompletionCode", aCompletionCode ); + RDEBUG("aCompletionCode", aCompletionCode); iCompletionCode = aCompletionCode; iIsDisplayingDialog = EFalse; - TRequestStatus* status( &iStatus ); - RDEBUG( "0", 0 ); - User::RequestComplete( status, KErrNone ); - RDEBUG( "0", 0 ); + TRequestStatus* status(&iStatus); + RDEBUG("0", 0); + User::RequestComplete(status, KErrNone); + RDEBUG("0", 0); } // --------------------------------------------------------------------------- // CSecQueryUi::CSecQueryUi() // --------------------------------------------------------------------------- // -CSecQueryUi::CSecQueryUi() : CActive( CActive::EPriorityStandard ) +CSecQueryUi::CSecQueryUi() : + CActive(CActive::EPriorityStandard) { - RDEBUG( "0", 0 ); - CActiveScheduler::Add( this ); + RDEBUG("0", 0); + CActiveScheduler::Add(this); } // --------------------------------------------------------------------------- @@ -435,8 +479,8 @@ // void CSecQueryUi::ConstructL() { - RDEBUG( "0", 0 ); - iWait = new( ELeave ) CActiveSchedulerWait; + RDEBUG("0", 0); + iWait = new (ELeave) CActiveSchedulerWait; // iDeviceDialog is allocated later, first call of DisplayDeviceDialogL() } @@ -446,8 +490,8 @@ // void CSecQueryUi::ClearParamsL() { - RDEBUG( "0", 0 ); - if( iVariantMap ) + RDEBUG("0", 0); + if (iVariantMap) { delete iVariantMap; iVariantMap = NULL; @@ -459,41 +503,41 @@ // CSecQueryUi::ClearParamsAndSetNoteTypeL() // --------------------------------------------------------------------------- // -void CSecQueryUi::ClearParamsAndSetNoteTypeL( TInt aType ) +void CSecQueryUi::ClearParamsAndSetNoteTypeL(TInt aType) { - RDEBUG( "aType", aType ); + RDEBUG("aType", aType); ClearParamsL(); - AddParamL( _L("type"), aType ); + AddParamL(_L("type"), aType); } // --------------------------------------------------------------------------- // CSecQueryUi::AddParamL() // --------------------------------------------------------------------------- // -void CSecQueryUi::AddParamL( const TDesC& aKey, TInt aValue ) +void CSecQueryUi::AddParamL(const TDesC& aKey, TInt aValue) { - RDEBUG( "aValue", aValue ); + RDEBUG("aValue", aValue); CHbSymbianVariant* variant = NULL; - variant = CHbSymbianVariant::NewL( &aValue, CHbSymbianVariant::EInt ); - iVariantMap->Add( aKey, variant ); + variant = CHbSymbianVariant::NewL(&aValue, CHbSymbianVariant::EInt); + iVariantMap->Add(aKey, variant); } // --------------------------------------------------------------------------- // CSecQueryUi::AddParamL() // --------------------------------------------------------------------------- // -void CSecQueryUi::AddParamL( const TDesC& aKey, const TDesC& aValue ) +void CSecQueryUi::AddParamL(const TDesC& aKey, const TDesC& aValue) { - RDEBUG( "0", 0 ); + RDEBUG("0", 0); CHbSymbianVariant* variant = NULL; - variant = CHbSymbianVariant::NewL( &aValue, CHbSymbianVariant::EDes ); - iVariantMap->Add( aKey, variant ); + variant = CHbSymbianVariant::NewL(&aValue, CHbSymbianVariant::EDes); + iVariantMap->Add(aKey, variant); } -TInt strlen( const char* aStr ) +TInt strlen(const char* aStr) { TInt len = 0; - while( *aStr++ != 0 ) + while (*aStr++ != 0) ++len; return len; } @@ -504,25 +548,25 @@ // void CSecQueryUi::DisplayDeviceDialogL() { - RDEBUG( "0", 0 ); - if( iDeviceDialog && iIsDisplayingDialog ) + RDEBUG("0", 0); + if (iDeviceDialog && iIsDisplayingDialog) { - iDeviceDialog->Update( *iVariantMap ); + iDeviceDialog->Update(*iVariantMap); } else { - if( !iDeviceDialog ) + if (!iDeviceDialog) { - iDeviceDialog = CHbDeviceDialog::NewL(); + iDeviceDialog = CHbDeviceDialogSymbian::NewL(); } - _LIT( KSecQueryUiDeviceDialog, "com.nokia.secuinotificationdialog/1.0" ); - RDEBUG( "Show", 0 ); - iDeviceDialog->Show( KSecQueryUiDeviceDialog, *iVariantMap, this ); - RDEBUG( "iIsDisplayingDialog", iIsDisplayingDialog ); + _LIT(KSecQueryUiDeviceDialog, "com.nokia.secuinotificationdialog/1.0"); + RDEBUG("Show", 0); + iDeviceDialog->Show(KSecQueryUiDeviceDialog, *iVariantMap, this); + RDEBUG("iIsDisplayingDialog", iIsDisplayingDialog); iIsDisplayingDialog = ETrue; - RDEBUG( "iIsDisplayingDialog", iIsDisplayingDialog ); + RDEBUG("iIsDisplayingDialog", iIsDisplayingDialog); } - RDEBUG( "0", 0 ); + RDEBUG("0", 0); } // --------------------------------------------------------------------------- @@ -531,18 +575,18 @@ // TInt CSecQueryUi::WaitUntilDeviceDialogClosed() { - RDEBUG( "0", 0 ); + RDEBUG("0", 0); iCompletionCode = KErrInUse; iReturnValue = KErrUnknown; - if( !IsActive() && iWait && !iWait->IsStarted() ) + if (!IsActive() && iWait && !iWait->IsStarted()) { iStatus = KRequestPending; SetActive(); - RDEBUG( "Start", 0 ); + RDEBUG("Start", 0); iWait->Start(); - RDEBUG( "Started", 1 ); + RDEBUG("Started", 1); } - RDEBUG( "iCompletionCode", iCompletionCode ); + RDEBUG("iCompletionCode", iCompletionCode); return iCompletionCode; } diff -r 8957df7b0072 -r 098e361762d2 securitydialogs/SecUi/Src/SecUiSecurityHandler.cpp --- a/securitydialogs/SecUi/Src/SecUiSecurityHandler.cpp Mon May 03 13:20:16 2010 +0300 +++ b/securitydialogs/SecUi/Src/SecUiSecurityHandler.cpp Fri May 14 16:43:26 2010 +0300 @@ -27,7 +27,6 @@ #include // #include #endif //__COVER_DISPLAY - #include #include //used for RemoveSplashScreen #include @@ -60,9 +59,8 @@ const TInt KMaxNumberOfPINAttempts(3); const TInt KLastRemainingInputAttempt(1); -const TInt KTriesToConnectServer( 2 ); -const TInt KTimeBeforeRetryingRequest( 50000 ); - +const TInt KTriesToConnectServer(2); +const TInt KTimeBeforeRetryingRequest(50000); // ================= MEMBER FUNCTIONS ======================= // @@ -71,13 +69,13 @@ // C++ constructor // ---------------------------------------------------------- // qtdone -EXPORT_C CSecurityHandler::CSecurityHandler(RMobilePhone& aPhone): - iPhone(aPhone), iQueryCanceled(ETrue), iSecurityDlg(NULL), iNoteDlg(NULL) +EXPORT_C CSecurityHandler::CSecurityHandler(RMobilePhone& aPhone) : + iPhone(aPhone), iQueryCanceled(ETrue), iSecurityDlg(NULL), iNoteDlg(NULL) { - RDEBUG( "0", 0 ); + RDEBUG("0", 0); - TInt result = iCustomPhone.Open(aPhone); - TRAP_IGNORE( FeatureManager::InitializeLibL() ); //Shouldn't this panic if FM does not initialise?? + TInt result = iCustomPhone.Open(aPhone); + TRAP_IGNORE(FeatureManager::InitializeLibL()); //Shouldn't this panic if FM does not initialise?? } // @@ -88,9 +86,9 @@ // qtdone EXPORT_C CSecurityHandler::~CSecurityHandler() { - RDEBUG( "0", 0 ); + RDEBUG("0", 0); - if ( iDestroyedPtr ) + if (iDestroyedPtr) { *iDestroyedPtr = ETrue; iDestroyedPtr = NULL; @@ -106,12 +104,28 @@ // ---------------------------------------------------------- // qtdone EXPORT_C void CSecurityHandler::HandleEventL( - RMobilePhone::TMobilePhoneSecurityEvent aEvent ) + RMobilePhone::TMobilePhoneSecurityEvent aEvent) { - RDEBUG( "0", 0 ); + RDEBUG("0", 0); TInt result = KErrNone; - HandleEventL( aEvent, result ); + HandleEventL(aEvent, result); + } + +// +// ---------------------------------------------------------- +// CSecurityHandler::HandleEventL() +// Handles different security events +// ---------------------------------------------------------- +// qtdone +EXPORT_C void CSecurityHandler::HandleEventL( + RMobilePhone::TMobilePhoneSecurityEvent aEvent, TBool aStartup, + TInt& aResult) + { + RDEBUG("0", 0); + + iStartup = aStartup; + HandleEventL(aEvent, aResult); } // @@ -121,80 +135,65 @@ // ---------------------------------------------------------- // qtdone EXPORT_C void CSecurityHandler::HandleEventL( - RMobilePhone::TMobilePhoneSecurityEvent aEvent, - TBool aStartup, TInt& aResult ) + RMobilePhone::TMobilePhoneSecurityEvent aEvent, TInt& aResult) { - RDEBUG( "0", 0 ); - - iStartup = aStartup; - HandleEventL( aEvent, aResult ); - } - -// -// ---------------------------------------------------------- -// CSecurityHandler::HandleEventL() -// Handles different security events -// ---------------------------------------------------------- -// qtdone -EXPORT_C void CSecurityHandler::HandleEventL( - RMobilePhone::TMobilePhoneSecurityEvent aEvent, TInt& aResult ) - { - RDEBUG( "0", 0 ); + RDEBUG("0", 0); /***************************************************** - * Series 60 Customer / ETel - * Series 60 ETel API - *****************************************************/ - TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma )); - TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin )); - RDEBUG( "aEvent", aEvent ); - - switch(aEvent) - { - case RMobilePhone::EPin1Required: - #if defined(_DEBUG) - RDebug::Print(_L("(SECUI)CSecurityHandler::HandleEventL() Pin1Required")); - #endif - aResult = Pin1RequiredL(); - break; - case RMobilePhone::EPuk1Required: - #if defined(_DEBUG) - RDebug::Print(_L("(SECUI)CSecurityHandler::HandleEventL() PUK1Required")); - #endif - Puk1RequiredL(); - break; - case RMobilePhone::EPin2Required: - Pin2RequiredL(); - break; - case RMobilePhone::EPuk2Required: - Puk2RequiredL(); - break; - case RMobilePhone::EUniversalPinRequired: - if(wcdmaSupported || upinSupported) - { - aResult = UPinRequiredL(); - } - else - aResult = KErrNotSupported; - break; - case RMobilePhone::EUniversalPukRequired: - if(wcdmaSupported || upinSupported) - { - aResult = UPukRequiredL(); - } - else - aResult = KErrNotSupported; - break; - case RMobilePhone::EPhonePasswordRequired: - aResult = PassPhraseRequiredL(); - break; - case RMobilePhone::EICCTerminated: - SimLockEventL(); - break; - default: - break; - } - RDEBUG( "aResult", aResult ); + * Series 60 Customer / ETel + * Series 60 ETel API + *****************************************************/ + TBool wcdmaSupported( + FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma)); + TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin)); + RDEBUG("aEvent", aEvent); + + switch (aEvent) + { + case RMobilePhone::EPin1Required: +#if defined(_DEBUG) + RDebug::Print(_L("(SECUI)CSecurityHandler::HandleEventL() Pin1Required")); +#endif + aResult = Pin1RequiredL(); + break; + case RMobilePhone::EPuk1Required: +#if defined(_DEBUG) + RDebug::Print(_L("(SECUI)CSecurityHandler::HandleEventL() PUK1Required")); +#endif + Puk1RequiredL(); + break; + case RMobilePhone::EPin2Required: + Pin2RequiredL(); + break; + case RMobilePhone::EPuk2Required: + Puk2RequiredL(); + break; + case RMobilePhone::EUniversalPinRequired: + if (wcdmaSupported || upinSupported) + { + aResult = UPinRequiredL(); + } + else + aResult = KErrNotSupported; + break; + case RMobilePhone::EUniversalPukRequired: + if (wcdmaSupported || upinSupported) + { + aResult = UPukRequiredL(); + } + else + aResult = KErrNotSupported; + break; + case RMobilePhone::EPhonePasswordRequired: + aResult = PassPhraseRequiredL(); + break; + case RMobilePhone::EICCTerminated: + SimLockEventL(); + break; + default: + break; + } + RDEBUG("aResult", aResult); } // // ---------------------------------------------------------- @@ -203,130 +202,147 @@ // ---------------------------------------------------------- // qtdone EXPORT_C TBool CSecurityHandler::AskSecCodeL() - { + { /***************************************************** - * Series 60 Customer / ETel - * Series 60 ETel API - *****************************************************/ - #if defined(_DEBUG) + * Series 60 Customer / ETel + * Series 60 ETel API + *****************************************************/ +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecurityHandler::AskSecCodeL()")); - #endif +#endif /* if code is still not initialized, then there's no need to ask it. This fixes the error when the RFS requests the code */ - const TUid KCRUidSCPLockCode = {0x2002677B}; + const TUid KCRUidSCPLockCode = + { + 0x2002677B + }; const TUint32 KSCPLockCodeDefaultLockCode = 0x00000001; - + CRepository* repository = CRepository::NewL(KCRUidSCPLockCode); TInt currentLockStatus = -1; - TInt res=-1; - TInt lAlphaSupported=0; - TInt lCancelSupported=0; + TInt res = -1; + TInt lAlphaSupported = 0; + TInt lCancelSupported = 0; - res = repository->Get(KSCPLockCodeDefaultLockCode , currentLockStatus); - RDEBUG( "res", res ); - RDEBUG( "currentLockStatus", currentLockStatus ); + res = repository->Get(KSCPLockCodeDefaultLockCode, currentLockStatus); + RDEBUG("res", res); + RDEBUG("currentLockStatus", currentLockStatus); delete repository; - if(res==0 && currentLockStatus==1) + if (res == 0 && currentLockStatus == 1) { // code is the default one; no need to request it. return ETrue; } /* end check for default code */ - iQueryCanceled = EFalse; RMobilePhone::TMobilePassword required_fourth; - + TInt ret = KErrNone; TInt status = KErrNone; - - RMobilePhone::TMobilePassword iSecUi_password; + + RMobilePhone::TMobilePassword iSecUi_password; TInt queryAccepted = KErrCancel; - while (queryAccepted!=KErrNone) - { - RMobilePhone::TMobilePhoneSecurityCode secCodeType; - secCodeType = RMobilePhone::ESecurityCodePhonePassword; + while (queryAccepted != KErrNone) + { + RMobilePhone::TMobilePhoneSecurityCode secCodeType; + secCodeType = RMobilePhone::ESecurityCodePhonePassword; - /* request PIN using QT */ - CSecQueryUi *iSecQueryUi; - RDEBUG( "CSecQueryUi", 0 ); - iSecQueryUi = CSecQueryUi::NewL(); - lAlphaSupported = ESecUiAlphaSupported; - lCancelSupported = ESecUiCancelSupported; - TBuf<0x100> title; title.Zero(); title.Append(_L("AskSecCodeL")); title.Append(_L("#")); title.AppendNum(-1); - queryAccepted = iSecQueryUi->SecQueryDialog( title, iSecUi_password, SEC_C_SECURITY_CODE_MIN_LENGTH,SEC_C_SECURITY_CODE_MAX_LENGTH, lAlphaSupported | lCancelSupported | secCodeType /*aMode*/ ); - RDEBUG( "iSecUi_password", 0 ); - RDebug::Print( iSecUi_password ); - RDEBUG( "delete", 0 ); - delete iSecQueryUi; - RDEBUG( "queryAccepted", queryAccepted ); - /* end request PIN using QT */ - if (queryAccepted!=KErrNone) - { - ret = EFalse; - return ret; - } - - CWait* wait = CWait::NewL(); - RDEBUG( "VerifySecurityCode", 0 ); - iPhone.VerifySecurityCode(wait->iStatus,secCodeType, iSecUi_password, required_fourth); - RDEBUG( "WaitForRequestL", 0 ); - status = wait->WaitForRequestL(); - RDEBUG( "status", status ); - delete wait; - #ifdef __WINS__ - if(status==KErrNotSupported ) - { - RDEBUG( "status", status ); - status=KErrNone; - } - #endif + /* request PIN using QT */ + CSecQueryUi *iSecQueryUi; + RDEBUG("CSecQueryUi", 0); + iSecQueryUi = CSecQueryUi::NewL(); + lAlphaSupported = ESecUiAlphaSupported; + lCancelSupported = ESecUiCancelSupported; + TBuf<0x100> title; + title.Zero(); + title.Append(_L("AskSecCodeL")); + title.Append(_L("#")); + title.AppendNum(-1); + queryAccepted + = iSecQueryUi->SecQueryDialog(title, iSecUi_password, + SEC_C_SECURITY_CODE_MIN_LENGTH, + SEC_C_SECURITY_CODE_MAX_LENGTH, ESecUiSecretSupported + | lAlphaSupported | lCancelSupported + | secCodeType /*aMode*/); + RDEBUG("iSecUi_password", 0); + RDebug::Print(iSecUi_password); + RDEBUG("delete", 0); + delete iSecQueryUi; + RDEBUG("queryAccepted", queryAccepted); + /* end request PIN using QT */ + if (queryAccepted != KErrNone) + { + ret = EFalse; + return ret; + } + + CWait* wait = CWait::NewL(); + RDEBUG("VerifySecurityCode", 0); + iPhone.VerifySecurityCode(wait->iStatus, secCodeType, + iSecUi_password, required_fourth); + RDEBUG("WaitForRequestL", 0); + status = wait->WaitForRequestL(); + RDEBUG("status", status); + delete wait; +#ifdef __WINS__ + if(status==KErrNotSupported || status == KErrTimedOut) + { + RDEBUG( "status", status ); + status=KErrNone; + } +#endif - ret = ETrue; - queryAccepted = KErrCancel; // because it's not yet validated - switch(status) - { - case KErrNone: + ret = ETrue; + queryAccepted = KErrCancel; // because it's not yet validated + switch (status) + { + case KErrNone: + { + if (FeatureManager::FeatureSupported( + KFeatureIdSapTerminalControlFw) + && !(FeatureManager::FeatureSupported( + KFeatureIdSapDeviceLockEnhancements))) { - if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw ) && - !(FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements))) - { - RDEBUG( "calling RSCPClient", 0 ); - RSCPClient scpClient; - User::LeaveIfError( scpClient.Connect() ); - CleanupClosePushL( scpClient ); + RDEBUG("calling RSCPClient", 0); + RSCPClient scpClient; + User::LeaveIfError(scpClient.Connect()); + CleanupClosePushL(scpClient); - TSCPSecCode newCode; - newCode.Copy( iSecUi_password ); - scpClient.StoreCode( newCode ); - RDEBUG( "called StoreCode", 1 ); + TSCPSecCode newCode; + newCode.Copy(iSecUi_password); + scpClient.StoreCode(newCode); + RDEBUG("called StoreCode", 1); + + CleanupStack::PopAndDestroy(); //scpClient + queryAccepted = KErrNone; + } - CleanupStack::PopAndDestroy(); //scpClient - queryAccepted = KErrNone; - } - - iQueryCanceled = ETrue; // TODO - return ETrue; - } - case KErrGsmSSPasswordAttemptsViolation: - case KErrLocked: - { - // security code blocked! - CSecuritySettings::ShowResultNoteL(R_SEC_BLOCKED, CAknNoteDialog::EErrorTone); - break; - } - case KErrGsm0707IncorrectPassword: - case KErrAccessDenied: - { - // code was entered erroneusly - CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone); - } - default: - { - CSecuritySettings::ShowResultNoteL(status, CAknNoteDialog::EErrorTone); - } - } + iQueryCanceled = ETrue; // TODO + return ETrue; + } + case KErrGsmSSPasswordAttemptsViolation: + case KErrLocked: + { + // security code blocked! + CSecuritySettings::ShowResultNoteL(R_SEC_BLOCKED, + CAknNoteDialog::EErrorTone); + break; + } + case KErrGsm0707IncorrectPassword: + case KErrAccessDenied: + { + // code was entered erroneusly + CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, + CAknNoteDialog::EErrorTone); + } + default: + { + CSecuritySettings::ShowResultNoteL(status, + CAknNoteDialog::EErrorTone); + } + } } // while iQueryCanceled = ETrue; @@ -339,11 +355,11 @@ // TODO is this used? // ---------------------------------------------------------- // qtdone -EXPORT_C void CSecurityHandler::CancelSecCodeQuery() +EXPORT_C void CSecurityHandler::CancelSecCodeQuery() { - #if defined(_DEBUG) +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecurityHandler::CancelSecCodeQuery()")); - #endif +#endif if (!iQueryCanceled) { iQueryCanceled = ETrue; @@ -368,25 +384,25 @@ EXPORT_C TBool CSecurityHandler::AskSecCodeInAutoLockL() { /***************************************************** - * Series 60 Customer / ETel - * Series 60 ETel API - *****************************************************/ - - RDEBUG( "0", 0 ); - + * Series 60 Customer / ETel + * Series 60 ETel API + *****************************************************/ - #if defined(_DEBUG) + RDEBUG("0", 0); + +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecurityHandler::AskSecCodeInAutoLockL()")); - #endif +#endif TInt res; CWait* wait; - - RMobilePhone::TMobilePhoneLockSetting lockChange(RMobilePhone::ELockSetDisabled); + + RMobilePhone::TMobilePhoneLockSetting lockChange( + RMobilePhone::ELockSetDisabled); RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockPhoneDevice; - - #if defined(_DEBUG) + +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecurityHandler::AskSecCodeInAutoLockL() get autolock period")); - #endif +#endif // get autolock period from Central Repository. CRepository* repository = CRepository::NewL(KCRUidSecuritySettings); @@ -394,20 +410,20 @@ res = repository->Get(KSettingsAutoLockTime, period); delete repository; - RDEBUG( "res", res ); + RDEBUG("res", res); - #if defined(_DEBUG) +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecurityHandler::AskSecCodeInAutoLockL() autolock period:%d"), res); - #endif +#endif if (res == KErrNone) { // disable autolock in Domestic OS side too if autolock period is 0. - RDEBUG( "period", period ); - if (period == 0 ) + RDEBUG("period", period); + if (period == 0) { - #if defined(_DEBUG) +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecurityHandler::AskSecCodeInAutoLockL() Call SetLockSetting")); - #endif +#endif #ifdef RD_REMOTELOCK // If remote lock is enabled, don't disable the domestic OS device lock @@ -420,94 +436,92 @@ if ( remoteLockSettings->GetEnabled( remoteLockStatus ) ) { - RDEBUG( "0", 0 ); + RDEBUG( "0", 0 ); if ( remoteLockStatus ) { // Remote lock is enabled - #ifdef _DEBUG +#ifdef _DEBUG RDebug::Print( _L( "(SecUi)CSecurityHandler::AskSecCodeInAutoLockL() - RemoteLock is enabled: lockChange = RMobilePhone::ELockSetEnabled" ) ); - #endif // _DEBUG - +#endif // _DEBUG lockChange = RMobilePhone::ELockSetEnabled; } else { // Remote lock is disabled - #ifdef _DEBUG +#ifdef _DEBUG RDebug::Print( _L( "(SecUi)CSecurityHandler::AskSecCodeInAutoLockL() - RemoteLock is disabled: lockChange = RMobilePhone::ELockSetDisabled" ) ); - #endif // _DEBUG - +#endif // _DEBUG lockChange = RMobilePhone::ELockSetDisabled; } } else { // Failed to get remote lock status - #ifdef _DEBUG +#ifdef _DEBUG RDebug::Print( _L( "(SecUi)CSecurityHandler::AskSecCodeInAutoLockL() - Failed to get RemoteLock status" ) ); - #endif // _DEBUG +#endif // _DEBUG } delete remoteLockSettings; remoteLockSettings = NULL; #else // not defined RD_REMOTELOCK - - lockChange = RMobilePhone::ELockSetDisabled; + lockChange = RMobilePhone::ELockSetDisabled; #endif // RD_REMOTELOCK - - RDEBUG( "lockChange", lockChange ); - wait = CWait::NewL(); - RDEBUG( "0", 0 ); - // this also calls PassPhraseRequiredL ??? - RDEBUG( "SetLockSetting", 1 ); - iPhone.SetLockSetting(wait->iStatus,lockType,lockChange); - res = KErrNone; - RDEBUG( "WaitForRequestL", 0 ); - res = wait->WaitForRequestL(); - RDEBUG( "res", res ); - delete wait; - #if defined(_DEBUG) - RDebug::Print(_L("(SECUI)CSecurityHandler::AskSecCodeInAutoLockL() SetLockSetting RESULT:%d"), res); - #endif - } // from period == 0 + RDEBUG("lockChange", lockChange); + wait = CWait::NewL(); + RDEBUG("0", 0); + // this also calls PassPhraseRequiredL ??? + RDEBUG("SetLockSetting", 1); + iPhone.SetLockSetting(wait->iStatus, lockType, lockChange); + res = KErrNone; + RDEBUG("WaitForRequestL", 0); + res = wait->WaitForRequestL(); + RDEBUG("res", res); + delete wait; +#if defined(_DEBUG) + RDebug::Print(_L("(SECUI)CSecurityHandler::AskSecCodeInAutoLockL() SetLockSetting RESULT:%d"), res); +#endif + } // from period == 0 else - { // ask security code - #if defined(_DEBUG) - RDebug::Print(_L("(SECUI)CSecurityHandler::AskSecCodeInAutoLockL() Ask sec code via notifier")); - #endif - RDEBUG( "0", 0 ); - RNotifier codeQueryNotifier; - User::LeaveIfError(codeQueryNotifier.Connect()); - CWait* wait = CWait::NewL(); - CleanupStack::PushL(wait); - TInt queryResponse = 0; - TPckg response(queryResponse); - RDEBUG( "0", 0 ); - TSecurityNotificationPckg params; - params().iEvent = static_cast(RMobilePhone::EPhonePasswordRequired); - params().iStartup = EFalse; - #if defined(_DEBUG) - RDebug::Print(_L("(SECUI)CSecurityHandler::AskSecCodeInAutoLockL() Start Notifier")); - #endif - RDEBUG( "0", 0 ); - RDEBUG( "StartNotifierAndGetResponse", 0 ); - codeQueryNotifier.StartNotifierAndGetResponse(wait->iStatus, KSecurityNotifierUid,params, response); - // this will eventually call PassPhraseRequiredL - RDEBUG( "WaitForRequestL", 0 ); - res = wait->WaitForRequestL(); - RDEBUG( "WaitForRequestL", 1 ); - RDEBUG( "res", res ); - CleanupStack::PopAndDestroy(); // wait - if(res == KErrNone) - res = queryResponse; - } // from else period == 0 - RDEBUG( "0", 0 ); + { // ask security code +#if defined(_DEBUG) + RDebug::Print(_L("(SECUI)CSecurityHandler::AskSecCodeInAutoLockL() Ask sec code via notifier")); +#endif + RDEBUG("0", 0); + RNotifier codeQueryNotifier; + User::LeaveIfError(codeQueryNotifier.Connect()); + CWait* wait = CWait::NewL(); + CleanupStack::PushL(wait); + TInt queryResponse = 0; + TPckg response(queryResponse); + RDEBUG("0", 0); + TSecurityNotificationPckg params; + params().iEvent + = static_cast (RMobilePhone::EPhonePasswordRequired); + params().iStartup = EFalse; +#if defined(_DEBUG) + RDebug::Print(_L("(SECUI)CSecurityHandler::AskSecCodeInAutoLockL() Start Notifier")); +#endif + RDEBUG("0", 0); + RDEBUG("StartNotifierAndGetResponse", 0); + codeQueryNotifier.StartNotifierAndGetResponse(wait->iStatus, + KSecurityNotifierUid, params, response); + // this will eventually call PassPhraseRequiredL + RDEBUG("WaitForRequestL", 0); + res = wait->WaitForRequestL(); + RDEBUG("WaitForRequestL", 1); + RDEBUG("res", res); + CleanupStack::PopAndDestroy(); // wait + if (res == KErrNone) + res = queryResponse; + } // from else period == 0 + RDEBUG("0", 0); } else - { // can't read repository for KSettingsAutoLockTime - RDEBUG( "KERRSOMETHING:Call SetLockSetting", 0 ); + { // can't read repository for KSettingsAutoLockTime + RDEBUG("KERRSOMETHING:Call SetLockSetting", 0); #ifdef RD_REMOTELOCK @@ -524,67 +538,64 @@ if ( remoteLockStatus ) { // Remote lock is enabled - #ifdef _DEBUG +#ifdef _DEBUG RDebug::Print( _L( "(SecUi)CSecurityHandler::AskSecCodeInAutoLockL() - Failed to get AutoLock status and RemoteLock is enabled: lockChange = RMobilePhone::ELockSetEnabled" ) ); - #endif // _DEBUG - +#endif // _DEBUG lockChange = RMobilePhone::ELockSetEnabled; } else { // Remote lock is disabled - #ifdef _DEBUG +#ifdef _DEBUG RDebug::Print( _L( "(SecUi)CSecurityHandler::AskSecCodeInAutoLockL() - Failed to get AutoLock status and RemoteLock is disabled: lockChange = RMobilePhone::ELockSetDisabled" ) ); - #endif // _DEBUG - +#endif // _DEBUG lockChange = RMobilePhone::ELockSetDisabled; } } else { // Failed to get remote lock status - #ifdef _DEBUG +#ifdef _DEBUG RDebug::Print( _L( "(SecUi)CSecurityHandler::AskSecCodeInAutoLockL() - Failed to get AutoLock status and failed to get RemoteLock status" ) ); - #endif // _DEBUG +#endif // _DEBUG } delete remoteLockSettings; remoteLockSettings = NULL; #else // not defined RD_REMOTELOCK - // could not get the current autolock time... disable autolock in Domestic OS side. lockChange = RMobilePhone::ELockSetDisabled; #endif // RD_REMOTELOCK - RDEBUG( "0", 0 ); + RDEBUG("0", 0); wait = CWait::NewL(); - RDEBUG( "SetLockSetting", 0 ); - iPhone.SetLockSetting(wait->iStatus,lockType,lockChange); - RDEBUG( "WaitForRequestL", 0 ); + RDEBUG("SetLockSetting", 0); + iPhone.SetLockSetting(wait->iStatus, lockType, lockChange); + RDEBUG("WaitForRequestL", 0); res = wait->WaitForRequestL(); - RDEBUG( "WaitForRequestL", 1 ); + RDEBUG("WaitForRequestL", 1); delete wait; - #if defined(_DEBUG) +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecurityHandler::AskSecCodeInAutoLockL() KES: SetLockSetting RESULT:%d"), res); - #endif +#endif } - - RDEBUG( "res", res ); + + RDEBUG("res", res); switch (res) { case KErrNone: { - return ETrue; + return ETrue; } case KErrGsmSSPasswordAttemptsViolation: case KErrLocked: case KErrGsm0707IncorrectPassword: case KErrAccessDenied: { - RDEBUG( "KErrAccessDenied", KErrAccessDenied ); - return AskSecCodeInAutoLockL(); + RDEBUG("KErrAccessDenied", KErrAccessDenied); + return AskSecCodeInAutoLockL(); } case KErrAbort: case KErrCancel: @@ -592,7 +603,7 @@ return EFalse; default: { - RDEBUG( "default", res ); + RDEBUG("default", res); return AskSecCodeInAutoLockL(); } } @@ -606,210 +617,224 @@ TInt CSecurityHandler::PassPhraseRequiredL() { /***************************************************** - * Series 60 Customer / ETel - * Series 60 ETel API - *****************************************************/ - RDEBUG( "0", 0 ); + * Series 60 Customer / ETel + * Series 60 ETel API + *****************************************************/ + RDEBUG("0", 0); TBool StartUp = iStartup; RMobilePhone::TMobilePassword iSecUi_password; RMobilePhone::TMobilePassword required_fourth; - TInt queryAccepted = KErrCancel; + TInt queryAccepted = KErrCancel; + + TInt autolockState = 0; + TInt lCancelSupported = 0; + TInt lEmergencySupported = 0; - TInt autolockState=0; - TInt lCancelSupported=0; - TInt lEmergencySupported=0; - TInt lAlphaSupported=0; - - TInt err( KErrGeneral ); - err = RProperty::Get(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, autolockState); - RDEBUG( "StartUp", StartUp ); - RDEBUG( "err", err ); - if(!StartUp) - User::LeaveIfError( err ); -TBool isConditionSatisfied = EFalse; -TInt tarmFlag=0; -if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw )) - { - TInt tRet = RProperty::Get( KSCPSIDAutolock, SCP_TARM_ADMIN_FLAG_UID, tarmFlag ); - - if ( tRet != KErrNone ) + TInt err(KErrGeneral); + err = RProperty::Get(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, + autolockState); + RDEBUG("StartUp", StartUp); + RDEBUG("err", err); + if (!StartUp) + User::LeaveIfError(err); + TBool isConditionSatisfied = EFalse; + TInt tarmFlag = 0; + if (FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw )) { - #if defined(_DEBUG) - RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL():\ + TInt tRet = RProperty::Get(KSCPSIDAutolock, SCP_TARM_ADMIN_FLAG_UID, + tarmFlag); + + if (tRet != KErrNone) + { +#if defined(_DEBUG) + RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL():\ Warning: failed to get TARM Admin Flag state")); - #endif +#endif + } + else + { +#if defined(_DEBUG) + RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL(): TARM flag: %d"), tarmFlag ); +#endif + } + + if ((StartUp) || (tarmFlag & KSCPFlagResyncQuery)) + isConditionSatisfied = ETrue; } else { - #if defined(_DEBUG) - RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL(): TARM flag: %d"), tarmFlag ); - #endif - } - - if ( ( StartUp ) || ( tarmFlag & KSCPFlagResyncQuery ) ) - isConditionSatisfied = ETrue; - } - else - { - if (StartUp) - isConditionSatisfied = ETrue; - } - #if defined(_DEBUG) - RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL() Dialog 1")); - #endif - // Security code at bootup: No "cancel" softkey; Emergency calls enabled. - RMobilePhone::TMobilePhoneSecurityCode secCodeTypeToAsk = RMobilePhone::ESecurityCodePhonePassword; // for starters - RDEBUG( "isConditionSatisfied", isConditionSatisfied ); - if (isConditionSatisfied) - { - // starter or special TARM. NoCancel+Emergency - lCancelSupported = ESecUiCancelNotSupported; - lEmergencySupported = ESecUiEmergencySupported; - } - else if (autolockState > EAutolockOff) - { - // from unlock. Cancel+Emergency - lCancelSupported = ESecUiCancelSupported; - lEmergencySupported = ESecUiEmergencySupported; - } - else - { - // from settings. Cancel+NoEmergency - lCancelSupported = ESecUiCancelSupported; - lEmergencySupported = ESecUiEmergencyNotSupported; - } - lAlphaSupported = ESecUiAlphaSupported; - - /* request PIN using QT */ - CSecQueryUi *iSecQueryUi; - iSecQueryUi = CSecQueryUi::NewL(); - TInt lType = lAlphaSupported | lCancelSupported | lEmergencySupported | secCodeTypeToAsk; - RDEBUG( "lType", lType ); - queryAccepted = iSecQueryUi->SecQueryDialog( _L("PassPhraseRequiredL"), iSecUi_password, SEC_C_SECURITY_CODE_MIN_LENGTH,SEC_C_SECURITY_CODE_MAX_LENGTH, lType ); - RDEBUG( "iSecUi_password", 0 ); - RDebug::Print( iSecUi_password ); - RDEBUG( "queryAccepted", queryAccepted ); - delete iSecQueryUi; - /* end request PIN using QT */ + if (StartUp) + isConditionSatisfied = ETrue; + } +#if defined(_DEBUG) + RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL() Dialog 1")); +#endif + // Security code at bootup: No "cancel" softkey; Emergency calls enabled. + RMobilePhone::TMobilePhoneSecurityCode secCodeTypeToAsk = + RMobilePhone::ESecurityCodePhonePassword; // for starters + RDEBUG("isConditionSatisfied", isConditionSatisfied); + if (isConditionSatisfied) + { + // starter or special TARM. NoCancel+Emergency + lCancelSupported = ESecUiCancelNotSupported; + lEmergencySupported = ESecUiEmergencySupported; + } + else if (autolockState > EAutolockOff) + { + // from unlock. Cancel+Emergency + lCancelSupported = ESecUiCancelSupported; + lEmergencySupported = ESecUiEmergencySupported; + } + else + { + // from settings. Cancel+NoEmergency + lCancelSupported = ESecUiCancelSupported; + lEmergencySupported = ESecUiEmergencyNotSupported; + } + CSecQueryUi *iSecQueryUi; + iSecQueryUi = CSecQueryUi::NewL(); + TInt lType = ESecUiSecretSupported | ESecUiAlphaSupported + | lCancelSupported | lEmergencySupported | secCodeTypeToAsk; + RDEBUG("lType", lType); + iSecUi_password.Copy(_L("12345")); + queryAccepted = iSecQueryUi->SecQueryDialog(_L("PassPhraseRequiredL"), + iSecUi_password, SEC_C_SECURITY_CODE_MIN_LENGTH, + SEC_C_SECURITY_CODE_MAX_LENGTH, lType); + RDEBUG("iSecUi_password", 0); + RDebug::Print(iSecUi_password); + RDEBUG("queryAccepted", queryAccepted); + delete iSecQueryUi; -TBool wasCancelledOrEmergency = EFalse; - RDEBUG( "KFeatureIdSapDeviceLockEnhancements", KFeatureIdSapDeviceLockEnhancements ); -if ( (queryAccepted==KErrAbort /* =emergency */) || (queryAccepted == KErrCancel)) - wasCancelledOrEmergency = ETrue; - RDEBUG( "wasCancelledOrEmergency", wasCancelledOrEmergency ); - if (wasCancelledOrEmergency) + TBool wasCancelledOrEmergency = EFalse; + RDEBUG("KFeatureIdSapDeviceLockEnhancements", + KFeatureIdSapDeviceLockEnhancements); + if ((queryAccepted == KErrAbort /* =emergency */) || (queryAccepted + == KErrCancel)) + wasCancelledOrEmergency = ETrue; + RDEBUG("wasCancelledOrEmergency", wasCancelledOrEmergency); + if (wasCancelledOrEmergency) { - #if defined(_DEBUG) - RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL() DIALOG ERROR")); - #endif +#if defined(_DEBUG) + RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL() DIALOG ERROR")); +#endif if (!StartUp) { - RDEBUG( "AbortSecurityCode", 0 ); + RDEBUG("AbortSecurityCode", 0); iPhone.AbortSecurityCode(RMobilePhone::ESecurityCodePhonePassword); - RDEBUG( "AbortSecurityCode", 1 ); + RDEBUG("AbortSecurityCode", 1); } return KErrCancel; } - RMobilePhone::TMobilePhoneSecurityCode secCodeType = RMobilePhone::ESecurityCodePhonePassword; - CWait* wait = NULL; - TInt status = KErrNone;; - wait = CWait::NewL(); - RDEBUG( "VerifySecurityCode", 0 ); - #ifndef __WINS__ - iPhone.VerifySecurityCode(wait->iStatus,secCodeType, iSecUi_password, required_fourth); - RDEBUG( "WaitForRequestL", 0 ); - status = wait->WaitForRequestL(); - #else - status = KErrTimedOut; - RDEBUG( "WaitForRequestL not waint WINS", 0 ); - #endif - RDEBUG( "WaitForRequestL status", status ); - #ifdef __WINS__ - if (status == KErrTimedOut) - { - status = KErrNone; - } - #endif - delete wait; - + RMobilePhone::TMobilePhoneSecurityCode secCodeType = + RMobilePhone::ESecurityCodePhonePassword; + CWait* wait = NULL; + TInt status = KErrNone; + ; + wait = CWait::NewL(); + RDEBUG("VerifySecurityCode", 0); + iPhone.VerifySecurityCode(wait->iStatus, secCodeType, iSecUi_password, + required_fourth); + RDEBUG("WaitForRequestL", 0); + status = wait->WaitForRequestL(); + RDEBUG("WaitForRequestL status", status); + delete wait; +#ifdef __WINS__ + if(status==KErrNotSupported || status == KErrTimedOut) + { + RDEBUG( "status", status ); + status=KErrNone; + } +#endif + TInt returnValue = status; - RDEBUG( "tarmFlag", tarmFlag ); - RDEBUG( "StartUp", StartUp ); - switch(status) - { - case KErrNone: - #if defined(_DEBUG) - RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL() KErrNone")); - #endif - // code approved - CSecuritySettings::ShowResultNoteL(R_CONFIRMATION_NOTE, CAknNoteDialog::EConfirmationTone); - RDEBUG( "R_CONFIRMATION_NOTE", R_CONFIRMATION_NOTE ); - if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw)) + RDEBUG("tarmFlag", tarmFlag); + RDEBUG("StartUp", StartUp); + switch (status) { - RDEBUG( "KFeatureIdSapTerminalControlFw", KFeatureIdSapTerminalControlFw ); + case KErrNone: +#if defined(_DEBUG) + RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL() KErrNone")); +#endif + // code approved + CSecuritySettings::ShowResultNoteL(R_CONFIRMATION_NOTE, + CAknNoteDialog::EConfirmationTone); + RDEBUG("R_CONFIRMATION_NOTE", R_CONFIRMATION_NOTE); + if (FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw)) + { + RDEBUG("KFeatureIdSapTerminalControlFw", + KFeatureIdSapTerminalControlFw); // Unset the admin flag if set - if ( tarmFlag & KSCPFlagResyncQuery ) + if (tarmFlag & KSCPFlagResyncQuery) { - TInt tRet = RProperty::Get( KSCPSIDAutolock, SCP_TARM_ADMIN_FLAG_UID, tarmFlag ); - - if ( tRet == KErrNone ) - { - tarmFlag &= ~KSCPFlagResyncQuery; - tRet = RProperty::Set( KSCPSIDAutolock, SCP_TARM_ADMIN_FLAG_UID, tarmFlag ); - } - - if ( tRet != KErrNone ) + TInt tRet = RProperty::Get(KSCPSIDAutolock, + SCP_TARM_ADMIN_FLAG_UID, tarmFlag); + + if (tRet == KErrNone) { - #if defined(_DEBUG) + tarmFlag &= ~KSCPFlagResyncQuery; + tRet = RProperty::Set(KSCPSIDAutolock, + SCP_TARM_ADMIN_FLAG_UID, tarmFlag); + } + + if (tRet != KErrNone) + { +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL():\ FAILED to unset TARM Admin Flag")); - #endif - } +#endif + } } - if(!FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements)) - { - RDEBUG( "KFeatureIdSapDeviceLockEnhancements", KFeatureIdSapDeviceLockEnhancements ); - RSCPClient scpClient; - RDEBUG( "scpClient.Connect", 0 ); - User::LeaveIfError( scpClient.Connect() ); - RDEBUG( "scpClient.Connect", 1 ); - CleanupClosePushL( scpClient ); - TSCPSecCode newCode; - newCode.Copy( iSecUi_password ); - scpClient.StoreCode( newCode ); - RDEBUG( "scpClient.StoreCode", 1 ); - CleanupStack::PopAndDestroy(); //scpClient + if (!FeatureManager::FeatureSupported( + KFeatureIdSapDeviceLockEnhancements)) + { + RDEBUG("KFeatureIdSapDeviceLockEnhancements", + KFeatureIdSapDeviceLockEnhancements); + RSCPClient scpClient; + RDEBUG("scpClient.Connect", 0); + User::LeaveIfError(scpClient.Connect()); + RDEBUG("scpClient.Connect", 1); + CleanupClosePushL(scpClient); + TSCPSecCode newCode; + newCode.Copy(iSecUi_password); + scpClient.StoreCode(newCode); + RDEBUG("scpClient.StoreCode", 1); + CleanupStack::PopAndDestroy(); //scpClient + } + } - - } - RDEBUG( "StartUp", StartUp ); + RDEBUG("StartUp", StartUp); if (StartUp) { - #if defined(_DEBUG) +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL()KErrNone: Startup; get autolock period.")); - #endif +#endif // get autolock period from Central Repository. - CRepository* repository = CRepository::NewL(KCRUidSecuritySettings); + CRepository* repository = CRepository::NewL( + KCRUidSecuritySettings); TInt period = 0; TInt res = repository->Get(KSettingsAutoLockTime, period); delete repository; - - _LIT_SECURITY_POLICY_PASS(KReadPolicy); - _LIT_SECURITY_POLICY_C1(KWritePolicy, ECapabilityWriteDeviceData); - RProperty::Define(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, RProperty::EInt, KReadPolicy, KWritePolicy); - RProperty::Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, EAutolockOff); - #if defined(_DEBUG) - RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL() EAutolockOff")); - #endif + + _LIT_SECURITY_POLICY_PASS( KReadPolicy); + _LIT_SECURITY_POLICY_C1(KWritePolicy, + ECapabilityWriteDeviceData); + RProperty::Define(KPSUidCoreApplicationUIs, + KCoreAppUIsAutolockStatus, RProperty::EInt, + KReadPolicy, KWritePolicy); + RProperty::Set(KPSUidCoreApplicationUIs, + KCoreAppUIsAutolockStatus, EAutolockOff); +#if defined(_DEBUG) + RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL() EAutolockOff")); +#endif if (res == KErrNone) { // disable autolock in Domestic OS side too if autolock period is 0. - if (period == 0 ) + if (period == 0) { #ifdef RD_REMOTELOCK // If remote lock is enabled, don't disable the domestic OS device lock @@ -823,44 +848,43 @@ if ( !remoteLockStatus ) { // Remote lock is disabled - #ifdef _DEBUG +#ifdef _DEBUG RDebug::Print( _L( "(SecUi)CSecurityHandler::PassPhraseRequiredL() - Autolock and RemoteLock are disabled -> disable DOS device lock" ) ); - #endif // _DEBUG - +#endif // _DEBUG // Disable DOS device lock setting - RDEBUG( "iCustomPhone.DisablePhoneLock", 0 ); + RDEBUG( "iCustomPhone.DisablePhoneLock", 0 ); wait = CWait::NewL(); iCustomPhone.DisablePhoneLock(wait->iStatus,iSecUi_password); wait->WaitForRequestL(); - RDEBUG( "iCustomPhone.DisablePhoneLock", 1 ); + RDEBUG( "iCustomPhone.DisablePhoneLock", 1 ); delete wait; } } else { // Failed to get remote lock status - #ifdef _DEBUG +#ifdef _DEBUG RDebug::Print( _L( "(SecUi)CSecurityHandler::PassPhraseRequiredL() - Autolock is disabled, but failed to get RemoteLock status, so do nothing." ) ); - #endif // _DEBUG +#endif // _DEBUG } delete remoteLockSettings; remoteLockSettings = NULL; #else // not defined RD_REMOTELOCK - - RDEBUG( "iCustomPhone.DisablePhoneLock", 0 ); + RDEBUG("iCustomPhone.DisablePhoneLock", 0); wait = CWait::NewL(); - iCustomPhone.DisablePhoneLock(wait->iStatus,iSecUi_password); + iCustomPhone.DisablePhoneLock(wait->iStatus, + iSecUi_password); wait->WaitForRequestL(); - RDEBUG( "iCustomPhone.DisablePhoneLock", 1 ); + RDEBUG("iCustomPhone.DisablePhoneLock", 1); delete wait; #endif // RD_REMOTELOCK } } - else // error getting repository + else // error getting repository { - RDEBUG( "error getting repository", 0 ); + RDEBUG("error getting repository", 0); #ifdef RD_REMOTELOCK // If remote lock is enabled, don't disable the domestic OS device lock // since that would render the RemoteLock useless. @@ -873,66 +897,68 @@ if ( !remoteLockStatus ) { // Remote lock is disabled - RDEBUG( "iCustomPhone.DisablePhoneLock", 0 ); + RDEBUG( "iCustomPhone.DisablePhoneLock", 0 ); wait = CWait::NewL(); iCustomPhone.DisablePhoneLock(wait->iStatus,iSecUi_password); wait->WaitForRequestL(); - RDEBUG( "iCustomPhone.DisablePhoneLock", 1 ); + RDEBUG( "iCustomPhone.DisablePhoneLock", 1 ); delete wait; } } else { // Failed to get remote lock status - #ifdef _DEBUG +#ifdef _DEBUG RDebug::Print( _L( "(SecUi)CSecurityHandler::PassPhraseRequiredL() - Failed to get Autolock period and RemoteLock status, so do nothing." ) ); - #endif // _DEBUG +#endif // _DEBUG } delete remoteLockSettings; remoteLockSettings = NULL; #else // not defined RD_REMOTELOCK - // could not get the current autolock time... disable autolock in Domestic OS side. - RDEBUG( "iCustomPhone.DisablePhoneLock", 0 ); + RDEBUG("iCustomPhone.DisablePhoneLock", 0); wait = CWait::NewL(); - iCustomPhone.DisablePhoneLock(wait->iStatus,iSecUi_password); + iCustomPhone.DisablePhoneLock(wait->iStatus, + iSecUi_password); wait->WaitForRequestL(); - RDEBUG( "iCustomPhone.DisablePhoneLock", 1 ); + RDEBUG("iCustomPhone.DisablePhoneLock", 1); delete wait; #endif // RD_REMOTELOCK } - + } // no Startup - break; + break; case KErrGsmSSPasswordAttemptsViolation: case KErrLocked: // security code blocked! - #if defined(_DEBUG) +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL() ErrGsmSSPasswordAttemptsViolation")); - #endif - CSecuritySettings::ShowResultNoteL(R_SEC_BLOCKED, CAknNoteDialog::EErrorTone); +#endif + CSecuritySettings::ShowResultNoteL(R_SEC_BLOCKED, + CAknNoteDialog::EErrorTone); break; case KErrGsm0707IncorrectPassword: case KErrAccessDenied: - RDEBUG( "KErrAccessDenied", KErrAccessDenied ); - // TODO should this try again? It seems that it's not asked again. - #if defined(_DEBUG) + RDEBUG("KErrAccessDenied", KErrAccessDenied); + // TODO should this try again? It seems that it's not asked again. +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecurityHandler::PassPhraseRequiredL() KErrGsm0707IncorrectPassword")); - #endif - CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone); +#endif + CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, + CAknNoteDialog::EErrorTone); break; default: - RDEBUG( "default", status ); + RDEBUG("default", status); CSecuritySettings::ShowErrorNoteL(status); - // TODO should this try again? It seems that it's not asked again. + // TODO should this try again? It seems that it's not asked again. break; } - RDEBUG( "returnValue", returnValue ); - return returnValue; + RDEBUG("returnValue", returnValue); + return returnValue; } // // ---------------------------------------------------------- @@ -943,166 +969,182 @@ TInt CSecurityHandler::Pin1RequiredL() { /***************************************************** - * Series 60 Customer / ETel - * Series 60 ETel API - *****************************************************/ - RDEBUG( "0", 0 ); + * Series 60 Customer / ETel + * Series 60 ETel API + *****************************************************/ + RDEBUG("0", 0); - RMobilePhone::TMobilePassword iSecUi_password; - TInt lCancelSupported = ESecUiCancelNotSupported; + RMobilePhone::TMobilePassword iSecUi_password; + TInt lCancelSupported = ESecUiCancelNotSupported; TInt queryAccepted = KErrCancel; - TInt lAlphaSupported=0; + TInt lAlphaSupported = 0; RMobilePhone::TMobilePassword required_fourth; - RMobilePhone::TMobilePhoneSecurityCode secCodeType = RMobilePhone::ESecurityCodePin1; + RMobilePhone::TMobilePhoneSecurityCode secCodeType = + RMobilePhone::ESecurityCodePin1; RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo; RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo); - TBool StartUp = ETrue; + TBool StartUp = ETrue; TInt secUiOriginatedQuery(ESecurityUIsSecUIOriginatedUninitialized); TInt err = KErrNone; TInt res = KErrGeneral; CWait* wait = CWait::NewL(); CleanupStack::PushL(wait); - RDEBUG( "0", 0 ); + RDEBUG("0", 0); StartUp = iStartup; - RDEBUG( "StartUp", StartUp ); - if(!StartUp) - { + RDEBUG("StartUp", StartUp); + if (!StartUp) + { // read a flag to see whether the query is SecUi originated. For example, from CSecuritySettings::ChangePinRequestParamsL - err = RProperty::Get(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, secUiOriginatedQuery); - - if ( err != KErrNone ) + err = RProperty::Get(KPSUidSecurityUIs, + KSecurityUIsSecUIOriginatedQuery, secUiOriginatedQuery); + + if (err != KErrNone) + { +#if defined(_DEBUG) + RDebug::Print(_L("(SECUI)CSecurityHandler::Pin1RequiredL():\ + FAILED to get the SECUI query Flag: %d"), err); +#endif + } + else + { +#if defined(_DEBUG) + RDebug::Print(_L("(SECUI)CSecurityHandler::Pin1RequiredL():\ + SECUI query Flag: %d"), secUiOriginatedQuery); +#endif + } + } +#if defined(_DEBUG) + RDebug::Print(_L("CSecurityHandler::Pin1RequiredL() Execute dlg")); +#endif + + RDEBUG("StartUp", StartUp); + RDEBUG("secUiOriginatedQuery", secUiOriginatedQuery); + RDEBUG("ESecurityUIsSecUIOriginated", ESecurityUIsSecUIOriginated); + RDEBUG("err", err); + if (StartUp || (secUiOriginatedQuery != ESecurityUIsSecUIOriginated) + || (err != KErrNone)) { - #if defined(_DEBUG) - RDebug::Print(_L("(SECUI)CSecurityHandler::Pin1RequiredL():\ - FAILED to get the SECUI query Flag: %d"), err); - #endif + RDEBUG("0", 0); + lCancelSupported = ESecUiCancelNotSupported; } else - { - #if defined(_DEBUG) - RDebug::Print(_L("(SECUI)CSecurityHandler::Pin1RequiredL():\ - SECUI query Flag: %d"), secUiOriginatedQuery); - #endif - } - } - #if defined(_DEBUG) - RDebug::Print(_L("CSecurityHandler::Pin1RequiredL() Execute dlg")); - #endif + { + lCancelSupported = ESecUiCancelSupported; + // it will be RMobilePhone::ESecurityCodePin1 , equivalent to ESecUiNone + } + wait->SetRequestType(EMobilePhoneGetSecurityCodeInfo); + RDEBUG("GetSecurityCodeInfo", 0); + iPhone.GetSecurityCodeInfo(wait->iStatus, secCodeType, codeInfoPkg); + res = wait->WaitForRequestL(); - RDEBUG( "StartUp", StartUp ); - RDEBUG( "secUiOriginatedQuery", secUiOriginatedQuery ); - RDEBUG( "ESecurityUIsSecUIOriginated", ESecurityUIsSecUIOriginated ); - RDEBUG( "err", err ); - if(StartUp || (secUiOriginatedQuery != ESecurityUIsSecUIOriginated) || (err != KErrNone)) - { - RDEBUG( "0", 0 ); - lCancelSupported = ESecUiCancelNotSupported; - } - else - { - lCancelSupported = ESecUiCancelSupported; - // it will be RMobilePhone::ESecurityCodePin1 , equivalent to ESecUiNone - } - wait->SetRequestType(EMobilePhoneGetSecurityCodeInfo); - RDEBUG( "GetSecurityCodeInfo", 0 ); - iPhone.GetSecurityCodeInfo(wait->iStatus, secCodeType, codeInfoPkg); - res = wait->WaitForRequestL(); + RDEBUG("res", res); +#ifdef __WINS__ + RDEBUG( "emulator can't read PIN attempts", res ); + res=KErrNone; + codeInfo.iRemainingEntryAttempts=3; +#endif - TInt attempts(codeInfo.iRemainingEntryAttempts); - RDEBUG( "attempts", attempts ); + User::LeaveIfError(res); - RDEBUG( "res", res ); - #ifdef __WINS__ - RDEBUG( "emulator can't read PIN attempts", res ); - res=KErrNone; - codeInfo.iRemainingEntryAttempts=3; - #endif + RDEBUG("codeInfo.iRemainingEntryAttempts", + codeInfo.iRemainingEntryAttempts); + if (codeInfo.iRemainingEntryAttempts == KMaxNumberOfPINAttempts) + codeInfo.iRemainingEntryAttempts = -1; - User::LeaveIfError(res); - /* request PIN using QT */ - CSecQueryUi *iSecQueryUi; - RDEBUG( "CSecQueryUi", 0 ); - iSecQueryUi = CSecQueryUi::NewL(); - RDEBUG( "SecQueryDialog", 1 ); - // TODO ESecUiCodeEtelReqest/ESecUiNone might be useful - // TODO also support Emergency - lAlphaSupported = ESecUiAlphaNotSupported; - TBuf<0x100> title; title.Zero(); title.Append(_L("Pin1RequiredL")); title.Append(_L("#")); title.AppendNum(codeInfo.iRemainingEntryAttempts); - TInt amode = lAlphaSupported | lCancelSupported | ESecUiEmergencySupported | secCodeType; - RDEBUG( "amode", amode ); - queryAccepted = iSecQueryUi->SecQueryDialog( title, iSecUi_password, SEC_C_PIN_CODE_MIN_LENGTH, SEC_C_PIN_CODE_MAX_LENGTH, amode ); - RDEBUG( "iSecUi_password", 0 ); - RDebug::Print( iSecUi_password ); - delete iSecQueryUi; - RDEBUG( "queryAccepted", queryAccepted ); - // TODO handle emergency - /* end request PIN using QT */ + /* request PIN using QT */ + CSecQueryUi *iSecQueryUi; + RDEBUG("CSecQueryUi", 0); + iSecQueryUi = CSecQueryUi::NewL(); + RDEBUG("SecQueryDialog", 1); + // TODO ESecUiCodeEtelReqest/ESecUiNone might be useful + // TODO also support Emergency + lAlphaSupported = ESecUiAlphaNotSupported; + TBuf<0x100> title; + title.Zero(); + title.Append(_L("Pin1RequiredL")); + title.Append(_L("#")); + title.AppendNum(codeInfo.iRemainingEntryAttempts); + TInt amode = ESecUiSecretSupported | lAlphaSupported | lCancelSupported + | ESecUiEmergencySupported | secCodeType; + RDEBUG("amode", amode); + queryAccepted = iSecQueryUi->SecQueryDialog(title, iSecUi_password, + SEC_C_PIN_CODE_MIN_LENGTH, SEC_C_PIN_CODE_MAX_LENGTH, amode); + RDEBUG("iSecUi_password", 0); + RDebug::Print(iSecUi_password); + delete iSecQueryUi; + RDEBUG("queryAccepted", queryAccepted); + // TODO handle emergency + /* end request PIN using QT */ - if ( queryAccepted == KErrAbort ) // emergency call - { - #if defined(_DEBUG) - RDebug::Print(_L("CSecurityHandler::Pin1RequiredL() R_PIN_REQUEST_QUERY CANCEL!")); - #endif - CleanupStack::PopAndDestroy(wait); // this is needed - return KErrCancel; - } - if( lCancelSupported && (queryAccepted == KErrCancel) ) - { - // cancel code request - RDEBUG( "AbortSecurityCode", 0 ); - iPhone.AbortSecurityCode(RMobilePhone::ESecurityCodePin1); - RDEBUG( "AbortSecurityCode", 1 ); - CleanupStack::PopAndDestroy(wait); // this is needed - return KErrCancel; - } + if (queryAccepted == KErrAbort) // emergency call + { +#if defined(_DEBUG) + RDebug::Print(_L("CSecurityHandler::Pin1RequiredL() R_PIN_REQUEST_QUERY CANCEL!")); +#endif + CleanupStack::PopAndDestroy(wait); // this is needed + return KErrCancel; + } + if (lCancelSupported && (queryAccepted == KErrCancel)) + { + // cancel code request + RDEBUG("AbortSecurityCode", 0); + iPhone.AbortSecurityCode(RMobilePhone::ESecurityCodePin1); + RDEBUG("AbortSecurityCode", 1); + CleanupStack::PopAndDestroy(wait); // this is needed + return KErrCancel; + } - RDEBUG( "iSecUi_password", iSecUi_password ); - RDebug::Print( iSecUi_password ); - RDEBUG( "VerifySecurityCode", 0 ); - iPhone.VerifySecurityCode(wait->iStatus,secCodeType, iSecUi_password, required_fourth); - RDEBUG( "WaitForRequestL", 0 ); + RDEBUG("iSecUi_password", 0); + RDebug::Print(iSecUi_password); + RDEBUG("VerifySecurityCode", 0); + iPhone.VerifySecurityCode(wait->iStatus, secCodeType, iSecUi_password, + required_fourth); + RDEBUG("WaitForRequestL", 0); res = wait->WaitForRequestL(); - RDEBUG( "WaitForRequestL res", res ); - CleanupStack::PopAndDestroy(wait); + RDEBUG("WaitForRequestL res", res); + CleanupStack::PopAndDestroy(wait); TInt returnValue = res; - switch(res) - { + switch (res) + { case KErrNone: // code approved - #if defined(_DEBUG) +#if defined(_DEBUG) RDebug::Print(_L("CSecurityHandler::Pin1RequiredL()code approved ")); - #endif - CSecuritySettings::ShowResultNoteL(R_CONFIRMATION_NOTE, CAknNoteDialog::EConfirmationTone); +#endif + CSecuritySettings::ShowResultNoteL(R_CONFIRMATION_NOTE, + CAknNoteDialog::EConfirmationTone); break; case KErrGsm0707IncorrectPassword: case KErrAccessDenied: // code was entered erroneously - CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone); - if(StartUp) - { - returnValue = Pin1RequiredL(); - } + CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, + CAknNoteDialog::EErrorTone); + if (StartUp) + { + returnValue = Pin1RequiredL(); + } break; case KErrGsmSSPasswordAttemptsViolation: case KErrLocked: // code blocked; show error note and terminate. // TODO what if not during Startup? Probably it's Ok since the SIM would had also failed at StartUp - if(StartUp) - CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone); + if (StartUp) + CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, + CAknNoteDialog::EErrorTone); break; case KErrGsm0707SimWrong: // sim lock active // TODO no error? This is strange break; default: - CSecuritySettings::ShowErrorNoteL(res); - if(StartUp) - { - returnValue = Pin1RequiredL(); - } + CSecuritySettings::ShowErrorNoteL(res); + if (StartUp) + { + returnValue = Pin1RequiredL(); + } break; } return returnValue; @@ -1116,13 +1158,13 @@ TInt CSecurityHandler::Puk1RequiredL() { /***************************************************** - * Series 60 Customer / ETel - * Series 60 ETel API - *****************************************************/ - #if defined(_DEBUG) + * Series 60 Customer / ETel + * Series 60 ETel API + *****************************************************/ +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecurityHandler::Puk1RequiredL()")); - #endif - TInt queryAccepted = KErrCancel; +#endif + TInt queryAccepted = KErrCancel; RMobilePhone::TMobilePassword iSecUi_password; RMobilePhone::TMobilePassword aNewPassword; RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo; @@ -1131,104 +1173,126 @@ blockCodeType = RMobilePhone::ESecurityCodePuk1; CWait* wait = CWait::NewL(); CleanupStack::PushL(wait); - + TBool StartUp(ETrue); StartUp = iStartup; TInt res(KErrNone); wait->SetRequestType(EMobilePhoneGetSecurityCodeInfo); - + TInt thisTry = 0; - // If there was a problem (as there might be in case we're dropping off SIM Access Profile); try again a couple of times. - while ( res != KErrNone && ( thisTry++ ) <= KTriesToConnectServer ) + // If there was a problem (as there might be in case we're dropping off SIM Access Profile); try again a couple of times. + while (res != KErrNone && (thisTry++) <= KTriesToConnectServer) { - if(thisTry>0) - User::After( KTimeBeforeRetryingRequest ); - RDEBUG( "GetSecurityCodeInfo", 0 ); + if (thisTry > 0) + User::After( KTimeBeforeRetryingRequest); + RDEBUG("GetSecurityCodeInfo", 0); iPhone.GetSecurityCodeInfo(wait->iStatus, blockCodeType, codeInfoPkg); - RDEBUG( "WaitForRequestL", 0 ); - res = wait->WaitForRequestL(); - RDEBUG( "WaitForRequestL res", res ); + RDEBUG("WaitForRequestL", 0); + res = wait->WaitForRequestL(); + RDEBUG("WaitForRequestL res", res); } - #if defined(_DEBUG) +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecurityHandler::Puk1RequiredL(): Get Code info result: %d"), res); - #endif +#endif //If there's still an error we're doomed. Bail out. User::LeaveIfError(res); - - #if defined(_DEBUG) + +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecurityHandler::Puk1RequiredL(): Show last note")); - #endif +#endif - RDEBUG( "StartUp", StartUp ); - RDEBUG( "codeInfo.iRemainingEntryAttempts", codeInfo.iRemainingEntryAttempts ); + RDEBUG("StartUp", StartUp); + RDEBUG("codeInfo.iRemainingEntryAttempts", + codeInfo.iRemainingEntryAttempts); //show the last "Code Error" note of PIN verify result here so it won't be left under the PUK1 dialog - if(!StartUp && (codeInfo.iRemainingEntryAttempts == KMaxNumberOfPUKAttempts)) - CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone); - + if (!StartUp && (codeInfo.iRemainingEntryAttempts + == KMaxNumberOfPUKAttempts)) + CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, + CAknNoteDialog::EErrorTone); + + RDEBUG("codeInfo.iRemainingEntryAttempts", + codeInfo.iRemainingEntryAttempts); + if (codeInfo.iRemainingEntryAttempts == KMaxNumberOfPINAttempts) + codeInfo.iRemainingEntryAttempts = -1; + // ask PUK code - /* request PIN using QT */ - CSecQueryUi *iSecQueryUi; - RDEBUG( "CSecQueryUi", 0 ); - iSecQueryUi = CSecQueryUi::NewL(); - RDEBUG( "SecQueryDialog", 1 ); - // TODO ESecUiCodeEtelReqest/ESecUiNone might be useful - // TODO also support Emergency - TBuf<0x100> title; title.Zero(); title.Append(_L("Puk1RequiredL")); title.Append(_L("#")); title.AppendNum(codeInfo.iRemainingEntryAttempts); - queryAccepted = iSecQueryUi->SecQueryDialog( title, iSecUi_password, SEC_C_PUK_CODE_MIN_LENGTH,SEC_C_PUK_CODE_MAX_LENGTH, ESecUiAlphaNotSupported | ESecUiCancelSupported | ESecUiPukRequired ); - RDEBUG( "iSecUi_password", 0 ); - RDebug::Print( iSecUi_password ); - delete iSecQueryUi; - RDEBUG( "queryAccepted", queryAccepted ); - - if( (queryAccepted == KErrAbort) || (queryAccepted==KErrCancel) ) + /* request PIN using QT */ + CSecQueryUi *iSecQueryUi; + RDEBUG("CSecQueryUi", 0); + iSecQueryUi = CSecQueryUi::NewL(); + RDEBUG("SecQueryDialog", 1); + // TODO ESecUiCodeEtelReqest/ESecUiNone might be useful + // TODO also support Emergency + TBuf<0x100> title; + title.Zero(); + title.Append(_L("Puk1RequiredL")); + title.Append(_L("#")); + title.AppendNum(codeInfo.iRemainingEntryAttempts); + queryAccepted = iSecQueryUi->SecQueryDialog(title, iSecUi_password, + SEC_C_PUK_CODE_MIN_LENGTH, SEC_C_PUK_CODE_MAX_LENGTH, + ESecUiSecretNotSupported | ESecUiAlphaNotSupported + | ESecUiCancelSupported | ESecUiPukRequired); + RDEBUG("iSecUi_password", 0); + RDebug::Print(iSecUi_password); + delete iSecQueryUi; + RDEBUG("queryAccepted", queryAccepted); + + if ((queryAccepted == KErrAbort) || (queryAccepted == KErrCancel)) { - CleanupStack::PopAndDestroy(wait); // TODO this is needed ??? + CleanupStack::PopAndDestroy(wait); // TODO this is needed ??? return KErrCancel; } - { - // new pin code query - CSecQueryUi *iSecQueryUi; - RDEBUG( "CSecQueryUi", 0 ); - iSecQueryUi = CSecQueryUi::NewL(); - RDEBUG( "SecQueryDialog", 1 ); - // TODO ESecUiCodeEtelReqest/ESecUiNone might be useful - // TODO also support Emergency + { + // new pin code query + CSecQueryUi * iSecQueryUi; + RDEBUG("CSecQueryUi", 0); + iSecQueryUi = CSecQueryUi::NewL(); + RDEBUG("SecQueryDialog", 1); + // TODO ESecUiCodeEtelReqest/ESecUiNone might be useful + // TODO also support Emergency - queryAccepted = iSecQueryUi->SecQueryDialog( _L("Puk1-New|Puk1-Verif"), aNewPassword, SEC_C_PUK_CODE_MIN_LENGTH,SEC_C_PUK_CODE_MAX_LENGTH, ESecUiAlphaNotSupported | ESecUiCancelSupported | ESecUiPukRequired ); - RDEBUG( "aNewPassword", 0 ); - RDebug::Print( aNewPassword ); - delete iSecQueryUi; - RDEBUG( "queryAccepted", queryAccepted ); - } + queryAccepted = iSecQueryUi->SecQueryDialog( + _L("Puk1-New|Puk1-Verif"), aNewPassword, + SEC_C_PUK_CODE_MIN_LENGTH, SEC_C_PUK_CODE_MAX_LENGTH, + ESecUiAlphaNotSupported | ESecUiCancelSupported + | ESecUiPukRequired); + RDEBUG("aNewPassword", 0); + RDebug::Print(aNewPassword); + delete iSecQueryUi; + RDEBUG("queryAccepted", queryAccepted); + } - if( (queryAccepted == KErrAbort) || (queryAccepted==KErrCancel) ) + if ((queryAccepted == KErrAbort) || (queryAccepted == KErrCancel)) { - CleanupStack::PopAndDestroy(wait); + CleanupStack::PopAndDestroy(wait); return KErrCancel; } - + // send code - RDEBUG( "VerifySecurityCode", 0 ); - iPhone.VerifySecurityCode(wait->iStatus,blockCodeType,aNewPassword,iSecUi_password); - RDEBUG( "WaitForRequestL", 0 ); + RDEBUG("VerifySecurityCode", 0); + iPhone.VerifySecurityCode(wait->iStatus, blockCodeType, aNewPassword, + iSecUi_password); + RDEBUG("WaitForRequestL", 0); res = wait->WaitForRequestL(); - RDEBUG( "WaitForRequestL res", res ); + RDEBUG("WaitForRequestL res", res); CleanupStack::PopAndDestroy(wait); - + TInt returnValue = res; - switch(res) + switch (res) { case KErrNone: // code approved -> note - CSecuritySettings::ShowResultNoteL(R_PIN_CODE_CHANGED_NOTE, CAknNoteDialog::EConfirmationTone); + CSecuritySettings::ShowResultNoteL(R_PIN_CODE_CHANGED_NOTE, + CAknNoteDialog::EConfirmationTone); break; - case KErrGsm0707IncorrectPassword: + case KErrGsm0707IncorrectPassword: case KErrAccessDenied: // wrong PUK code -> note -> ask PUK code again - CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone); + CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, + CAknNoteDialog::EErrorTone); returnValue = Puk1RequiredL(); break; case KErrGsm0707SimWrong: @@ -1240,12 +1304,12 @@ // sim card rejected. break; default: - CSecuritySettings::ShowErrorNoteL(res); + CSecuritySettings::ShowErrorNoteL(res); returnValue = Puk1RequiredL(); break; - } + } - return returnValue; + return returnValue; } // // ---------------------------------------------------------- @@ -1256,87 +1320,100 @@ void CSecurityHandler::Pin2RequiredL() { /***************************************************** - * Series 60 Customer / ETel - * Series 60 ETel API - *****************************************************/ + * Series 60 Customer / ETel + * Series 60 ETel API + *****************************************************/ - #if defined(_DEBUG) +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecurityHandler::Pin2RequiredL() BEGIN")); - #endif - TInt queryAccepted = KErrCancel; +#endif + TInt queryAccepted = KErrCancel; RMobilePhone::TMobilePassword iSecUi_password; RMobilePhone::TMobilePassword required_fourth; - RMobilePhone::TMobilePhoneSecurityCode secCodeType(RMobilePhone::ESecurityCodePin2); + RMobilePhone::TMobilePhoneSecurityCode secCodeType( + RMobilePhone::ESecurityCodePin2); RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo; RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo); CWait* wait = CWait::NewL(); CleanupStack::PushL(wait); - - wait->SetRequestType(EMobilePhoneGetSecurityCodeInfo); - RDEBUG( "GetSecurityCodeInfo", 0 ); + + wait->SetRequestType(EMobilePhoneGetSecurityCodeInfo); + RDEBUG("GetSecurityCodeInfo", 0); iPhone.GetSecurityCodeInfo(wait->iStatus, secCodeType, codeInfoPkg); - RDEBUG( "WaitForRequestL", 0 ); + RDEBUG("WaitForRequestL", 0); TInt ret = wait->WaitForRequestL(); - RDEBUG( "WaitForRequestL ret", ret ); + RDEBUG("WaitForRequestL ret", ret); User::LeaveIfError(ret); - TInt attempts(codeInfo.iRemainingEntryAttempts); - RDEBUG( "attempts", attempts ); + RDEBUG("codeInfo.iRemainingEntryAttempts", + codeInfo.iRemainingEntryAttempts); + if (codeInfo.iRemainingEntryAttempts == KMaxNumberOfPINAttempts) // TODO this might be 10 ? + codeInfo.iRemainingEntryAttempts = -1; - /* request PIN using QT */ - CSecQueryUi *iSecQueryUi; - RDEBUG( "CSecQueryUi", 0 ); - iSecQueryUi = CSecQueryUi::NewL(); - RDEBUG( "SecQueryDialog", 1 ); - // TODO ESecUiCodeEtelReqest/ESecUiNone might be useful against KLastRemainingInputAttempt - // TODO also support Emergency + /* request PIN using QT */ + CSecQueryUi *iSecQueryUi; + RDEBUG("CSecQueryUi", 0); + iSecQueryUi = CSecQueryUi::NewL(); + RDEBUG("SecQueryDialog", 1); + // TODO ESecUiCodeEtelReqest/ESecUiNone might be useful against KLastRemainingInputAttempt + // TODO also support Emergency - TBuf<0x100> title; title.Zero(); title.Append(_L("Pin2RequiredL")); title.Append(_L("#")); title.AppendNum(codeInfo.iRemainingEntryAttempts); - queryAccepted = iSecQueryUi->SecQueryDialog( title, iSecUi_password, SEC_C_PIN2_CODE_MIN_LENGTH, SEC_C_PIN2_CODE_MAX_LENGTH, ESecUiAlphaNotSupported | ESecUiCancelSupported | secCodeType ); - RDEBUG( "iSecUi_password", 0 ); - RDebug::Print( iSecUi_password ); - RDEBUG( "queryAccepted", queryAccepted ); - delete iSecQueryUi; + TBuf<0x100> title; + title.Zero(); + title.Append(_L("Pin2RequiredL")); + title.Append(_L("#")); + title.AppendNum(codeInfo.iRemainingEntryAttempts); + queryAccepted = iSecQueryUi->SecQueryDialog(title, iSecUi_password, + SEC_C_PIN2_CODE_MIN_LENGTH, SEC_C_PIN2_CODE_MAX_LENGTH, + ESecUiSecretNotSupported | ESecUiAlphaNotSupported + | ESecUiCancelSupported | secCodeType); + RDEBUG("iSecUi_password", 0); + RDebug::Print(iSecUi_password); + RDEBUG("queryAccepted", queryAccepted); + delete iSecQueryUi; - // If failed or device became locked, any pending request should be cancelled. - if ( queryAccepted!=KErrNone ) + // If failed or device became locked, any pending request should be cancelled. + if (queryAccepted != KErrNone) { - RDEBUG( "AbortSecurityCode", 0 ); + RDEBUG("AbortSecurityCode", 0); iPhone.AbortSecurityCode(secCodeType); - RDEBUG( "AbortSecurityCode", 1 ); + RDEBUG("AbortSecurityCode", 1); CleanupStack::PopAndDestroy(wait); return; } - RDEBUG( "VerifySecurityCode", 0 ); - iPhone.VerifySecurityCode(wait->iStatus,secCodeType,iSecUi_password,required_fourth); - RDEBUG( "WaitForRequestL", 0 ); + RDEBUG("VerifySecurityCode", 0); + iPhone.VerifySecurityCode(wait->iStatus, secCodeType, iSecUi_password, + required_fourth); + RDEBUG("WaitForRequestL", 0); TInt status = wait->WaitForRequestL(); - RDEBUG( "WaitForRequestL status", status ); + RDEBUG("WaitForRequestL status", status); CleanupStack::PopAndDestroy(wait); - switch(status) - { + switch (status) + { case KErrNone: break; case KErrGsm0707IncorrectPassword: case KErrAccessDenied: // code was entered erroneously - CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone); + CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, + CAknNoteDialog::EErrorTone); break; case KErrGsmSSPasswordAttemptsViolation: case KErrLocked: // blocked - CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone); + CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, + CAknNoteDialog::EErrorTone); break; default: - CSecuritySettings::ShowErrorNoteL(status); + CSecuritySettings::ShowErrorNoteL(status); break; } - #if defined(_DEBUG) +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecurityHandler::Pin2RequiredL(): END")); - #endif +#endif } // // ---------------------------------------------------------- @@ -1345,115 +1422,136 @@ // ---------------------------------------------------------- // qtdone void CSecurityHandler::Puk2RequiredL() - { + { /***************************************************** - * Series 60 Customer / ETel - * Series 60 ETel API - *****************************************************/ - TInt queryAccepted = KErrCancel; + * Series 60 Customer / ETel + * Series 60 ETel API + *****************************************************/ + TInt queryAccepted = KErrCancel; RMobilePhone::TMobilePassword iSecUi_password; RMobilePhone::TMobilePassword aNewPassword; RMobilePhone::TMobilePassword verifcationPassword; RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo; RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo); - - RMobilePhone::TMobilePhoneSecurityCode secCodeType = RMobilePhone::ESecurityCodePuk2; + + RMobilePhone::TMobilePhoneSecurityCode secCodeType = + RMobilePhone::ESecurityCodePuk2; CWait* wait = CWait::NewL(); CleanupStack::PushL(wait); - - #if defined(_DEBUG) + +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecurityHandler::Puk2RequiredL()")); - #endif +#endif // ask PUK2 - - TInt ret(KErrNone); + + TInt ret(KErrNone); wait->SetRequestType(EMobilePhoneGetSecurityCodeInfo); - RDEBUG( "GetSecurityCodeInfo", 0 ); + RDEBUG("GetSecurityCodeInfo", 0); iPhone.GetSecurityCodeInfo(wait->iStatus, secCodeType, codeInfoPkg); - RDEBUG( "WaitForRequestL", 0 ); + RDEBUG("WaitForRequestL", 0); ret = wait->WaitForRequestL(); - RDEBUG( "WaitForRequestL ret", ret ); + RDEBUG("WaitForRequestL ret", ret); User::LeaveIfError(ret); - - /* request PIN using QT */ - CSecQueryUi *iSecQueryUi; - RDEBUG( "CSecQueryUi", 0 ); - iSecQueryUi = CSecQueryUi::NewL(); - RDEBUG( "SecQueryDialog", 1 ); - // TODO ESecUiCodeEtelReqest/ESecUiNone might be useful - // TODO also support Emergency + + /* request PIN using QT */ + CSecQueryUi *iSecQueryUi; + RDEBUG("CSecQueryUi", 0); + iSecQueryUi = CSecQueryUi::NewL(); + RDEBUG("SecQueryDialog", 1); + // TODO ESecUiCodeEtelReqest/ESecUiNone might be useful + // TODO also support Emergency + + RDEBUG("codeInfo.iRemainingEntryAttempts", + codeInfo.iRemainingEntryAttempts); + if (codeInfo.iRemainingEntryAttempts == KMaxNumberOfPINAttempts) // TODO this might be 10 ? + codeInfo.iRemainingEntryAttempts = -1; - TBuf<0x100> title; title.Zero(); title.Append(_L("Puk2RequiredL")); title.Append(_L("#")); title.AppendNum(codeInfo.iRemainingEntryAttempts); - queryAccepted = iSecQueryUi->SecQueryDialog( title, iSecUi_password, SEC_C_PUK2_CODE_MIN_LENGTH,SEC_C_PUK2_CODE_MAX_LENGTH, ESecUiAlphaNotSupported | ESecUiCancelSupported | secCodeType /*aMode*/ ); - RDEBUG( "iSecUi_password", 0 ); - RDebug::Print( iSecUi_password ); - delete iSecQueryUi; - RDEBUG( "queryAccepted", queryAccepted ); + TBuf<0x100> title; + title.Zero(); + title.Append(_L("Puk2RequiredL")); + title.Append(_L("#")); + title.AppendNum(codeInfo.iRemainingEntryAttempts); + queryAccepted = iSecQueryUi->SecQueryDialog(title, iSecUi_password, + SEC_C_PUK2_CODE_MIN_LENGTH, SEC_C_PUK2_CODE_MAX_LENGTH, + ESecUiSecretNotSupported | ESecUiAlphaNotSupported + | ESecUiCancelSupported | secCodeType /*aMode*/); + RDEBUG("iSecUi_password", 0); + RDebug::Print(iSecUi_password); + delete iSecQueryUi; + RDEBUG("queryAccepted", queryAccepted); - if( queryAccepted!=KErrNone ) + if (queryAccepted != KErrNone) { // cancel "get security unblock code" request - RDEBUG( "AbortSecurityCode", 0 ); + RDEBUG("AbortSecurityCode", 0); iPhone.AbortSecurityCode(secCodeType); - RDEBUG( "AbortSecurityCode", 1 ); - CleanupStack::PopAndDestroy(1); //wait + RDEBUG("AbortSecurityCode", 1); + CleanupStack::PopAndDestroy(1); //wait return; } - { - // new pin code query - CSecQueryUi *iSecQueryUi; - RDEBUG( "CSecQueryUi", 0 ); - iSecQueryUi = CSecQueryUi::NewL(); - // TODO ESecUiCodeEtelReqest/ESecUiNone might be useful - // TODO also support Emergency + { + // new pin code query + CSecQueryUi * iSecQueryUi; + RDEBUG("CSecQueryUi", 0); + iSecQueryUi = CSecQueryUi::NewL(); + // TODO ESecUiCodeEtelReqest/ESecUiNone might be useful + // TODO also support Emergency - queryAccepted = iSecQueryUi->SecQueryDialog( _L("Puk2-New|Puk2-Verif"), aNewPassword, SEC_C_PUK2_CODE_MIN_LENGTH,SEC_C_PUK2_CODE_MAX_LENGTH, ESecUiAlphaNotSupported | ESecUiCancelSupported | secCodeType ); - RDEBUG( "aNewPassword", 0 ); - RDebug::Print( aNewPassword ); - delete iSecQueryUi; - RDEBUG( "queryAccepted", queryAccepted ); - if( queryAccepted!=KErrNone ) - { - // cancel "get security unblock code" request - RDEBUG( "AbortSecurityCode", 0 ); - iPhone.AbortSecurityCode(secCodeType); - RDEBUG( "AbortSecurityCode", 1 ); - CleanupStack::PopAndDestroy(1); //wait - return; - } - } + queryAccepted + = iSecQueryUi->SecQueryDialog(_L("Puk2-New|Puk2-Verif"), + aNewPassword, SEC_C_PUK2_CODE_MIN_LENGTH, + SEC_C_PUK2_CODE_MAX_LENGTH, ESecUiAlphaNotSupported + | ESecUiCancelSupported | secCodeType); + RDEBUG("aNewPassword", 0); + RDebug::Print(aNewPassword); + delete iSecQueryUi; + RDEBUG("queryAccepted", queryAccepted); + if (queryAccepted != KErrNone) + { + // cancel "get security unblock code" request + RDEBUG("AbortSecurityCode", 0); + iPhone.AbortSecurityCode(secCodeType); + RDEBUG("AbortSecurityCode", 1); + CleanupStack::PopAndDestroy(1); //wait + return; + } + } // send code // TODO the current code should be verified before - RDEBUG( "VerifySecurityCode", 0 ); - iPhone.VerifySecurityCode(wait->iStatus,secCodeType,aNewPassword,iSecUi_password); - RDEBUG( "WaitForRequestL", 0 ); + RDEBUG("VerifySecurityCode", 0); + iPhone.VerifySecurityCode(wait->iStatus, secCodeType, aNewPassword, + iSecUi_password); + RDEBUG("WaitForRequestL", 0); TInt res = wait->WaitForRequestL(); - RDEBUG( "WaitForRequestL res", res ); + RDEBUG("WaitForRequestL res", res); CleanupStack::PopAndDestroy(wait); - - switch(res) + + switch (res) { case KErrNone: // code approved -> note - CSecuritySettings::ShowResultNoteL(R_PIN2_CODE_CHANGED_NOTE, CAknNoteDialog::EConfirmationTone); + CSecuritySettings::ShowResultNoteL(R_PIN2_CODE_CHANGED_NOTE, + CAknNoteDialog::EConfirmationTone); break; case KErrGsm0707IncorrectPassword: case KErrAccessDenied: // wrong PUK2 code -> note -> ask PUK2 code again - CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone); + CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, + CAknNoteDialog::EErrorTone); Puk2RequiredL(); break; case KErrGsmSSPasswordAttemptsViolation: case KErrLocked: // Pin2 features blocked permanently! - CSecuritySettings::ShowResultNoteL(R_PIN2_REJECTED, CAknNoteDialog::EConfirmationTone); - break; + CSecuritySettings::ShowResultNoteL(R_PIN2_REJECTED, + CAknNoteDialog::EConfirmationTone); + break; default: - CSecuritySettings::ShowErrorNoteL(res); + CSecuritySettings::ShowErrorNoteL(res); Puk2RequiredL(); break; - } + } } // @@ -1465,117 +1563,132 @@ TInt CSecurityHandler::UPinRequiredL() { /***************************************************** - * Series 60 Customer / ETel - * Series 60 ETel API - *****************************************************/ - TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma )); - TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin )); - if(wcdmaSupported || upinSupported) - { - TInt queryAccepted = KErrCancel; - TInt lCancelSupported = ESecUiCancelNotSupported; + * Series 60 Customer / ETel + * Series 60 ETel API + *****************************************************/ + TBool wcdmaSupported( + FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma)); + TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin)); + if (wcdmaSupported || upinSupported) + { + TInt queryAccepted = KErrCancel; + TInt lCancelSupported = ESecUiCancelNotSupported; RMobilePhone::TMobilePassword iSecUi_password; RMobilePhone::TMobilePassword required_fourth; RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo; - RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo); - RMobilePhone::TMobilePhoneSecurityCode secCodeType = RMobilePhone::ESecurityUniversalPin; + RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg + codeInfoPkg(codeInfo); + RMobilePhone::TMobilePhoneSecurityCode secCodeType = + RMobilePhone::ESecurityUniversalPin; CWait* wait = CWait::NewL(); CleanupStack::PushL(wait); - TBool StartUp = ETrue; + TBool StartUp = ETrue; TInt secUiOriginatedQuery(ESecurityUIsSecUIOriginatedUninitialized); TInt err = KErrNone; TInt res = KErrGeneral; - + StartUp = iStartup; - RDEBUG( "StartUp", StartUp ); - - - wait->SetRequestType(EMobilePhoneGetSecurityCodeInfo); - RDEBUG( "GetSecurityCodeInfo", 0 ); - iPhone.GetSecurityCodeInfo(wait->iStatus, secCodeType, codeInfoPkg); - RDEBUG( "WaitForRequestL", 0 ); - res = wait->WaitForRequestL(); - RDEBUG( "WaitForRequestL res", res ); - User::LeaveIfError(res); + RDEBUG("StartUp", StartUp); - if(!StartUp) - { + wait->SetRequestType(EMobilePhoneGetSecurityCodeInfo); + RDEBUG("GetSecurityCodeInfo", 0); + iPhone.GetSecurityCodeInfo(wait->iStatus, secCodeType, codeInfoPkg); + RDEBUG("WaitForRequestL", 0); + res = wait->WaitForRequestL(); + RDEBUG("WaitForRequestL res", res); + User::LeaveIfError(res); + + if (!StartUp) + { // read a flag to see whether the query is SecUi originated. - err = RProperty::Get(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, secUiOriginatedQuery); - } + err = RProperty::Get(KPSUidSecurityUIs, + KSecurityUIsSecUIOriginatedQuery, secUiOriginatedQuery); + } - /* request PIN using QT */ - CSecQueryUi *iSecQueryUi; - RDEBUG( "CSecQueryUi", 0 ); - iSecQueryUi = CSecQueryUi::NewL(); - // TODO ESecUiCodeEtelReqest/ESecUiNone might be useful - // TODO also support Emergency - if(StartUp || (secUiOriginatedQuery != ESecurityUIsSecUIOriginated) || (err != KErrNone)) - lCancelSupported = ESecUiCancelNotSupported; - else - lCancelSupported = ESecUiCancelSupported; + /* request PIN using QT */ + CSecQueryUi *iSecQueryUi; + RDEBUG("CSecQueryUi", 0); + iSecQueryUi = CSecQueryUi::NewL(); + // TODO ESecUiCodeEtelReqest/ESecUiNone might be useful + // TODO also support Emergency + if (StartUp || (secUiOriginatedQuery != ESecurityUIsSecUIOriginated) + || (err != KErrNone)) + lCancelSupported = ESecUiCancelNotSupported; + else + lCancelSupported = ESecUiCancelSupported; - TBuf<0x100> title; title.Zero(); title.Append(_L("UPin1RequiredL")); title.Append(_L("#")); title.AppendNum(codeInfo.iRemainingEntryAttempts); - queryAccepted = iSecQueryUi->SecQueryDialog( title, iSecUi_password, SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH, ESecUiAlphaNotSupported | lCancelSupported | ESecUiCodeEtelReqest ); - RDEBUG( "iSecUi_password", 0 ); - RDebug::Print( iSecUi_password ); - delete iSecQueryUi; - RDEBUG( "queryAccepted", queryAccepted ); - if ( queryAccepted!=KErrNone ) - { + TBuf<0x100> title; + title.Zero(); + title.Append(_L("UPin1RequiredL")); + title.Append(_L("#")); + title.AppendNum(codeInfo.iRemainingEntryAttempts); + queryAccepted = iSecQueryUi->SecQueryDialog(title, iSecUi_password, + SEC_C_PIN_CODE_MIN_LENGTH, SEC_C_PIN_CODE_MAX_LENGTH, + ESecUiSecretSupported | ESecUiAlphaNotSupported + | lCancelSupported | ESecUiCodeEtelReqest); + RDEBUG("iSecUi_password", 0); + RDebug::Print(iSecUi_password); + delete iSecQueryUi; + RDEBUG("queryAccepted", queryAccepted); + if (queryAccepted != KErrNone) + { CleanupStack::PopAndDestroy(wait); - RDEBUG( "AbortSecurityCode", 0 ); + RDEBUG("AbortSecurityCode", 0); iPhone.AbortSecurityCode(RMobilePhone::ESecurityUniversalPin); - RDEBUG( "AbortSecurityCode", 1 ); - + RDEBUG("AbortSecurityCode", 1); + return KErrCancel; } - RDEBUG( "VerifySecurityCode", 0 ); - iPhone.VerifySecurityCode(wait->iStatus,secCodeType, iSecUi_password, required_fourth); - RDEBUG( "WaitForRequestL", 0 ); + RDEBUG("VerifySecurityCode", 0); + iPhone.VerifySecurityCode(wait->iStatus, secCodeType, + iSecUi_password, required_fourth); + RDEBUG("WaitForRequestL", 0); res = wait->WaitForRequestL(); - RDEBUG( "WaitForRequestL res", res ); + RDEBUG("WaitForRequestL res", res); CleanupStack::PopAndDestroy(wait); TInt returnValue = res; - switch(res) - { + switch (res) + { case KErrNone: // code approved - #if defined(_DEBUG) +#if defined(_DEBUG) RDebug::Print(_L("CSecurityHandler::UPinRequiredL()code approved ")); - #endif - CSecuritySettings::ShowResultNoteL(R_CONFIRMATION_NOTE, CAknNoteDialog::EConfirmationTone); +#endif + CSecuritySettings::ShowResultNoteL(R_CONFIRMATION_NOTE, + CAknNoteDialog::EConfirmationTone); break; case KErrGsm0707IncorrectPassword: case KErrAccessDenied: // code was entered erroneously - CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone); - if(StartUp) - { - returnValue = UPinRequiredL(); - } + CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, + CAknNoteDialog::EErrorTone); + if (StartUp) + { + returnValue = UPinRequiredL(); + } break; case KErrGsmSSPasswordAttemptsViolation: case KErrLocked: // code blocked; show error note and terminate. - if(StartUp) - CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone); + if (StartUp) + CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, + CAknNoteDialog::EErrorTone); break; case KErrGsm0707SimWrong: // sim lock active break; default: CSecuritySettings::ShowErrorNoteL(res); - if(StartUp) - { - returnValue = UPinRequiredL(); - } + if (StartUp) + { + returnValue = UPinRequiredL(); + } break; } - + return returnValue; - } + } else return KErrNone; } @@ -1587,99 +1700,117 @@ // qtdone TInt CSecurityHandler::UPukRequiredL() { - TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma )); - TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin )); - if(wcdmaSupported || upinSupported) - { - RDEBUG( "0", 0 ); - TInt queryAccepted = KErrCancel; + TBool wcdmaSupported( + FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma)); + TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin)); + if (wcdmaSupported || upinSupported) + { + RDEBUG("0", 0); + TInt queryAccepted = KErrCancel; RMobilePhone::TMobilePassword iSecUi_password; RMobilePhone::TMobilePassword aNewPassword; RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo; - RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo); - + RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg + codeInfoPkg(codeInfo); + RMobilePhone::TMobilePhoneSecurityCode blockCodeType; blockCodeType = RMobilePhone::ESecurityUniversalPuk; CWait* wait = CWait::NewL(); CleanupStack::PushL(wait); - + TBool StartUp(ETrue); StartUp = iStartup; - + TInt res(KErrNone); wait->SetRequestType(EMobilePhoneGetSecurityCodeInfo); - RDEBUG( "GetSecurityCodeInfo", 0 ); + RDEBUG("GetSecurityCodeInfo", 0); iPhone.GetSecurityCodeInfo(wait->iStatus, blockCodeType, codeInfoPkg); - RDEBUG( "WaitForRequestL", 0 ); + RDEBUG("WaitForRequestL", 0); res = wait->WaitForRequestL(); - RDEBUG( "WaitForRequestL res", res ); + RDEBUG("WaitForRequestL res", res); User::LeaveIfError(res); //show last "Code Error" note for UPIN verify result so it won't be left under the PUK1 dialog - if(!StartUp && (codeInfo.iRemainingEntryAttempts == KMaxNumberOfPUKAttempts)) - CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone); - + if (!StartUp && (codeInfo.iRemainingEntryAttempts + == KMaxNumberOfPUKAttempts)) + CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, + CAknNoteDialog::EErrorTone); + // ask UPUK code - /* request PIN using QT */ - { - CSecQueryUi *iSecQueryUi; - RDEBUG( "CSecQueryUi", 0 ); - iSecQueryUi = CSecQueryUi::NewL(); - // TODO ESecUiCodeEtelReqest/ESecUiNone might be useful - // TODO also support Emergency - - TBuf<0x100> title; title.Zero(); title.Append(_L("Pin1RequiredL")); title.Append(_L("#")); title.AppendNum(codeInfo.iRemainingEntryAttempts); - queryAccepted = iSecQueryUi->SecQueryDialog( title, iSecUi_password, SEC_C_PUK_CODE_MIN_LENGTH,SEC_C_PUK_CODE_MAX_LENGTH, ESecUiAlphaNotSupported | ESecUiCancelSupported | ESecUiPukRequired ); - RDEBUG( "iSecUi_password", 0 ); - RDebug::Print( iSecUi_password ); - delete iSecQueryUi; - RDEBUG( "queryAccepted", queryAccepted ); - - if( queryAccepted!=KErrNone ) + /* request PIN using QT */ { - CleanupStack::PopAndDestroy(wait); - return KErrCancel; + CSecQueryUi *iSecQueryUi; + RDEBUG("CSecQueryUi", 0); + iSecQueryUi = CSecQueryUi::NewL(); + // TODO ESecUiCodeEtelReqest/ESecUiNone might be useful + // TODO also support Emergency + + TBuf<0x100> title; + title.Zero(); + title.Append(_L("Pin1RequiredL")); + title.Append(_L("#")); + title.AppendNum(codeInfo.iRemainingEntryAttempts); + queryAccepted = iSecQueryUi->SecQueryDialog(title, + iSecUi_password, SEC_C_PUK_CODE_MIN_LENGTH, + SEC_C_PUK_CODE_MAX_LENGTH, ESecUiAlphaNotSupported + | ESecUiCancelSupported | ESecUiPukRequired); + RDEBUG("iSecUi_password", 0); + RDebug::Print(iSecUi_password); + delete iSecQueryUi; + RDEBUG("queryAccepted", queryAccepted); + + if (queryAccepted != KErrNone) + { + CleanupStack::PopAndDestroy(wait); + return KErrCancel; + } } - } - - { - /* request PIN using QT */ - CSecQueryUi *iSecQueryUi; - RDEBUG( "CSecQueryUi", 0 ); - iSecQueryUi = CSecQueryUi::NewL(); - // TODO ESecUiCodeEtelReqest/ESecUiNone might be useful - // TODO also support Emergency + + { + /* request PIN using QT */ + CSecQueryUi *iSecQueryUi; + RDEBUG("CSecQueryUi", 0); + iSecQueryUi = CSecQueryUi::NewL(); + // TODO ESecUiCodeEtelReqest/ESecUiNone might be useful + // TODO also support Emergency - queryAccepted = iSecQueryUi->SecQueryDialog( _L("UPuk-New|UPuk-Verif"), aNewPassword, SEC_C_PUK_CODE_MIN_LENGTH,SEC_C_PUK_CODE_MAX_LENGTH, ESecUiAlphaNotSupported | ESecUiCancelSupported | ESecUiPukRequired ); - RDEBUG( "aNewPassword", 0 ); - RDebug::Print( aNewPassword ); - delete iSecQueryUi; - RDEBUG( "queryAccepted", queryAccepted ); - if( queryAccepted!=KErrNone ) - { - CleanupStack::PopAndDestroy(wait); - return KErrCancel; + queryAccepted = iSecQueryUi->SecQueryDialog(_L( + "UPuk-New|UPuk-Verif"), aNewPassword, + SEC_C_PUK_CODE_MIN_LENGTH, SEC_C_PUK_CODE_MAX_LENGTH, + ESecUiAlphaNotSupported | ESecUiCancelSupported + | ESecUiPukRequired); + RDEBUG("aNewPassword", 0); + RDebug::Print(aNewPassword); + delete iSecQueryUi; + RDEBUG("queryAccepted", queryAccepted); + if (queryAccepted != KErrNone) + { + CleanupStack::PopAndDestroy(wait); + return KErrCancel; + } } - } // send code - RDEBUG( "VerifySecurityCode", 0 ); - iPhone.VerifySecurityCode(wait->iStatus,blockCodeType,aNewPassword,iSecUi_password); - RDEBUG( "WaitForRequestL", 0 ); + RDEBUG("VerifySecurityCode", 0); + iPhone.VerifySecurityCode(wait->iStatus, blockCodeType, aNewPassword, + iSecUi_password); + RDEBUG("WaitForRequestL", 0); res = wait->WaitForRequestL(); - RDEBUG( "WaitForRequestL res", res ); + RDEBUG("WaitForRequestL res", res); CleanupStack::PopAndDestroy(wait); - + TInt returnValue = res; - switch(res) + switch (res) { case KErrNone: // code approved -> note - CSecuritySettings::ShowResultNoteL(R_UPIN_CODE_CHANGED_NOTE, CAknNoteDialog::EConfirmationTone); + CSecuritySettings::ShowResultNoteL(R_UPIN_CODE_CHANGED_NOTE, + CAknNoteDialog::EConfirmationTone); break; case KErrGsm0707IncorrectPassword: case KErrAccessDenied: // wrong PUK code -> note -> ask UPUK code again - CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone); + CSecuritySettings::ShowResultNoteL(R_CODE_ERROR, + CAknNoteDialog::EErrorTone); returnValue = UPukRequiredL(); break; case KErrGsm0707SimWrong: @@ -1690,14 +1821,15 @@ // sim card rejected. break; default: - CSecuritySettings::ShowErrorNoteL(res); + CSecuritySettings::ShowErrorNoteL(res); returnValue = UPukRequiredL(); break; - } - + } + return returnValue; - } - else // not wcdmaSupported || upinSupported + } + else + // not wcdmaSupported || upinSupported return KErrNone; } @@ -1709,8 +1841,9 @@ // qtdone void CSecurityHandler::SimLockEventL() { - RDEBUG( "0", 0 ); - CSecuritySettings::ShowResultNoteL(R_SIM_ON, CAknNoteDialog::EConfirmationTone); + RDEBUG("0", 0); + CSecuritySettings::ShowResultNoteL(R_SIM_ON, + CAknNoteDialog::EConfirmationTone); } // --------------------------------------------------------- // CSecurityHandler::RemoveSplashScreenL() @@ -1728,20 +1861,20 @@ // qtdone void CSecurityHandler::ShowGenericErrorNoteL(TInt aStatus) { - // Let's create TextResolver instance for error resolving... - RDEBUG( "aStatus", aStatus ); - RDEBUG( "!!!!! this should never be called !!!!", 0 ); - - CTextResolver* textresolver = CTextResolver::NewLC(); - // Resolve the error - TPtrC errorstring; - errorstring.Set( textresolver->ResolveErrorString( aStatus ) ); - iNoteDlg = new (ELeave) CAknNoteDialog(REINTERPRET_CAST(CEikDialog**,&iNoteDlg)); - iNoteDlg->PrepareLC(R_CODE_ERROR); - iNoteDlg->SetTextL((TDesC&)errorstring); - iNoteDlg->RunDlgLD(CAknNoteDialog::ELongTimeout, CAknNoteDialog::EErrorTone); - CleanupStack::PopAndDestroy(textresolver); + // Let's create TextResolver instance for error resolving... + RDEBUG("aStatus", aStatus); + RDEBUG("!!!!! this should never be called !!!!", 0); + + CTextResolver* textresolver = CTextResolver::NewLC(); + // Resolve the error + TPtrC errorstring; + errorstring.Set(textresolver->ResolveErrorString(aStatus)); + iNoteDlg = new (ELeave) CAknNoteDialog(REINTERPRET_CAST(CEikDialog**,&iNoteDlg)); + iNoteDlg->PrepareLC(R_CODE_ERROR); + iNoteDlg->SetTextL((TDesC&) errorstring); + iNoteDlg->RunDlgLD(CAknNoteDialog::ELongTimeout, + CAknNoteDialog::EErrorTone); + CleanupStack::PopAndDestroy(textresolver); } - // End of file diff -r 8957df7b0072 -r 098e361762d2 securitydialogs/SecUi/Src/SecUiSecuritySettings.cpp --- a/securitydialogs/SecUi/Src/SecUiSecuritySettings.cpp Mon May 03 13:20:16 2010 +0300 +++ b/securitydialogs/SecUi/Src/SecUiSecuritySettings.cpp Fri May 14 16:43:26 2010 +0300 @@ -16,7 +16,6 @@ * */ - #include #include #include @@ -49,20 +48,19 @@ #include "SecQueryUi.h" #include - /***************************************************** - * Series 60 Customer / TSY - * Needs customer TSY implementation - *****************************************************/ +/***************************************************** + * Series 60 Customer / TSY + * Needs customer TSY implementation + *****************************************************/ // LOCAL CONSTANTS AND MACROS -const TInt KTriesToConnectServer( 2 ); -const TInt KTimeBeforeRetryingServerConnection( 50000 ); -const TInt PhoneIndex( 0 ); +const TInt KTriesToConnectServer(2); +const TInt KTimeBeforeRetryingServerConnection(50000); +const TInt PhoneIndex(0); -const TInt KMaxNumberOfPINAttempts(3); -const TInt KLastRemainingInputAttempt(1); +const TInt KMaxNumberOfPINAttempts(3); // is this valid also for PIN2 ? -#define ESecUiTypeLock 0x00100000 +#define ESecUiTypeLock 0x00100000 // ================= MEMBER FUNCTIONS ======================= // @@ -96,49 +94,51 @@ EXPORT_C void CSecuritySettings::ConstructL() { /***************************************************** - * Series 60 Customer / ETel - * Series 60 ETel API - *****************************************************/ + * Series 60 Customer / ETel + * Series 60 ETel API + *****************************************************/ /***************************************************** - * Series 60 Customer / TSY - * Needs customer TSY implementation - *****************************************************/ + * Series 60 Customer / TSY + * Needs customer TSY implementation + *****************************************************/ - TInt err( KErrGeneral ); - TInt thisTry( 0 ); + TInt err(KErrGeneral); + TInt thisTry(0); iWait = CWait::NewL(); RTelServer::TPhoneInfo PhoneInfo; /* All server connections are tried to be made KTriesToConnectServer times because occasional - fails on connections are possible, at least on some servers */ - #if defined(_DEBUG) + fails on connections are possible, at least on some servers */ +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecuritySettings::ConstructL()")); - #endif - +#endif + FeatureManager::InitializeLibL(); // connect to ETel server - while ( ( err = iServer.Connect() ) != KErrNone && ( thisTry++ ) <= KTriesToConnectServer ) + while ((err = iServer.Connect()) != KErrNone && (thisTry++) + <= KTriesToConnectServer) { - User::After( KTimeBeforeRetryingServerConnection ); + User::After( KTimeBeforeRetryingServerConnection); } - User::LeaveIfError( err ); + User::LeaveIfError(err); // load TSY - err = iServer.LoadPhoneModule( KMmTsyModuleName ); - if ( err != KErrAlreadyExists ) + err = iServer.LoadPhoneModule(KMmTsyModuleName); + if (err != KErrAlreadyExists) { // May return also KErrAlreadyExists if something else // has already loaded the TSY module. And that is // not an error. - User::LeaveIfError( err ); + User::LeaveIfError(err); } // open phones - User::LeaveIfError(iServer.SetExtendedErrorGranularity(RTelServer::EErrorExtended)); + User::LeaveIfError(iServer.SetExtendedErrorGranularity( + RTelServer::EErrorExtended)); User::LeaveIfError(iServer.GetPhoneInfo(PhoneIndex, PhoneInfo)); - User::LeaveIfError(iPhone.Open(iServer,PhoneInfo.iName)); + User::LeaveIfError(iPhone.Open(iServer, PhoneInfo.iName)); User::LeaveIfError(iCustomPhone.Open(iPhone)); - iSecurityHandler = new( ELeave ) CSecurityHandler( iPhone ); + iSecurityHandler = new (ELeave) CSecurityHandler(iPhone); } // // ---------------------------------------------------------- @@ -149,34 +149,36 @@ EXPORT_C CSecuritySettings::~CSecuritySettings() { /***************************************************** - * Series 60 Customer / ETel - * Series 60 ETel API - *****************************************************/ + * Series 60 Customer / ETel + * Series 60 ETel API + *****************************************************/ /***************************************************** - * Series 60 Customer / TSY - * Needs customer TSY implementation - *****************************************************/ + * Series 60 Customer / TSY + * Needs customer TSY implementation + *****************************************************/ delete iSecurityHandler; // Cancel active requests - if(iWait->IsActive()) - { - #if defined(_DEBUG) - RDebug::Print(_L("(SECUI)CManualSecuritySettings::~CSecuritySettings() CANCEL REQ")); - #endif + if (iWait->IsActive()) + { +#if defined(_DEBUG) + RDebug::Print(_L("(SECUI)CManualSecuritySettings::~CSecuritySettings() CANCEL REQ")); +#endif iPhone.CancelAsyncRequest(iWait->GetRequestType()); - - switch(iWait->GetRequestType()) - { //inform query that it has beeen canceled - case EMobilePhoneSetLockSetting: - case EMobilePhoneSetFdnSetting: - RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, ESecurityUIsQueryRequestCanceled); - break; - default: - break; - } - - } + + switch (iWait->GetRequestType()) + { //inform query that it has beeen canceled + case EMobilePhoneSetLockSetting: + case EMobilePhoneSetFdnSetting: + RProperty::Set(KPSUidSecurityUIs, + KSecurityUIsQueryRequestCancel, + ESecurityUIsQueryRequestCanceled); + break; + default: + break; + } + + } // close phone if (iPhone.SubSessionHandle()) iPhone.Close(); @@ -200,18 +202,18 @@ // qtdone EXPORT_C void CSecuritySettings::ChangePinL() { - RDEBUG( "0", 0 ); + RDEBUG("0", 0); RMobilePhone::TMobilePassword iOldPassword; RMobilePhone::TMobilePassword iNewPassword; - TInt iFlags=ESecUiTypeLock; - iOldPassword.Copy(_L("")); - iNewPassword.Copy(_L("")); + TInt iFlags = ESecUiTypeLock; + iOldPassword.Copy(_L("")); + iNewPassword.Copy(_L("")); TBuf<0x80> iCaption; iCaption.Copy(_L("ChangePinL")); - TInt iShowError=1; - ChangePinParamsL(iOldPassword, iNewPassword, iFlags, iCaption, iShowError); - RDEBUG( "0", 0 ); + TInt iShowError = 1; + ChangePinParamsL(iOldPassword, iNewPassword, iFlags, iCaption, iShowError); + RDEBUG("0", 0); } // @@ -222,18 +224,19 @@ // qtdone EXPORT_C void CSecuritySettings::ChangeUPinL() { - RDEBUG( "0", 0 ); + RDEBUG("0", 0); RMobilePhone::TMobilePassword iOldPassword; RMobilePhone::TMobilePassword iNewPassword; - TInt iFlags=ESecUiTypeLock; - iOldPassword.Copy(_L("")); - iNewPassword.Copy(_L("")); + TInt iFlags = ESecUiTypeLock; + iOldPassword.Copy(_L("")); + iNewPassword.Copy(_L("")); TBuf<0x80> iCaption; iCaption.Copy(_L("ChangeUPinL")); - TInt iShowError=1; - ChangeUPinParamsL(iOldPassword, iNewPassword, iFlags, iCaption, iShowError); - RDEBUG( "0", 0 ); + TInt iShowError = 1; + ChangeUPinParamsL(iOldPassword, iNewPassword, iFlags, iCaption, + iShowError); + RDEBUG("0", 0); } @@ -245,20 +248,21 @@ // qtdone EXPORT_C void CSecuritySettings::ChangePin2L() { - RDEBUG( "0", 0 ); + RDEBUG("0", 0); RMobilePhone::TMobilePassword iOldPassword; RMobilePhone::TMobilePassword iNewPassword; - TInt iFlags=ESecUiTypeLock; - iOldPassword.Copy(_L("")); - iNewPassword.Copy(_L("")); + TInt iFlags = ESecUiTypeLock; + iOldPassword.Copy(_L("")); + iNewPassword.Copy(_L("")); TBuf<0x80> iCaption; iCaption.Copy(_L("ChangePin2L")); - TInt iShowError=1; - ChangePin2ParamsL(iOldPassword, iNewPassword, iFlags, iCaption, iShowError); - RDEBUG( "0", 0 ); + TInt iShowError = 1; + ChangePin2ParamsL(iOldPassword, iNewPassword, iFlags, iCaption, + iShowError); + RDEBUG("0", 0); - } + } // // ---------------------------------------------------------- // CSecuritySettings::ChangeSecCodeL() @@ -267,18 +271,19 @@ // qtdone EXPORT_C void CSecuritySettings::ChangeSecCodeL() { - RDEBUG( "0", 0 ); + RDEBUG("0", 0); RMobilePhone::TMobilePassword iOldPassword; RMobilePhone::TMobilePassword iNewPassword; - TInt iFlags=0; - iOldPassword.Copy(_L("")); - iNewPassword.Copy(_L("")); + TInt iFlags = 0; + iOldPassword.Copy(_L("")); + iNewPassword.Copy(_L("")); TBuf<0x80> iCaption; iCaption.Copy(_L("ChangeSecCodeL")); - TInt iShowError=1; - ChangeSecCodeParamsL(iOldPassword, iNewPassword, iFlags, iCaption, iShowError); - RDEBUG( "0", 0 ); + TInt iShowError = 1; + ChangeSecCodeParamsL(iOldPassword, iNewPassword, iFlags, iCaption, + iShowError); + RDEBUG("0", 0); } // // ---------------------------------------------------------- @@ -288,62 +293,60 @@ // qtdone EXPORT_C TInt CSecuritySettings::ChangeAutoLockPeriodL(TInt aPeriod) { - TInt ret=0; - RDEBUG( "aPeriod", aPeriod ); + TInt ret = 0; + RDEBUG("aPeriod", aPeriod); RMobilePhone::TMobilePassword iOldPassword; - TInt iFlags=0; - TInt iShowError=1; + TInt iFlags = 0; + TInt iShowError = 1; TBuf<0x80> iCaption; iCaption.Copy(_L("ChangeAutoLockPeriodL")); iOldPassword.Copy(_L("")); - ret = ChangeAutoLockPeriodParamsL(aPeriod, iOldPassword, iFlags, iCaption, iShowError); - RDEBUG( "ret", ret ); + ret = ChangeAutoLockPeriodParamsL(aPeriod, iOldPassword, iFlags, + iCaption, iShowError); + RDEBUG("ret", ret); return ret; } - - // // ---------------------------------------------------------- // CSecuritySettings::ChangeRemoteLockStatusL() // Changes remote lock status (on/off) // ---------------------------------------------------------- // no qtdone -EXPORT_C TInt CSecuritySettings::ChangeRemoteLockStatusL( TBool& aRemoteLockStatus, TDes& aRemoteLockCode, TInt aAutoLockPeriod ) +EXPORT_C TInt CSecuritySettings::ChangeRemoteLockStatusL( + TBool& aRemoteLockStatus, TDes& aRemoteLockCode, TInt aAutoLockPeriod) { - #ifdef RD_REMOTELOCK +#ifdef RD_REMOTELOCK TInt retValue( KErrNone ); - #ifdef _DEBUG +#ifdef _DEBUG RDebug::Print(_L("(SecUi)CSecuritySettings::ChangeRemoteLockStatusL() - Enter, aRemoteLockStatus == %d, aAutoLockPeriod == %d" ), aRemoteLockStatus, aAutoLockPeriod ); - #endif // _DEBUG - - CCoeEnv* coeEnv = CCoeEnv::Static(); +#endif // _DEBUG + CCoeEnv* coeEnv = CCoeEnv::Static(); CDesCArrayFlat* items = coeEnv->ReadDesC16ArrayResourceL( R_REMOTELOCK_LBX ); CleanupStack::PushL( items ); // Store the current remote lock setting TInt previousItem( 0 ); - TInt currentItem( 0 ); + TInt currentItem( 0 ); if ( aRemoteLockStatus ) { previousItem = KRemoteLockSettingItemOn; - currentItem = KRemoteLockSettingItemOn; + currentItem = KRemoteLockSettingItemOn; } else { previousItem = KRemoteLockSettingItemOff; - currentItem = KRemoteLockSettingItemOff; + currentItem = KRemoteLockSettingItemOff; } // Create Remote Lock setting page for user to enable or disable remote locking CRemoteLockSettingPage* remoteLockSettingPage = new( ELeave ) CRemoteLockSettingPage( R_REMOTELOCK_SETTING_PAGE, currentItem, items ); - #ifdef _DEBUG +#ifdef _DEBUG RDebug::Print( _L( "(SecUi)CSecuritySettings::ChangeRemoteLockStatusL() - Executing CRemoteLockSettingPage dialog" ) ); - #endif // _DEBUG - +#endif // _DEBUG // Execute the remote lock enable/disable dialog TBool ret = remoteLockSettingPage->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ); @@ -354,10 +357,9 @@ { if ( currentItem == KRemoteLockSettingItemOn ) { - #ifdef _DEBUG +#ifdef _DEBUG RDebug::Print( _L( "(SecUi)CSecuritySettings::ChangeRemoteLockStatusL() - Remote lock status set to ON" ) ); - #endif // _DEBUG - +#endif // _DEBUG aRemoteLockStatus = ETrue; // If user wishes to enable remote lock @@ -367,12 +369,11 @@ } else if ( currentItem == KRemoteLockSettingItemOff ) { - #ifdef _DEBUG +#ifdef _DEBUG RDebug::Print( _L( "(SecUi)CSecuritySettings::ChangeRemoteLockStatusL() - Remote lock status set to OFF" ) ); - #endif // _DEBUG - +#endif // _DEBUG aRemoteLockStatus = EFalse; - retValue = KErrNone; + retValue = KErrNone; // Check whether the status was already off // If not don't make the user enter the security code @@ -407,19 +408,19 @@ // Something went wrong with the RemoteLockSettingPage dialog retValue = KErrGeneral; - #ifdef _DEBUG +#ifdef _DEBUG RDebug::Print( _L( "(SecUi)CSecuritySettings::ChangeRemoteLockStatusL() - CRemoteLockSettingPage::ExecuteLD() failed" ) ); - #endif // _DEBUG +#endif // _DEBUG } - #ifdef _DEBUG +#ifdef _DEBUG RDebug::Print(_L("(SecUi)CSecuritySettings::ChangeRemoteLockStatusL() - Exit" ) ); - #endif +#endif return retValue; - #else //! RD_REMOTELOCK +#else //! RD_REMOTELOCK return KErrNotSupported; - #endif //RD_REMOTELOCK +#endif //RD_REMOTELOCK } // // ---------------------------------------------------------- @@ -429,32 +430,30 @@ // a side effect pops up security code query). // ---------------------------------------------------------- // no qtdone -TInt CSecuritySettings::RemoteLockCodeQueryL( TDes& aRemoteLockCode ) +TInt CSecuritySettings::RemoteLockCodeQueryL(TDes& aRemoteLockCode) { - #ifdef RD_REMOTELOCK +#ifdef RD_REMOTELOCK TInt retValue( KErrNone ); - #ifdef _DEBUG +#ifdef _DEBUG RDebug::Print(_L("(SecUi)CSecuritySettings::ChangeRemoteLockCodeL() - Enter" ) ); - #endif // _DEBUG - +#endif // _DEBUG // Clear the remote lock code buffer aRemoteLockCode.Zero(); // ----- Remote lock code query ------------------------------------------- // Execute Remote Lock code query - #ifdef _DEBUG +#ifdef _DEBUG RDebug::Print( _L( "(SecUi)CSecuritySettings::ChangeRemoteLockCodeL() - Executing remote lock code query" ) ); - #endif // _DEBUG - +#endif // _DEBUG // Load the query prompt from resources CCodeQueryDialog* codeQuery = new( ELeave ) CCodeQueryDialog( aRemoteLockCode, SEC_REMOTELOCK_CODE_MIN_LENGTH,SEC_REMOTELOCK_CODE_MAX_LENGTH, ESecUiNone, ETrue ); TInt buttonId = codeQuery->ExecuteLD( R_REMOTELOCK_CODE_QUERY ); if ( buttonId == EEikBidOk ) { - // Ok was pressed and the remote lock code seems fine - retValue = KErrNone; + // Ok was pressed and the remote lock code seems fine + retValue = KErrNone; } else { @@ -466,10 +465,9 @@ if ( retValue != KErrNone ) { - #ifdef _DEBUG +#ifdef _DEBUG RDebug::Print(_L("(SecUi)CSecuritySettings::ChangeRemoteLockCodeL() - Exit, Remote lock code error" ) ); - #endif // _DEBUG - +#endif // _DEBUG // Can't continue beyond this return retValue; } @@ -477,10 +475,9 @@ // ----- Remote lock code confirm query ----------------------------------- // Confirm the code by asking it again - #ifdef _DEBUG +#ifdef _DEBUG RDebug::Print( _L( "(SecUi)CSecuritySettings::ChangeRemoteLockCodeL() - Executing remote lock code verify query" ) ); - #endif // _DEBUG - +#endif // _DEBUG // Buffer for the confirmation code TBuf confirmCode; @@ -488,36 +485,35 @@ CCodeQueryDialog* codeConfirmQuery = new( ELeave ) CCodeQueryDialog( confirmCode, SEC_REMOTELOCK_CODE_MIN_LENGTH, SEC_REMOTELOCK_CODE_MAX_LENGTH, ESecUiNone, ETrue ); buttonId = codeConfirmQuery->ExecuteLD( R_VERIFY_REMOTELOCK_CODE_QUERY); - - if ( buttonId == EEikBidOk ) + if ( buttonId == EEikBidOk ) { // Compare codes. Compare returns zero if descriptors have // the same length and the same content while ( (aRemoteLockCode.CompareF( confirmCode ) != 0) && (buttonId == EEikBidOk)) { - //Codes didn't match; zero the bufffers and show the dialog again - aRemoteLockCode.Zero(); - confirmCode.Zero(); - // Codes don't match. Notify user - ShowResultNoteL( R_REMOTELOCK_CODES_DONT_MATCH, CAknNoteDialog::EErrorTone ); - codeQuery = new( ELeave ) CCodeQueryDialog( aRemoteLockCode, SEC_REMOTELOCK_CODE_MIN_LENGTH,SEC_REMOTELOCK_CODE_MAX_LENGTH, ESecUiNone, ETrue ); - buttonId = codeQuery->ExecuteLD( R_REMOTELOCK_CODE_QUERY ); - //Unless user pressed Cancel show the verification query - if(buttonId == EEikBidOk) - { - codeConfirmQuery = new( ELeave ) CCodeQueryDialog( confirmCode, SEC_REMOTELOCK_CODE_MIN_LENGTH, SEC_REMOTELOCK_CODE_MAX_LENGTH, ESecUiNone, ETrue ); - buttonId = codeConfirmQuery->ExecuteLD( R_VERIFY_REMOTELOCK_CODE_QUERY); - } - - } + //Codes didn't match; zero the bufffers and show the dialog again + aRemoteLockCode.Zero(); + confirmCode.Zero(); + // Codes don't match. Notify user + ShowResultNoteL( R_REMOTELOCK_CODES_DONT_MATCH, CAknNoteDialog::EErrorTone ); + codeQuery = new( ELeave ) CCodeQueryDialog( aRemoteLockCode, SEC_REMOTELOCK_CODE_MIN_LENGTH,SEC_REMOTELOCK_CODE_MAX_LENGTH, ESecUiNone, ETrue ); + buttonId = codeQuery->ExecuteLD( R_REMOTELOCK_CODE_QUERY ); + //Unless user pressed Cancel show the verification query + if(buttonId == EEikBidOk) + { + codeConfirmQuery = new( ELeave ) CCodeQueryDialog( confirmCode, SEC_REMOTELOCK_CODE_MIN_LENGTH, SEC_REMOTELOCK_CODE_MAX_LENGTH, ESecUiNone, ETrue ); + buttonId = codeConfirmQuery->ExecuteLD( R_VERIFY_REMOTELOCK_CODE_QUERY); + } + + } //User pressed cancel if(buttonId != EEikBidOk) { - // Set the code length to zero leaving no trash for possible retry - // Report error and let the user try again - aRemoteLockCode.Zero(); - confirmCode.Zero(); - retValue = KErrAbort; + // Set the code length to zero leaving no trash for possible retry + // Report error and let the user try again + aRemoteLockCode.Zero(); + confirmCode.Zero(); + retValue = KErrAbort; } else { @@ -525,14 +521,14 @@ confirmCode.Zero(); // ----- Check against security code ------------------------------ - + // Check that the new remote lock code doesn't match the security // code of the device. RMobilePhone::TMobilePhoneSecurityCode secCodeType; secCodeType = RMobilePhone::ESecurityCodePhonePassword; RMobilePhone::TMobilePassword securityCode; - RMobilePhone::TMobilePassword unblockCode; // Required here only as a dummy parameter + RMobilePhone::TMobilePassword unblockCode; // Required here only as a dummy parameter if ( aRemoteLockCode.Length() <= RMobilePhone::KMaxMobilePasswordSize ) { @@ -540,86 +536,87 @@ iWait->SetRequestType( EMobilePhoneVerifySecurityCode ); RDEBUG( "VerifySecurityCode", 0 ); iPhone.VerifySecurityCode( iWait->iStatus, secCodeType, securityCode, unblockCode ); - RDEBUG( "WaitForRequestL", 0 ); + RDEBUG( "WaitForRequestL", 0 ); TInt res = iWait->WaitForRequestL(); - RDEBUG( "WaitForRequestL res", res ); - #ifdef __WINS__ - if (res == KErrNotSupported) - res = KErrNone; - #endif + RDEBUG( "WaitForRequestL res", res ); +#ifdef __WINS__ + if (res == KErrNotSupported || res == KErrTimedOut) + res = KErrNone; +#endif // The remote lock code matches the security code // and that is not allowed while ( (res == KErrNone) && (buttonId == EEikBidOk)) { - #ifdef _DEBUG +#ifdef _DEBUG RDebug::Print(_L("(SecUi)CSecuritySettings::ChangeRemoteLockCodeL() - Unacceptable remote lock code" ) ); - #endif // _DEBUG +#endif // _DEBUG aRemoteLockCode.Zero(); confirmCode.Zero(); - - ShowResultNoteL( R_REMOTELOCK_INVALID_CODE, CAknNoteDialog::EErrorTone ); - - codeQuery = new( ELeave ) CCodeQueryDialog( aRemoteLockCode, SEC_REMOTELOCK_CODE_MIN_LENGTH,SEC_REMOTELOCK_CODE_MAX_LENGTH, ESecUiNone, ETrue ); + + ShowResultNoteL( R_REMOTELOCK_INVALID_CODE, CAknNoteDialog::EErrorTone ); + + codeQuery = new( ELeave ) CCodeQueryDialog( aRemoteLockCode, SEC_REMOTELOCK_CODE_MIN_LENGTH,SEC_REMOTELOCK_CODE_MAX_LENGTH, ESecUiNone, ETrue ); buttonId = codeQuery->ExecuteLD( R_REMOTELOCK_CODE_QUERY ); //Unless user pressed Cancel show the verification query if(buttonId == EEikBidOk) { - codeConfirmQuery = new( ELeave ) CCodeQueryDialog( confirmCode, SEC_REMOTELOCK_CODE_MIN_LENGTH, SEC_REMOTELOCK_CODE_MAX_LENGTH, ESecUiNone, ETrue ); - buttonId = codeConfirmQuery->ExecuteLD( R_VERIFY_REMOTELOCK_CODE_QUERY); - - // Compare codes. Compare returns zero if descriptors have - // the same length and the same content - while ( (aRemoteLockCode.CompareF( confirmCode ) != 0) && (buttonId == EEikBidOk)) - { - //Codes didn't match; zero the bufffers and show the dialog again - aRemoteLockCode.Zero(); - confirmCode.Zero(); - // Codes don't match. Notify user - ShowResultNoteL( R_REMOTELOCK_CODES_DONT_MATCH, CAknNoteDialog::EErrorTone ); - codeQuery = new( ELeave ) CCodeQueryDialog( aRemoteLockCode, SEC_REMOTELOCK_CODE_MIN_LENGTH,SEC_REMOTELOCK_CODE_MAX_LENGTH, ESecUiNone, ETrue ); - buttonId = codeQuery->ExecuteLD( R_REMOTELOCK_CODE_QUERY ); - //Unless user pressed Cancel show the verification query - if(buttonId == EEikBidOk) - { - codeConfirmQuery = new( ELeave ) CCodeQueryDialog( confirmCode, SEC_REMOTELOCK_CODE_MIN_LENGTH, SEC_REMOTELOCK_CODE_MAX_LENGTH, ESecUiNone, ETrue ); - buttonId = codeConfirmQuery->ExecuteLD( R_VERIFY_REMOTELOCK_CODE_QUERY); - } - - } - //User pressed cancel - if(buttonId != EEikBidOk) + codeConfirmQuery = new( ELeave ) CCodeQueryDialog( confirmCode, SEC_REMOTELOCK_CODE_MIN_LENGTH, SEC_REMOTELOCK_CODE_MAX_LENGTH, ESecUiNone, ETrue ); + buttonId = codeConfirmQuery->ExecuteLD( R_VERIFY_REMOTELOCK_CODE_QUERY); + + // Compare codes. Compare returns zero if descriptors have + // the same length and the same content + while ( (aRemoteLockCode.CompareF( confirmCode ) != 0) && (buttonId == EEikBidOk)) + { + //Codes didn't match; zero the bufffers and show the dialog again + aRemoteLockCode.Zero(); + confirmCode.Zero(); + // Codes don't match. Notify user + ShowResultNoteL( R_REMOTELOCK_CODES_DONT_MATCH, CAknNoteDialog::EErrorTone ); + codeQuery = new( ELeave ) CCodeQueryDialog( aRemoteLockCode, SEC_REMOTELOCK_CODE_MIN_LENGTH,SEC_REMOTELOCK_CODE_MAX_LENGTH, ESecUiNone, ETrue ); + buttonId = codeQuery->ExecuteLD( R_REMOTELOCK_CODE_QUERY ); + //Unless user pressed Cancel show the verification query + if(buttonId == EEikBidOk) { - // Set the code length to zero leaving no trash for possible retry - // Report error and let the user try again - aRemoteLockCode.Zero(); - confirmCode.Zero(); - retValue = KErrAbort; + codeConfirmQuery = new( ELeave ) CCodeQueryDialog( confirmCode, SEC_REMOTELOCK_CODE_MIN_LENGTH, SEC_REMOTELOCK_CODE_MAX_LENGTH, ESecUiNone, ETrue ); + buttonId = codeConfirmQuery->ExecuteLD( R_VERIFY_REMOTELOCK_CODE_QUERY); } - else //Check against security code - { - securityCode = aRemoteLockCode; - iWait->SetRequestType( EMobilePhoneVerifySecurityCode ); - RDEBUG( "VerifySecurityCode", 0 ); - iPhone.VerifySecurityCode( iWait->iStatus, secCodeType, securityCode, unblockCode ); - RDEBUG( "WaitForRequestL", 0 ); - res = iWait->WaitForRequestL(); - #ifdef __WINS__ - if (res == KErrNotSupported) - res = KErrNone; - #endif - RDEBUG( "WaitForRequestL res", res ); - } + + } + //User pressed cancel + if(buttonId != EEikBidOk) + { + // Set the code length to zero leaving no trash for possible retry + // Report error and let the user try again + aRemoteLockCode.Zero(); + confirmCode.Zero(); + retValue = KErrAbort; + } + else //Check against security code + + { + securityCode = aRemoteLockCode; + iWait->SetRequestType( EMobilePhoneVerifySecurityCode ); + RDEBUG( "VerifySecurityCode", 0 ); + iPhone.VerifySecurityCode( iWait->iStatus, secCodeType, securityCode, unblockCode ); + RDEBUG( "WaitForRequestL", 0 ); + res = iWait->WaitForRequestL(); +#ifdef __WINS__ + if (res == KErrNotSupported || res == KErrTimedOut) + res = KErrNone; +#endif + RDEBUG( "WaitForRequestL res", res ); + } } - + } - //User pressed cancel - if(buttonId != EEikBidOk) + //User pressed cancel + if(buttonId != EEikBidOk) { - // Set the code length to zero leaving no trash for possible retry - // Report error and let the user try again - aRemoteLockCode.Zero(); - confirmCode.Zero(); - retValue = KErrAbort; + // Set the code length to zero leaving no trash for possible retry + // Report error and let the user try again + aRemoteLockCode.Zero(); + confirmCode.Zero(); + retValue = KErrAbort; } } @@ -635,6 +632,7 @@ } } else //User pressed Cancel + { // Set the code length to zero leaving no trash for possible retry aRemoteLockCode.Zero(); @@ -642,14 +640,13 @@ retValue = KErrAbort; } - #ifdef _DEBUG +#ifdef _DEBUG RDebug::Print(_L("(SecUi)CSecuritySettings::ChangeRemoteLockCodeL() - Exit" ) ); - #endif // _DEBUG - +#endif // _DEBUG return retValue; - #else //! RD_REMOTELOCK +#else //! RD_REMOTELOCK return KErrNotSupported; - #endif //RD_REMOTELOCK +#endif //RD_REMOTELOCK } // // ---------------------------------------------------------- @@ -658,17 +655,16 @@ // requires user to enter the security code. // ---------------------------------------------------------- // no qtdone -TInt CSecuritySettings::RemoteLockSetLockSettingL( TBool aLockSetting ) +TInt CSecuritySettings::RemoteLockSetLockSettingL(TBool aLockSetting) { - #ifdef RD_REMOTELOCK +#ifdef RD_REMOTELOCK TInt retValue( KErrNone ); - #ifdef _DEBUG +#ifdef _DEBUG RDebug::Print(_L("(SecUi)CSecuritySettings::RemoteLockSetLockSettingL( %d ) - Enter" ), aLockSetting ); - #endif // _DEBUG - +#endif // _DEBUG RMobilePhone::TMobilePhoneLockSetting lockSetting = RMobilePhone::ELockSetEnabled; - RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockPhoneDevice; + RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockPhoneDevice; if ( aLockSetting ) { @@ -681,68 +677,65 @@ iWait->SetRequestType( EMobilePhoneSetLockSetting ); RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, ESecurityUIsQueryRequestOk); - RDEBUG( "SetLockSetting", 0 ); + RDEBUG( "SetLockSetting", 0 ); iPhone.SetLockSetting( iWait->iStatus, lockType, lockSetting ); // Wait for code verify to complete - RDEBUG( "WaitForRequestL", 0 ); + RDEBUG( "WaitForRequestL", 0 ); retValue = iWait->WaitForRequestL(); - RDEBUG( "WaitForRequestL retValue", retValue ); - #ifdef __WINS__ - if (retValue == KErrNotSupported) - retValue = KErrNone; - #endif + RDEBUG( "WaitForRequestL retValue", retValue ); +#ifdef __WINS__ + if (retValue == KErrNotSupported || retValue == KErrTimedOut) + retValue = KErrNone; +#endif switch( retValue ) { case KErrNone: - #ifdef _DEBUG - RDebug::Print( _L( "(SecUi)CSecuritySettings::RemoteLockSetLockSettingL() - EMobilePhoneSetLockSetting request returned KErrNone" ) ); - #endif // _DEBUG - break; +#ifdef _DEBUG + RDebug::Print( _L( "(SecUi)CSecuritySettings::RemoteLockSetLockSettingL() - EMobilePhoneSetLockSetting request returned KErrNone" ) ); +#endif // _DEBUG + break; case KErrGsmSSPasswordAttemptsViolation: case KErrLocked: - #ifdef _DEBUG - RDebug::Print( _L( "(SecUi)CSecuritySettings::RemoteLockSetLockSettingL() - EMobilePhoneSetLockSetting request returned KErrLocked" ) ); - #endif // _DEBUG - //Error note is shown in CSecurityHandler::PassPhraseRequired() - break; +#ifdef _DEBUG + RDebug::Print( _L( "(SecUi)CSecuritySettings::RemoteLockSetLockSettingL() - EMobilePhoneSetLockSetting request returned KErrLocked" ) ); +#endif // _DEBUG + //Error note is shown in CSecurityHandler::PassPhraseRequired() + break; case KErrGsm0707IncorrectPassword: case KErrAccessDenied: - #ifdef _DEBUG - RDebug::Print( _L( "(SecUi)CSecuritySettings::RemoteLockSetLockSettingL() - EMobilePhoneSetLockSetting request returned KErrAccessDenied" ) ); - #endif // _DEBUG - // Security code was entered erroneously - //Error note is shown in CSecurityHandler::PassPhraseRequired() - break; +#ifdef _DEBUG + RDebug::Print( _L( "(SecUi)CSecuritySettings::RemoteLockSetLockSettingL() - EMobilePhoneSetLockSetting request returned KErrAccessDenied" ) ); +#endif // _DEBUG + // Security code was entered erroneously + //Error note is shown in CSecurityHandler::PassPhraseRequired() + break; case KErrAbort: - #ifdef _DEBUG - RDebug::Print( _L( "(SecUi)CSecuritySettings::RemoteLockSetLockSettingL() - EMobilePhoneSetLockSetting request returned KErrAbort" ) ); - #endif // _DEBUG - break; +#ifdef _DEBUG + RDebug::Print( _L( "(SecUi)CSecuritySettings::RemoteLockSetLockSettingL() - EMobilePhoneSetLockSetting request returned KErrAbort" ) ); +#endif // _DEBUG + break; default: - #ifdef _DEBUG - RDebug::Print( _L( "(SecUi)CSecuritySettings::RemoteLockSetLockSettingL() - EMobilePhoneSetLockSetting request returned: %d"), retValue ); - #endif // _DEBUG - break; +#ifdef _DEBUG + RDebug::Print( _L( "(SecUi)CSecuritySettings::RemoteLockSetLockSettingL() - EMobilePhoneSetLockSetting request returned: %d"), retValue ); +#endif // _DEBUG + break; } - #ifdef _DEBUG +#ifdef _DEBUG RDebug::Print(_L("(SecUi)CSecuritySettings::RemoteLockSetLockSettingL() - Exit" ) ); - #endif // _DEBUG - +#endif // _DEBUG return retValue; - #else //! RD_REMOTELOCK +#else //! RD_REMOTELOCK return KErrNotSupported; - #endif //RD_REMOTELOCK +#endif //RD_REMOTELOCK } - - // // ---------------------------------------------------------- // CSecuritySettings::ChangeSimSecurityL() @@ -750,47 +743,47 @@ // ---------------------------------------------------------- // qtdone EXPORT_C TBool CSecuritySettings::ChangeSimSecurityL() - { + { /***************************************************** - * Series 60 Customer / ETel - * Series 60 ETel API - *****************************************************/ - #if defined(_DEBUG) + * Series 60 Customer / ETel + * Series 60 ETel API + *****************************************************/ +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeSimSecurityL()")); - #endif +#endif RMobilePhone::TMobilePhoneLockInfoV1 lockInfo; RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo); RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockPhoneToICC; RMobilePhone::TMobilePhoneLockSetting lockChangeSetting; - + //get lock info iWait->SetRequestType(EMobilePhoneGetLockInfo); - RDEBUG( "GetLockInfo", 0 ); + RDEBUG("GetLockInfo", 0); iPhone.GetLockInfo(iWait->iStatus, lockType, lockInfoPkg); - RDEBUG( "WaitForRequestL", 0 ); + RDEBUG("WaitForRequestL", 0); TInt status = iWait->WaitForRequestL(); - RDEBUG( "WaitForRequestL status", status ); + RDEBUG("WaitForRequestL status", status); - #ifdef __WINS__ - if (status == KErrTimedOut) - { - lockInfo.iSetting = RMobilePhone::ELockSetDisabled; - status = KErrNone; - } - #endif +#ifdef __WINS__ + if (status == KErrNotSupported || status == KErrTimedOut) + { + lockInfo.iSetting = RMobilePhone::ELockSetDisabled; + status = KErrNone; + } +#endif User::LeaveIfError(status); TInt currentItem = 0; if (lockInfo.iSetting == RMobilePhone::ELockSetDisabled) { - #if defined(_DEBUG) +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeSimSecurityL()lockInfo: ELockSetDisabled")); - #endif - currentItem = 1; // off +#endif + currentItem = 1; // off } - - if (currentItem == 0) // switch the flag + + if (currentItem == 0) // switch the flag { lockChangeSetting = RMobilePhone::ELockSetDisabled; } @@ -798,36 +791,37 @@ { lockChangeSetting = RMobilePhone::ELockSetEnabled; } - RDEBUG( "lockChangeSetting", lockChangeSetting ); - + RDEBUG("lockChangeSetting", lockChangeSetting); + iWait->SetRequestType(EMobilePhoneSetLockSetting); - RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, ESecurityUIsQueryRequestOk); - RDEBUG( "SetLockSetting", 0 ); - iPhone.SetLockSetting(iWait->iStatus,lockType,lockChangeSetting); // this invokes the handler - RDEBUG( "WaitForRequestL", 0 ); + RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, + ESecurityUIsQueryRequestOk); + RDEBUG("SetLockSetting", 0); + iPhone.SetLockSetting(iWait->iStatus, lockType, lockChangeSetting); // this invokes the handler + RDEBUG("WaitForRequestL", 0); status = iWait->WaitForRequestL(); - RDEBUG( "WaitForRequestL status", status ); - #ifdef __WINS__ - if (status == KErrNotSupported) - status = KErrNone; - #endif + RDEBUG("WaitForRequestL status", status); +#ifdef __WINS__ + if (status == KErrNotSupported || status == KErrTimedOut) + status = KErrNone; +#endif - // the error was displayed in the handler - #if defined(_DEBUG) + // the error was displayed in the handler +#if defined(_DEBUG) RDebug::Print( _L("(SECUI)CSecuritySettings::ChangeSimSecurityL(): RETURN CODE: %d"), status); - #endif - switch(status) +#endif + switch (status) { case KErrNone: { break; - } + } case KErrGsm0707IncorrectPassword: case KErrAccessDenied: - { + { // code was entered erroneously return ChangeSimSecurityL(); - } + } case KErrGsmSSPasswordAttemptsViolation: case KErrLocked: { @@ -843,7 +837,7 @@ return ChangeSimSecurityL(); } } - + return ETrue; } // @@ -853,18 +847,20 @@ // ---------------------------------------------------------- // qtdone EXPORT_C TBool CSecuritySettings::ChangePinRequestL() - { - RDEBUG( "0", 0 ); - + { + RDEBUG("0", 0); + RMobilePhone::TMobilePassword iOldPassword; - TInt iFlags=0; - iOldPassword.Copy(_L("")); + TInt iFlags = 0; + iOldPassword.Copy(_L("")); TBuf<0x80> iCaption; iCaption.Copy(_L("ChangePinRequestL")); - TInt iShowError=1; - ChangePinRequestParamsL(1/* TODO it's imposible to know if we want to set or clear*/, iOldPassword, iFlags, iCaption, iShowError); - RDEBUG( "0", 0 ); + TInt iShowError = 1; + ChangePinRequestParamsL( + 1/* TODO it's imposible to know if we want to set or clear*/, + iOldPassword, iFlags, iCaption, iShowError); + RDEBUG("0", 0); return ETrue; } @@ -877,94 +873,99 @@ // qtdone EXPORT_C TBool CSecuritySettings::ChangeUPinRequestL() { - TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma )); - TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin )); - if(wcdmaSupported || upinSupported) - { - #if defined(_DEBUG) + TBool wcdmaSupported( + FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma)); + TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin)); + if (wcdmaSupported || upinSupported) + { +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeUPinRequestL()")); - #endif - +#endif + TInt simState; - TInt err( KErrGeneral ); + TInt err(KErrGeneral); err = RProperty::Get(KPSUidStartup, KPSSimStatus, simState); - User::LeaveIfError( err ); + User::LeaveIfError(err); TBool simRemoved(simState == ESimNotPresent); - - if ( simRemoved ) + + if (simRemoved) { ShowResultNoteL(R_INSERT_SIM, CAknNoteDialog::EErrorTone); return EFalse; } - + RMobilePhone::TMobilePhoneLockInfoV1 lockInfo; RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo); - RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockUniversalPin; - - RMobilePhone::TMobilePhoneLockSetting lockChangeSetting = RMobilePhone::ELockSetDisabled; - + RMobilePhone::TMobilePhoneLock lockType = + RMobilePhone::ELockUniversalPin; + + RMobilePhone::TMobilePhoneLockSetting lockChangeSetting = + RMobilePhone::ELockSetDisabled; + //get lock info iWait->SetRequestType(EMobilePhoneGetLockInfo); - RDEBUG( "GetLockInfo", 0 ); + RDEBUG("GetLockInfo", 0); iPhone.GetLockInfo(iWait->iStatus, lockType, lockInfoPkg); - RDEBUG( "WaitForRequestL", 0 ); + RDEBUG("WaitForRequestL", 0); TInt status = iWait->WaitForRequestL(); - RDEBUG( "WaitForRequestL status", status ); - #ifdef __WINS__ - if (status == KErrNotSupported) - status = KErrNone; - #endif - User::LeaveIfError(status); + RDEBUG("WaitForRequestL status", status); +#ifdef __WINS__ + if (status == KErrNotSupported || status == KErrTimedOut) + status = KErrNone; +#endif + User::LeaveIfError(status); TInt currentItem = 0; - - #if defined(_DEBUG) + +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeUPinRequestL() GetLockInfo")); - #endif - +#endif + if (lockInfo.iSetting == RMobilePhone::ELockSetDisabled) { - #if defined(_DEBUG) +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeUPinRequestL() lockInfo: ELockSetDisabled")); - #endif - currentItem = 1; // off +#endif + currentItem = 1; // off } - - if (currentItem == 0) // switch the flag + if (currentItem == 0) // switch the flag { - #if defined(_DEBUG) +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeUPinRequestL() currentItem: ELockSetDisabled")); - #endif +#endif lockChangeSetting = RMobilePhone::ELockSetDisabled; } else { - #if defined(_DEBUG) +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeUPinRequestL() currentItem: ELockSetEnabled")); - #endif +#endif lockChangeSetting = RMobilePhone::ELockSetEnabled; } - + // Raise a flag to indicate that the UPIN // request coming from ETEL has originated from SecUi and not from Engine. - RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsSecUIOriginated); + RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, + ESecurityUIsSecUIOriginated); // Change the lock setting iWait->SetRequestType(EMobilePhoneSetLockSetting); - RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, ESecurityUIsQueryRequestOk); - RDEBUG( "SetLockSetting", 0 ); - iPhone.SetLockSetting(iWait->iStatus,lockType,lockChangeSetting); // this calls something in the handler - RDEBUG( "WaitForRequestL", 0 ); + RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, + ESecurityUIsQueryRequestOk); + RDEBUG("SetLockSetting", 0); + iPhone.SetLockSetting(iWait->iStatus, lockType, lockChangeSetting); // this calls something in the handler + RDEBUG("WaitForRequestL", 0); status = iWait->WaitForRequestL(); - RDEBUG( "WaitForRequestL status", status ); + RDEBUG("WaitForRequestL status", status); // Lower the flag - RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsETelAPIOriginated); - #ifdef __WINS__ - if (status == KErrNotSupported) - status = KErrNone; - #endif + RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, + ESecurityUIsETelAPIOriginated); +#ifdef __WINS__ + if (status == KErrNotSupported || status == KErrTimedOut) + status = KErrNone; +#endif // no need to show errors because they were displayed in the Handler - switch(status) + switch (status) { case KErrNone: { @@ -973,15 +974,16 @@ case KErrGsm0707OperationNotAllowed: { // not allowed with this sim - ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone); + ShowResultNoteL(R_OPERATION_NOT_ALLOWED, + CAknNoteDialog::EErrorTone); return EFalse; } case KErrGsm0707IncorrectPassword: case KErrAccessDenied: - { + { // code was entered erroneously return ChangeUPinRequestL(); - } + } case KErrGsmSSPasswordAttemptsViolation: case KErrLocked: { @@ -997,9 +999,9 @@ return ChangeUPinRequestL(); } } - + return ETrue; - } + } else return EFalse; @@ -1012,140 +1014,145 @@ // ---------------------------------------------------------- // qtdone EXPORT_C TBool CSecuritySettings::SwitchPinCodesL() - { - TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma )); - TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin )); - if(wcdmaSupported || upinSupported) - { - #if defined(_DEBUG) + { + TBool wcdmaSupported( + FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma)); + TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin)); + if (wcdmaSupported || upinSupported) + { +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecuritySettings::SwitchPinCodesL()")); - #endif - +#endif + // If we are in simless offline mode the PIN codes can't obviously be switched TInt simState; - TInt err( KErrGeneral ); - err = RProperty::Get(KPSUidStartup, KPSSimStatus, simState); - User::LeaveIfError( err ); + TInt err(KErrGeneral); + err = RProperty::Get(KPSUidStartup, KPSSimStatus, simState); + User::LeaveIfError(err); TBool simRemoved(simState == ESimNotPresent); - - if ( simRemoved ) + + if (simRemoved) { ShowResultNoteL(R_INSERT_SIM, CAknNoteDialog::EErrorTone); return EFalse; } - - - RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockUniversalPin; - RMobilePhone::TMobilePhoneLockSetting lockChangeSetting = RMobilePhone::ELockReplaced; + + RMobilePhone::TMobilePhoneLock lockType = + RMobilePhone::ELockUniversalPin; + RMobilePhone::TMobilePhoneLockSetting lockChangeSetting = + RMobilePhone::ELockReplaced; RMobilePhone::TMobilePhoneSecurityCode activeCode; - + iCustomPhone.GetActivePin(activeCode); - - RMobilePhone::TMobilePhoneLockInfoV1 lockInfo; + + RMobilePhone::TMobilePhoneLockInfoV1 lockInfo; RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo); - #if defined(_DEBUG) +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecuritySettings::SwitchPinCodesL() GetLockInfo")); - #endif +#endif iWait->SetRequestType(EMobilePhoneGetLockInfo); - + if (activeCode == RMobilePhone::ESecurityUniversalPin) { - lockType = RMobilePhone::ELockUniversalPin; - iPhone.GetLockInfo(iWait->iStatus, lockType, lockInfoPkg); - RDEBUG( "WaitForRequestL", 0 ); - TInt res = iWait->WaitForRequestL(); - RDEBUG( "WaitForRequestL res", res ); - #ifdef __WINS__ - if (res == KErrNotSupported) - res = KErrNone; - #endif - User::LeaveIfError(res); + lockType = RMobilePhone::ELockUniversalPin; + iPhone.GetLockInfo(iWait->iStatus, lockType, lockInfoPkg); + RDEBUG("WaitForRequestL", 0); + TInt res = iWait->WaitForRequestL(); + RDEBUG("WaitForRequestL res", res); +#ifdef __WINS__ + if (res == KErrNotSupported || res == KErrTimedOut) + res = KErrNone; +#endif + User::LeaveIfError(res); } else { - lockType = RMobilePhone::ELockICC; - iPhone.GetLockInfo(iWait->iStatus, lockType, lockInfoPkg); - RDEBUG( "WaitForRequestL", 0 ); - TInt res = iWait->WaitForRequestL(); - RDEBUG( "WaitForRequestL res", res ); - #ifdef __WINS__ - if (res == KErrNotSupported) - res = KErrNone; - #endif - User::LeaveIfError(res); + lockType = RMobilePhone::ELockICC; + iPhone.GetLockInfo(iWait->iStatus, lockType, lockInfoPkg); + RDEBUG("WaitForRequestL", 0); + TInt res = iWait->WaitForRequestL(); + RDEBUG("WaitForRequestL res", res); +#ifdef __WINS__ + if (res == KErrNotSupported || res == KErrTimedOut) + res = KErrNone; +#endif + User::LeaveIfError(res); } - + // code request must be ON to change active code. if (lockInfo.iSetting == RMobilePhone::ELockSetDisabled) - { - #if defined(_DEBUG) + { +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecuritySettings::SwitchPinCodesL() CODE REQ NOT ON.")); - #endif +#endif if (activeCode != RMobilePhone::ESecurityUniversalPin) { - ShowResultNoteL(R_UPIN_NOT_ALLOWED, CAknNoteDialog::EErrorTone); + ShowResultNoteL(R_UPIN_NOT_ALLOWED, + CAknNoteDialog::EErrorTone); } else { ShowResultNoteL(R_PIN_NOT_ALLOWED, CAknNoteDialog::EErrorTone); } - #if defined(_DEBUG) +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecuritySettings::SwitchPinCodesL() CODE REQ NOT ON NOTE END.")); - #endif +#endif return EFalse; } - + iCustomPhone.GetActivePin(activeCode); TInt currentItem = 0; - - #if defined(_DEBUG) + +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecuritySettings::SwitchPinCodesL() GetLockInfo")); - #endif - +#endif + if (activeCode == RMobilePhone::ESecurityUniversalPin) { - #if defined(_DEBUG) +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecuritySettings::SwitchPinCodesL() active code: UPIN")); - #endif - currentItem = 1; // UPIN +#endif + currentItem = 1; // UPIN } - if (currentItem == 0) // switch the flag + if (currentItem == 0) // switch the flag { - #if defined(_DEBUG) +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecuritySettings::SwitchPinCodesL() currentItem: UPIN")); - #endif +#endif lockType = RMobilePhone::ELockUniversalPin; } else { - #if defined(_DEBUG) +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecuritySettings::SwitchPinCodesL() currentItem: PIN1")); - #endif +#endif lockType = RMobilePhone::ELockICC; } - + // Raise a flag to indicate that the code // request coming from ETEL has originated from SecUi and not from Engine. - RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsSecUIOriginated); + RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, + ESecurityUIsSecUIOriginated); // Change the lock setting iWait->SetRequestType(EMobilePhoneSetLockSetting); - RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, ESecurityUIsQueryRequestOk); - RDEBUG( "SetLockSetting", 0 ); - iPhone.SetLockSetting(iWait->iStatus,lockType,lockChangeSetting); // request from handler - RDEBUG( "WaitForRequestL", 0 ); + RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, + ESecurityUIsQueryRequestOk); + RDEBUG("SetLockSetting", 0); + iPhone.SetLockSetting(iWait->iStatus, lockType, lockChangeSetting); // request from handler + RDEBUG("WaitForRequestL", 0); TInt status = iWait->WaitForRequestL(); - RDEBUG( "WaitForRequestL status", status ); + RDEBUG("WaitForRequestL status", status); // Lower the flag - RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsETelAPIOriginated); - #ifdef __WINS__ - if (status == KErrNotSupported) - status = KErrNone; - #endif + RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, + ESecurityUIsETelAPIOriginated); +#ifdef __WINS__ + if (status == KErrNotSupported || status == KErrTimedOut) + status = KErrNone; +#endif - - // errors are shown in the handler - switch(status) + // errors are shown in the handler + switch (status) { case KErrNone: { @@ -1154,15 +1161,16 @@ case KErrGsm0707OperationNotAllowed: { // not allowed with this sim - ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone); + ShowResultNoteL(R_OPERATION_NOT_ALLOWED, + CAknNoteDialog::EErrorTone); return EFalse; } case KErrGsm0707IncorrectPassword: case KErrAccessDenied: - { + { // code was entered erroneously return SwitchPinCodesL(); - } + } case KErrGsmSSPasswordAttemptsViolation: case KErrLocked: { @@ -1178,9 +1186,9 @@ return SwitchPinCodesL(); } } - + return ETrue; - } + } else return EFalse; } @@ -1191,28 +1199,29 @@ // Return is lock enabled/disabled // ---------------------------------------------------------- // qtdone -EXPORT_C TBool CSecuritySettings::IsLockEnabledL(RMobilePhone::TMobilePhoneLock aLockType) +EXPORT_C TBool CSecuritySettings::IsLockEnabledL( + RMobilePhone::TMobilePhoneLock aLockType) { - TBool ret=EFalse; + TBool ret = EFalse; RMobilePhone::TMobilePhoneLockInfoV1 lockInfo; //get lock info RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo); iWait->SetRequestType(EMobilePhoneGetLockInfo); - RDEBUG( "GetLockInfo", 0 ); + RDEBUG("GetLockInfo", 0); iPhone.GetLockInfo(iWait->iStatus, aLockType, lockInfoPkg); - RDEBUG( "WaitForRequestL", 0 ); + RDEBUG("WaitForRequestL", 0); TInt res = iWait->WaitForRequestL(); - RDEBUG( "WaitForRequestL res", res ); + RDEBUG("WaitForRequestL res", res); if (res != KErrNone) ret = ETrue; - //lock is enabled return true + //lock is enabled return true else if (lockInfo.iSetting == RMobilePhone::ELockSetEnabled) { - ret = ETrue; + ret = ETrue; } - RDEBUG( "ret", ret ); - return ret; + RDEBUG("ret", ret); + return ret; } // // ---------------------------------------------------------- @@ -1231,48 +1240,52 @@ // ---------------------------------------------------------- // qtdone EXPORT_C TBool CSecuritySettings::AskPin2L() - { + { /***************************************************** - * Series 60 Customer / ETel - * Series 60 ETel API - *****************************************************/ - RDEBUG( "0", 0 ); + * Series 60 Customer / ETel + * Series 60 ETel API + *****************************************************/ + RDEBUG("0", 0); TInt retPhone = 0; // check if pin2 is blocked... - RMmCustomAPI::TSecurityCodeType secCodeType = RMmCustomAPI::ESecurityCodePin2; - RMobilePhone::TMobilePhoneSecurityCode etelsecCodeType(RMobilePhone::ESecurityCodePin2); + RMmCustomAPI::TSecurityCodeType secCodeType = + RMmCustomAPI::ESecurityCodePin2; + RMobilePhone::TMobilePhoneSecurityCode etelsecCodeType( + RMobilePhone::ESecurityCodePin2); RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo; RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo); - RMobilePhone::TMobilePassword password; + RMobilePhone::TMobilePassword password; TBool isBlocked = EFalse; TInt queryAccepted = KErrCancel; //Check whether PIN2 is blocked - retPhone = iCustomPhone.IsBlocked(secCodeType,isBlocked); - - RDEBUG( "retPhone", retPhone ); - RDEBUG( "isBlocked", isBlocked ); - #ifdef __WINS__ - if (retPhone == KErrNotSupported) - retPhone = KErrNone; - #endif - if(isBlocked) + retPhone = iCustomPhone.IsBlocked(secCodeType, isBlocked); + + RDEBUG("retPhone", retPhone); + RDEBUG("isBlocked", isBlocked); +#ifdef __WINS__ + if (retPhone == KErrNotSupported || retPhone == KErrTimedOut) + retPhone = KErrNone; +#endif + if (isBlocked) return EFalse; - + if (retPhone != KErrNone) - { + { switch (retPhone) { - // PIN2 Blocked. + // PIN2 Blocked. case KErrGsm0707SIMPuk2Required: break; case KErrGsmSSPasswordAttemptsViolation: case KErrLocked: // Pin2 features blocked permanently! - ShowResultNoteL(R_PIN2_REJECTED, CAknNoteDialog::EConfirmationTone); + ShowResultNoteL(R_PIN2_REJECTED, + CAknNoteDialog::EConfirmationTone); break; case KErrGsm0707SimNotInserted: // not allowed with this sim - ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone); + ShowResultNoteL(R_OPERATION_NOT_ALLOWED, + CAknNoteDialog::EErrorTone); break; default: ShowErrorNoteL(retPhone); @@ -1281,71 +1294,82 @@ return EFalse; } iWait->SetRequestType(EMobilePhoneGetSecurityCodeInfo); - RDEBUG( "GetSecurityCodeInfo", 0 ); + RDEBUG("GetSecurityCodeInfo", 0); iPhone.GetSecurityCodeInfo(iWait->iStatus, etelsecCodeType, codeInfoPkg); - RDEBUG( "WaitForRequestL", 0 ); + RDEBUG("WaitForRequestL", 0); retPhone = iWait->WaitForRequestL(); - RDEBUG( "WaitForRequestL retPhone", retPhone ); - #ifdef __WINS__ - if (retPhone == KErrNotSupported || retPhone == KErrTimedOut) - { - retPhone = KErrNone; - codeInfo.iRemainingEntryAttempts = 3; - } - #endif + RDEBUG("WaitForRequestL retPhone", retPhone); +#ifdef __WINS__ + if (retPhone == KErrNotSupported || retPhone == KErrTimedOut) + { + retPhone = KErrNone; + codeInfo.iRemainingEntryAttempts = 3; + } +#endif User::LeaveIfError(retPhone); - - TInt attempts(codeInfo.iRemainingEntryAttempts); - RDEBUG( "attempts", attempts ); - + + RDEBUG("codeInfo.iRemainingEntryAttempts", + codeInfo.iRemainingEntryAttempts); + if (codeInfo.iRemainingEntryAttempts == KMaxNumberOfPINAttempts) + codeInfo.iRemainingEntryAttempts = -1; + // ask pin2 code - /* request PIN using QT */ - queryAccepted = KErrCancel; - CSecQueryUi *iSecQueryUi; - iSecQueryUi = CSecQueryUi::NewL(); - TBuf<0x100> title; title.Zero(); title.Append(_L("PIN2")); title.Append(_L("#")); title.AppendNum(codeInfo.iRemainingEntryAttempts); - queryAccepted = iSecQueryUi->SecQueryDialog( title, password, SEC_C_PIN_CODE_MIN_LENGTH,SEC_C_PIN_CODE_MAX_LENGTH, ESecUiAlphaNotSupported | ESecUiCancelSupported | ESecUiEmergencyNotSupported | secCodeType ); - RDEBUG( "password", 0 ); - RDebug::Print( password ); - RDEBUG( "queryAccepted", queryAccepted ); - delete iSecQueryUi; - if(queryAccepted!=KErrNone) - return EFalse; - + /* request PIN using QT */ + queryAccepted = KErrCancel; + CSecQueryUi *iSecQueryUi; + iSecQueryUi = CSecQueryUi::NewL(); + TBuf<0x100> title; + title.Zero(); + title.Append(_L("PIN2")); + title.Append(_L("#")); + title.AppendNum(codeInfo.iRemainingEntryAttempts); + queryAccepted = iSecQueryUi->SecQueryDialog(title, password, + SEC_C_PIN_CODE_MIN_LENGTH, SEC_C_PIN_CODE_MAX_LENGTH, + ESecUiAlphaNotSupported | ESecUiCancelSupported + | ESecUiEmergencyNotSupported | secCodeType); + RDEBUG("password", 0); + RDebug::Print(password); + RDEBUG("queryAccepted", queryAccepted); + delete iSecQueryUi; + if (queryAccepted != KErrNone) + return EFalse; + // verify code RMobilePhone::TMobilePassword required_fourth; iWait->SetRequestType(EMobilePhoneVerifySecurityCode); - RDEBUG( "VerifySecurityCode", 0 ); - iPhone.VerifySecurityCode(iWait->iStatus,etelsecCodeType, password, required_fourth); - RDEBUG( "WaitForRequestL", 0 ); + RDEBUG("VerifySecurityCode", 0); + iPhone.VerifySecurityCode(iWait->iStatus, etelsecCodeType, password, + required_fourth); + RDEBUG("WaitForRequestL", 0); retPhone = iWait->WaitForRequestL(); - RDEBUG( "WaitForRequestL retPhone", retPhone ); - #ifdef __WINS__ - if (retPhone == KErrNotSupported) - retPhone = KErrNone; - #endif + RDEBUG("WaitForRequestL retPhone", retPhone); +#ifdef __WINS__ + if (retPhone == KErrNotSupported) + retPhone = KErrNone; +#endif - switch(retPhone) - { + switch (retPhone) + { case KErrNone: break; case KErrGsm0707IncorrectPassword: case KErrAccessDenied: // code was entered erroneously ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone); - return AskPin2L(); + return AskPin2L(); case KErrGsm0707OperationNotAllowed: // not allowed with this sim - ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone); + ShowResultNoteL(R_OPERATION_NOT_ALLOWED, + CAknNoteDialog::EErrorTone); return EFalse; case KErrGsmSSPasswordAttemptsViolation: case KErrLocked: // code was blocked ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone); - return EFalse; + return EFalse; default: ShowErrorNoteL(retPhone); - return AskPin2L(); + return AskPin2L(); } return ETrue; @@ -1357,38 +1381,41 @@ // ---------------------------------------------------------- // not qtdone EXPORT_C void CSecuritySettings::SetFdnModeL() - { + { /***************************************************** - * Series 60 Customer / ETel - * Series 60 ETel API - *****************************************************/ - #if defined(_DEBUG) + * Series 60 Customer / ETel + * Series 60 ETel API + *****************************************************/ +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecuritySettings::SetFdnModeL()")); - #endif - RMmCustomAPI::TSecurityCodeType secCodeType = RMmCustomAPI::ESecurityCodePin2; - +#endif + RMmCustomAPI::TSecurityCodeType secCodeType = + RMmCustomAPI::ESecurityCodePin2; + TBool isBlocked = EFalse; - TInt ret = iCustomPhone.IsBlocked(secCodeType,isBlocked); - RDEBUG( "isBlocked", isBlocked ); - RDEBUG( "ret", ret ); - if(isBlocked) + TInt ret = iCustomPhone.IsBlocked(secCodeType, isBlocked); + RDEBUG("isBlocked", isBlocked); + RDEBUG("ret", ret); + if (isBlocked) return; - + if (ret != KErrNone) - { + { switch (ret) { - // PIN2 Blocked. + // PIN2 Blocked. case KErrGsm0707SIMPuk2Required: break; case KErrGsmSSPasswordAttemptsViolation: case KErrLocked: // Pin2 features blocked permanently! - ShowResultNoteL(R_PIN2_REJECTED, CAknNoteDialog::EConfirmationTone); + ShowResultNoteL(R_PIN2_REJECTED, + CAknNoteDialog::EConfirmationTone); break; case KErrGsm0707SimNotInserted: // not allowed with this sim - ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone); + ShowResultNoteL(R_OPERATION_NOT_ALLOWED, + CAknNoteDialog::EErrorTone); break; default: ShowErrorNoteL(ret); @@ -1397,42 +1424,41 @@ return; } - TInt status = KErrNone; RMobilePhone::TMobilePhoneFdnStatus fdnMode; RMobilePhone::TMobilePhoneFdnSetting fdnSet; - + iPhone.GetFdnStatus(fdnMode); - + if (fdnMode == RMobilePhone::EFdnActive) { fdnSet = RMobilePhone::EFdnSetOff; } else { - fdnSet = RMobilePhone::EFdnSetOn; + fdnSet = RMobilePhone::EFdnSetOn; } - RDEBUG( "fdnSet", fdnSet ); - // Change the FDN setting + RDEBUG("fdnSet", fdnSet); + // Change the FDN setting iWait->SetRequestType(EMobilePhoneSetFdnSetting); - RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, ESecurityUIsQueryRequestOk); - RDEBUG( "SetFdnSetting", 0 ); + RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, + ESecurityUIsQueryRequestOk); + RDEBUG("SetFdnSetting", 0); iPhone.SetFdnSetting(iWait->iStatus, fdnSet); - RDEBUG( "WaitForRequestL", 0 ); + RDEBUG("WaitForRequestL", 0); status = iWait->WaitForRequestL(); - RDEBUG( "WaitForRequestL status", status ); - #ifdef __WINS__ - if (status == KErrNotSupported) - status = KErrNone; - #endif + RDEBUG("WaitForRequestL status", status); +#ifdef __WINS__ + if (status == KErrNotSupported) + status = KErrNone; +#endif - - #if defined(_DEBUG) +#if defined(_DEBUG) RDebug::Print( _L("(SECUI)CSecuritySettings::SetFdnModeL(): RETURN CODE: %d"), status); - #endif - switch(status) - { +#endif + switch (status) + { case KErrNone: break; case KErrGsm0707IncorrectPassword: @@ -1447,28 +1473,30 @@ break; case KErrGsm0707OperationNotAllowed: // not allowed with this sim - ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone); + ShowResultNoteL(R_OPERATION_NOT_ALLOWED, + CAknNoteDialog::EErrorTone); break; default: ShowErrorNoteL(status); break; - } - } + } + } // // ---------------------------------------------------------- // CSecuritySettings::GetFndMode() // Retrieves the current Fixed Dialling Numbers mode // ---------------------------------------------------------- // qtdone -EXPORT_C TInt CSecuritySettings::GetFdnMode (RMobilePhone::TMobilePhoneFdnStatus& aFdnMode) +EXPORT_C TInt CSecuritySettings::GetFdnMode( + RMobilePhone::TMobilePhoneFdnStatus& aFdnMode) { /***************************************************** - * Series 60 Customer / ETel - * Series 60 ETel API - *****************************************************/ - #if defined(_DEBUG) + * Series 60 Customer / ETel + * Series 60 ETel API + *****************************************************/ +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecuritySettings::GetFdnMode()")); - #endif +#endif return iPhone.GetFdnStatus(aFdnMode); } @@ -1480,8 +1508,8 @@ // qtdone void CSecuritySettings::ShowErrorNoteL(TInt aError) { - RDEBUG( "aError", aError ); - + RDEBUG("aError", aError); + ShowResultNoteL(aError, CAknNoteDialog::EErrorTone); } @@ -1491,150 +1519,156 @@ // Shows result note // ---------------------------------------------------------- // qtdone -void CSecuritySettings::ShowResultNoteL(TInt aResourceID, CAknNoteDialog::TTone aTone) - { - RDEBUG( "aResourceID", aResourceID ); - +void CSecuritySettings::ShowResultNoteL(TInt aResourceID, + CAknNoteDialog::TTone aTone) + { + RDEBUG("aResourceID", aResourceID); + /* - CAknNoteDialog* noteDlg = new (ELeave) CAknNoteDialog(REINTERPRET_CAST(CEikDialog**,¬eDlg)); - noteDlg->SetTimeout(CAknNoteDialog::ELongTimeout); - noteDlg->SetTone(aTone); - noteDlg->ExecuteLD(aResourceID); - */ - CHbDeviceMessageBoxSymbian* messageBox = CHbDeviceMessageBoxSymbian::NewL(CHbDeviceMessageBoxSymbian::EWarning); + CAknNoteDialog* noteDlg = new (ELeave) CAknNoteDialog(REINTERPRET_CAST(CEikDialog**,¬eDlg)); + noteDlg->SetTimeout(CAknNoteDialog::ELongTimeout); + noteDlg->SetTone(aTone); + noteDlg->ExecuteLD(aResourceID); + */ + CHbDeviceMessageBoxSymbian* messageBox = + CHbDeviceMessageBoxSymbian::NewL( + CHbDeviceMessageBoxSymbian::EWarning); CleanupStack::PushL(messageBox); _LIT(KText, "ShowResultNoteL: "); - TBuf<0x200> title; - TBuf<0x200> titleTr; - title.Zero(); - titleTr.Zero(); - title.Append(KText); - title.AppendNum(aResourceID); + TBuf<0x200> title; + TBuf<0x200> titleTr; + title.Zero(); + titleTr.Zero(); + title.Append(KText); + title.AppendNum(aResourceID); _LIT(KSeparator, " "); - title.Append(KSeparator); - switch(aResourceID) - { - case 0: - titleTr.Append(_L("OK")); - title.Append(_L("OK")); - break; - case KErrGsm0707IncorrectPassword: - titleTr.Append(_L("KErrGsm0707IncorrectPassword")); - title.Append(_L("Incorrect Password")); - break; - case KErrAccessDenied: - titleTr.Append(_L("KErrAccessDenied")); - title.Append(_L("Access Denied")); - break; - case KErrGsmSSPasswordAttemptsViolation: - titleTr.Append(_L("KErrGsmSSPasswordAttemptsViolation")); - title.Append(_L("Password Attempts Violation")); - break; - case KErrLocked: - titleTr.Append(_L("KErrLocked")); - title.Append(_L("Locked")); - break; - case KErrGsm0707OperationNotAllowed: - titleTr.Append(_L("KErrGsm0707OperationNotAllowed")); - title.Append(_L("Operation Not Allowed")); - break; - case KErrAbort: - titleTr.Append(_L("KErrAbort")); - title.Append(_L("Abort")); - break; - case KErrNotSupported: - titleTr.Append(_L("KErrNotSupported")); - title.Append(_L("Not Supported")); - break; - case R_SEC_BLOCKED: - titleTr.Append(_L("R_SEC_BLOCKED")); - title.Append(_L("BLOCKED")); - break; - case R_CODE_ERROR: - titleTr.Append(_L("R_CODE_ERROR")); - title.Append(_L("ERROR")); - break; - case KErrGsmInvalidParameter: - titleTr.Append(_L("KErrGsmInvalidParameter")); - title.Append(_L("Invalid Parameter")); - break; - case R_CONFIRMATION_NOTE: - titleTr.Append(_L("R_CONFIRMATION_NOTE")); - title.Append(_L("CONFIRMED")); - break; - case R_CODES_DONT_MATCH: - titleTr.Append(_L("R_CODES_DONT_MATCH")); - title.Append(_L("CODES DONT MATCH")); - break; - case R_PIN_CODE_CHANGED_NOTE: - titleTr.Append(_L("R_PIN_CODE_CHANGED_NOTE")); - title.Append(_L("PIN CODE CHANGED")); - break; - case R_SECURITY_CODE_CHANGED_NOTE: - titleTr.Append(_L("R_SECURITY_CODE_CHANGED_NOTE")); - title.Append(_L("SECURITY CODE CHANGED")); - break; - case R_SECUI_TEXT_AUTOLOCK_MUST_BE_ACTIVE: - titleTr.Append(_L("R_SECUI_TEXT_AUTOLOCK_MUST_BE_ACTIVE")); - title.Append(_L("AUTOLOCK MUST BE ACTIVE")); - break; - case KErrServerTerminated: - titleTr.Append(_L("KErrServerTerminated")); - title.Append(_L("Server Terminated")); - break; - case KErrServerBusy: - titleTr.Append(_L("KErrServerBusy")); - title.Append(_L("Server Busy")); - break; - case R_PIN2_REJECTED: - titleTr.Append(_L("R_PIN2_REJECTED")); - title.Append(_L("PIN2 REJECTED")); - break; - case R_OPERATION_NOT_ALLOWED: - titleTr.Append(_L("R_OPERATION_NOT_ALLOWED")); - title.Append(_L("OPERATION NOT ALLOWED")); - break; - case R_UPIN_NOT_ALLOWED: - titleTr.Append(_L("R_UPIN_NOT_ALLOWED")); - title.Append(_L("UPIN NOT ALLOWED")); - break; - case R_PIN_NOT_ALLOWED: - titleTr.Append(_L("R_PIN_NOT_ALLOWED")); - title.Append(_L("PIN NOT ALLOWED")); - break; - case R_INSERT_SIM: - titleTr.Append(_L("R_INSERT_SIM")); - title.Append(_L("INSERT SIM")); - break; - case R_SIM_ON: - titleTr.Append(_L("R_SIM_ON")); - title.Append(_L("SIM ON")); - break; - case KErrTimedOut: - titleTr.Append(_L("KErrTimedOut")); - title.Append(_L("Timed Out")); - break; - case R_PIN2_CODE_CHANGED_NOTE: - titleTr.Append(_L("R_PIN2_CODE_CHANGED_NOTE")); - title.Append(_L("PIN2 CODE CHANGED")); - break; - case KErrArgument: - titleTr.Append(_L("KErrArgument")); - title.Append(_L("Error Argument")); - break; + title.Append(KSeparator); + switch (aResourceID) + { + case 0: + titleTr.Append(_L("OK")); + title.Append(_L("OK")); + break; + case KErrGsm0707IncorrectPassword: + titleTr.Append(_L("KErrGsm0707IncorrectPassword")); + title.Append(_L("Incorrect Password")); + break; + case KErrAccessDenied: + titleTr.Append(_L("KErrAccessDenied")); + title.Append(_L("Access Denied")); + break; + case KErrGsmSSPasswordAttemptsViolation: + titleTr.Append(_L("KErrGsmSSPasswordAttemptsViolation")); + title.Append(_L("Password Attempts Violation")); + break; + case KErrLocked: + titleTr.Append(_L("KErrLocked")); + title.Append(_L("Locked")); + break; + case KErrGsm0707OperationNotAllowed: + titleTr.Append(_L("KErrGsm0707OperationNotAllowed")); + title.Append(_L("Operation Not Allowed")); + break; + case KErrAbort: + titleTr.Append(_L("KErrAbort")); + title.Append(_L("Abort")); + break; + case KErrNotSupported: + titleTr.Append(_L("KErrNotSupported")); + title.Append(_L("Not Supported")); + break; + case R_SEC_BLOCKED: + titleTr.Append(_L("R_SEC_BLOCKED")); + title.Append(_L("BLOCKED")); + break; + case R_CODE_ERROR: + titleTr.Append(_L("R_CODE_ERROR")); + title.Append(_L("ERROR")); + break; + case KErrGsmInvalidParameter: + titleTr.Append(_L("KErrGsmInvalidParameter")); + title.Append(_L("Invalid Parameter")); + break; + case R_CONFIRMATION_NOTE: + titleTr.Append(_L("R_CONFIRMATION_NOTE")); + title.Append(_L("CONFIRMED")); + break; + case R_CODES_DONT_MATCH: + titleTr.Append(_L("R_CODES_DONT_MATCH")); + title.Append(_L("CODES DONT MATCH")); + break; + case R_PIN_CODE_CHANGED_NOTE: + titleTr.Append(_L("R_PIN_CODE_CHANGED_NOTE")); + title.Append(_L("PIN CODE CHANGED")); + break; + case R_SECURITY_CODE_CHANGED_NOTE: + titleTr.Append(_L("R_SECURITY_CODE_CHANGED_NOTE")); + title.Append(_L("SECURITY CODE CHANGED")); + break; + case R_SECUI_TEXT_AUTOLOCK_MUST_BE_ACTIVE: + titleTr.Append(_L("R_SECUI_TEXT_AUTOLOCK_MUST_BE_ACTIVE")); + title.Append(_L("AUTOLOCK MUST BE ACTIVE")); + break; + case KErrServerTerminated: + titleTr.Append(_L("KErrServerTerminated")); + title.Append(_L("Server Terminated")); + break; + case KErrServerBusy: + titleTr.Append(_L("KErrServerBusy")); + title.Append(_L("Server Busy")); + break; + case R_PIN2_REJECTED: + titleTr.Append(_L("R_PIN2_REJECTED")); + title.Append(_L("PIN2 REJECTED")); + break; + case R_OPERATION_NOT_ALLOWED: + titleTr.Append(_L("R_OPERATION_NOT_ALLOWED")); + title.Append(_L("OPERATION NOT ALLOWED")); + break; + case R_UPIN_NOT_ALLOWED: + titleTr.Append(_L("R_UPIN_NOT_ALLOWED")); + title.Append(_L("UPIN NOT ALLOWED")); + break; + case R_PIN_NOT_ALLOWED: + titleTr.Append(_L("R_PIN_NOT_ALLOWED")); + title.Append(_L("PIN NOT ALLOWED")); + break; + case R_INSERT_SIM: + titleTr.Append(_L("R_INSERT_SIM")); + title.Append(_L("INSERT SIM")); + break; + case R_SIM_ON: + titleTr.Append(_L("R_SIM_ON")); + title.Append(_L("SIM ON")); + break; + case KErrTimedOut: + titleTr.Append(_L("KErrTimedOut")); + title.Append(_L("Timed Out")); + break; + case R_PIN2_CODE_CHANGED_NOTE: + titleTr.Append(_L("R_PIN2_CODE_CHANGED_NOTE")); + title.Append(_L("PIN2 CODE CHANGED")); + break; + case KErrArgument: + titleTr.Append(_L("KErrArgument")); + title.Append(_L("Error Argument")); + break; - default: // " " - titleTr.Append(_L("Specific Error")); - title.Append(_L("Specific Error")); - break; - } - messageBox->SetTextL(title); - RDEBUG( "aResourceID", aResourceID ); - RDebug::Print( titleTr ); - + default: // " " + titleTr.Append(_L("Specific Error")); + title.Append(_L("Specific Error")); + break; + } + messageBox->SetTextL(title); + RDEBUG("aResourceID", aResourceID); + RDebug::Print(titleTr); + _LIT(KIconName, "qtg_small_smiley_wondering"); messageBox->SetIconNameL(KIconName); - // TODO use aTone for sound + if (aTone == CAknNoteDialog::EErrorTone) // another case is EConfirmationTone + { + messageBox->SetTimeout(messageBox->Timeout() * 2); // errors are displayed double time + } // use default timeout messageBox->ShowL(); @@ -1649,45 +1683,47 @@ // ---------------------------------------------------------- // qtdone EXPORT_C TBool CSecuritySettings::IsUpinSupportedL() -{ - TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma )); - TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin )); - TBool isSupported = EFalse; - if(wcdmaSupported || upinSupported) - { - #if defined(_DEBUG) + { + TBool wcdmaSupported( + FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma)); + TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin)); + TBool isSupported = EFalse; + if (wcdmaSupported || upinSupported) + { +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinSupported() BEGIN")); - #endif - +#endif + RMobilePhone::TMobilePhoneLockInfoV1 lockInfo; - + //get lock info RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo); iWait->SetRequestType(EMobilePhoneGetLockInfo); - RDEBUG( "GetLockInfo", 0 ); - iPhone.GetLockInfo(iWait->iStatus, RMobilePhone::ELockUniversalPin, lockInfoPkg); - RDEBUG( "WaitForRequestL", 0 ); + RDEBUG("GetLockInfo", 0); + iPhone.GetLockInfo(iWait->iStatus, RMobilePhone::ELockUniversalPin, + lockInfoPkg); + RDEBUG("WaitForRequestL", 0); TInt res = iWait->WaitForRequestL(); - RDEBUG( "WaitForRequestL res", res ); + RDEBUG("WaitForRequestL res", res); if ((res == KErrNotSupported) || (res == KErrGsmInvalidParameter)) - { - #if defined(_DEBUG) + { +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecuritySettings::IsUpinSupported(): NOT SUPPORTED")); - #endif +#endif isSupported = EFalse; - } + } else - { - RDEBUG( "0", 0 ); + { + RDEBUG("0", 0); - isSupported = ETrue; - } - } + isSupported = ETrue; + } + } else isSupported = EFalse; - RDEBUG( "isSupported", isSupported ); - return isSupported; -} + RDEBUG("isSupported", isSupported); + return isSupported; + } // // ---------------------------------------------------------- // CSecuritySettings::IsUpinBlocked() @@ -1695,23 +1731,24 @@ // ---------------------------------------------------------- // qtdone EXPORT_C TBool CSecuritySettings::IsUpinBlocked() -{ -TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma )); - TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin )); - if(wcdmaSupported || upinSupported) - { - RMmCustomAPI::TSecurityCodeType secCodeType; + { + TBool wcdmaSupported( + FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma)); + TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin)); + if (wcdmaSupported || upinSupported) + { + RMmCustomAPI::TSecurityCodeType secCodeType; secCodeType = RMmCustomAPI::ESecurityUniversalPin; TBool isBlocked = EFalse; - RDEBUG( "IsBlocked", 0 ); - TInt ret = iCustomPhone.IsBlocked(secCodeType,isBlocked); - RDEBUG( "ret", ret ); - RDEBUG( "isBlocked", isBlocked ); + RDEBUG("IsBlocked", 0); + TInt ret = iCustomPhone.IsBlocked(secCodeType, isBlocked); + RDEBUG("ret", ret); + RDEBUG("isBlocked", isBlocked); return isBlocked; - } + } else return EFalse; -} + } // // ---------------------------------------------------------- // CSecuritySettings::IsUpinActive() @@ -1719,214 +1756,246 @@ // ---------------------------------------------------------- // qtdone EXPORT_C TBool CSecuritySettings::IsUpinActive() -{ - TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma )); - TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin )); - if(wcdmaSupported || upinSupported) - { - RMobilePhone::TMobilePhoneSecurityCode activePin; - RDEBUG( "GetActivePin", 0 ); - iCustomPhone.GetActivePin(activePin); - RDEBUG( "activePin", activePin ); - RDEBUG( "RMobilePhone::ESecurityUniversalPin", RMobilePhone::ESecurityUniversalPin ); - if(activePin == RMobilePhone::ESecurityUniversalPin) + { + TBool wcdmaSupported( + FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma)); + TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin)); + if (wcdmaSupported || upinSupported) { - return ETrue; + RMobilePhone::TMobilePhoneSecurityCode activePin; + RDEBUG("GetActivePin", 0); + iCustomPhone.GetActivePin(activePin); + RDEBUG("activePin", activePin); + RDEBUG("RMobilePhone::ESecurityUniversalPin", + RMobilePhone::ESecurityUniversalPin); + if (activePin == RMobilePhone::ESecurityUniversalPin) + { + return ETrue; + } + return EFalse; } - return EFalse; - } else return EFalse; -} + } /**************************/ // qtdone -EXPORT_C TInt CSecuritySettings::ChangePinParamsL(RMobilePhone::TMobilePassword aOldPassword, RMobilePhone::TMobilePassword aNewPassword, TInt aFlags, TDes& aCaption, TInt aShowError) - { - RDEBUG( "aFlags", aFlags ); - RDEBUG( "aOldPassword", 0 ); - RDebug::Print(aOldPassword); - RDEBUG( "aNewPassword", 0 ); - RDebug::Print(aNewPassword); - RDEBUG( "aCaption", 0 ); - RDebug::Print(aCaption); - RDEBUG( "aShowError", aShowError ); - +EXPORT_C TInt CSecuritySettings::ChangePinParamsL( + RMobilePhone::TMobilePassword aOldPassword, + RMobilePhone::TMobilePassword aNewPassword, TInt aFlags, + TDes& aCaption, TInt aShowError) + { + RDEBUG("aFlags", aFlags); + RDEBUG("aOldPassword", 0); + RDebug::Print(aOldPassword); + RDEBUG("aNewPassword", 0); + RDebug::Print(aNewPassword); + RDEBUG("aCaption", 0); + RDebug::Print(aCaption); + RDEBUG("aShowError", aShowError); /***************************************************** - * Series 60 Customer / ETel - * Series 60 ETel API - *****************************************************/ - + * Series 60 Customer / ETel + * Series 60 ETel API + *****************************************************/ + TInt simState; - TInt err( KErrGeneral ); + TInt err(KErrGeneral); err = RProperty::Get(KPSUidStartup, KPSSimStatus, simState); - User::LeaveIfError( err ); + User::LeaveIfError(err); TBool simRemoved(simState == ESimNotPresent); - if ( simRemoved ) + if (simRemoved) { ShowResultNoteL(R_INSERT_SIM, CAknNoteDialog::EErrorTone); return KErrAccessDenied; } - #if defined(_DEBUG) +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecuritySettings::ChangePinParamsL()")); - #endif +#endif RMobilePhone::TMobilePhoneSecurityCode secCodeType; secCodeType = RMobilePhone::ESecurityCodePin1; RMobilePhone::TMobilePassword oldPassword; RMobilePhone::TMobilePassword newPassword; - RMobilePhone::TMobilePassword verifcationPassword; RMobilePhone::TMobilePhonePasswordChangeV1 passwords; RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo; RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo); - TInt queryAccepted = KErrCancel; + RMobilePhone::TMobilePassword required_fourth; + TInt queryAccepted = KErrCancel; - RDEBUG( "0", 0 ); + RDEBUG("0", 0); RMobilePhone::TMobilePhoneLock lockType; RMobilePhone::TMobilePhoneLockInfoV1 lockInfo; - + lockType = RMobilePhone::ELockICC; RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo); - RDEBUG( "0", 0 ); + RDEBUG("0", 0); iWait->SetRequestType(EMobilePhoneGetLockInfo); TInt res = KErrNone; - RDEBUG( "GetLockInfo", 0 ); + RDEBUG("GetLockInfo", 0); iPhone.GetLockInfo(iWait->iStatus, lockType, lockInfoPkg); - RDEBUG( "WaitForRequestL", 0 ); + RDEBUG("WaitForRequestL", 0); res = iWait->WaitForRequestL(); - RDEBUG( "WaitForRequestL res", res ); - #ifdef __WINS__ - if (res == KErrTimedOut) - { - lockInfo.iSetting = RMobilePhone::ELockSetEnabled; - res = KErrNone; - } - #endif + RDEBUG("WaitForRequestL res", res); +#ifdef __WINS__ + if (res == KErrTimedOut) + { + lockInfo.iSetting = RMobilePhone::ELockSetEnabled; + res = KErrNone; + } +#endif User::LeaveIfError(res); - + if (lockInfo.iSetting == RMobilePhone::ELockSetDisabled) - { - RDEBUG( "RMobilePhone::ELockSetDisabled", RMobilePhone::ELockSetDisabled ); + { + RDEBUG("RMobilePhone::ELockSetDisabled", + RMobilePhone::ELockSetDisabled); ShowResultNoteL(R_PIN_NOT_ALLOWED, CAknNoteDialog::EErrorTone); return KErrAccessDenied; } - RDEBUG( "0", 0 ); + RDEBUG("0", 0); iWait->SetRequestType(EMobilePhoneGetSecurityCodeInfo); - RDEBUG( "GetSecurityCodeInfo", 0 ); + RDEBUG("GetSecurityCodeInfo", 0); iPhone.GetSecurityCodeInfo(iWait->iStatus, secCodeType, codeInfoPkg); - RDEBUG( "WaitForRequestL", 0 ); + RDEBUG("WaitForRequestL", 0); res = iWait->WaitForRequestL(); - RDEBUG( "WaitForRequestL res", res ); - #ifdef __WINS__ - if (res == KErrNotSupported || res == KErrTimedOut) - { - res = KErrNone; - codeInfo.iRemainingEntryAttempts=KMaxNumberOfPINAttempts; - } - #endif + RDEBUG("WaitForRequestL res", res); +#ifdef __WINS__ + if (res == KErrNotSupported || res == KErrTimedOut) + { + res = KErrNone; + codeInfo.iRemainingEntryAttempts=KMaxNumberOfPINAttempts; + } +#endif User::LeaveIfError(res); - RDEBUG( "codeInfo.iRemainingEntryAttempts", codeInfo.iRemainingEntryAttempts ); - RDEBUG( "checking aOldPassword", 0 ); - if(aOldPassword.Length()==0) - { - RDEBUG( "asking aOldPassword", 0 ); - /* request PIN using QT */ - queryAccepted = KErrCancel; - CSecQueryUi *iSecQueryUi; - iSecQueryUi = CSecQueryUi::NewL(); - TBuf<0x100> title; title.Zero(); title.Append(_L("PIN1-Old")); title.Append(_L("#")); title.AppendNum(codeInfo.iRemainingEntryAttempts); - queryAccepted = iSecQueryUi->SecQueryDialog( title, oldPassword, 4, 8, ESecUiAlphaNotSupported | ESecUiCancelSupported | ESecUiEmergencyNotSupported | secCodeType ); - RDEBUG( "oldPassword", 0 ); - RDebug::Print( oldPassword ); - RDEBUG( "queryAccepted", queryAccepted ); - delete iSecQueryUi; - if( queryAccepted!=KErrNone ) - return KErrAbort; - res=1; // indicate that everything is ok - /* end request PIN using QT */ - newPassword = _L(""); - verifcationPassword = _L(""); - } - else - { - oldPassword.Copy(aOldPassword); - newPassword.Copy(aNewPassword); - verifcationPassword.Copy(aNewPassword); - } - - RDEBUG( "res", res ); - while (newPassword.Length()==0 || newPassword.CompareF(verifcationPassword) != 0) + + RDEBUG("codeInfo.iRemainingEntryAttempts", + codeInfo.iRemainingEntryAttempts); + if (codeInfo.iRemainingEntryAttempts == KMaxNumberOfPINAttempts) + codeInfo.iRemainingEntryAttempts = -1; + + RDEBUG("checking aOldPassword", 0); + if (aOldPassword.Length() == 0) { - // codes do not match -> note -> ask new pin and verification codes again - if(newPassword.Length()>0) - ShowResultNoteL(R_CODES_DONT_MATCH, CAknNoteDialog::EErrorTone); - + RDEBUG("asking aOldPassword", 0); + /* request PIN using QT */ + queryAccepted = KErrCancel; + CSecQueryUi *iSecQueryUi; + iSecQueryUi = CSecQueryUi::NewL(); + TBuf<0x100> title; + title.Zero(); + title.Append(_L("PIN1-Old")); + title.Append(_L("#")); + title.AppendNum(codeInfo.iRemainingEntryAttempts); + queryAccepted = iSecQueryUi->SecQueryDialog(title, oldPassword, + SEC_C_PIN_CODE_MIN_LENGTH, SEC_C_PIN_CODE_MAX_LENGTH, + ESecUiAlphaNotSupported | ESecUiCancelSupported + | ESecUiEmergencyNotSupported | secCodeType); + RDEBUG("oldPassword", 0); + RDebug::Print(oldPassword); + RDEBUG("queryAccepted", queryAccepted); + delete iSecQueryUi; + if (queryAccepted != KErrNone) + return KErrAbort; + /* end request PIN using QT */ + + // verify it now, so that the user doesn't need to see the error _after_ typing the new ones + RDEBUG("VerifySecurityCode", 0); + iPhone.VerifySecurityCode(iWait->iStatus, secCodeType, oldPassword, + required_fourth); + RDEBUG("WaitForRequestL", 0); + res = iWait->WaitForRequestL(); + RDEBUG("WaitForRequestL res", res); +#ifdef __WINS__ + if (res == KErrNotSupported) + res = KErrNone; +#endif + if (res != KErrNone) + { + ShowResultNoteL(res, CAknNoteDialog::EErrorTone); + return res; // TODO not sure if it's wise to exit now. + } + newPassword = _L(""); - verifcationPassword = _L(""); + } + else + { + oldPassword.Copy(aOldPassword); + newPassword.Copy(aNewPassword); + } + + RDEBUG("res", res); + while (newPassword.Length() == 0) + { + // this is not needed because the dialog won't allow to close, unless codes match + // codes do not match -> note -> ask new pin and verification codes again + // if(newPassword.Length()>0) + // ShowResultNoteL(R_CODES_DONT_MATCH, CAknNoteDialog::EErrorTone); + + newPassword = _L(""); // new pin code query - if(aOldPassword.Length()==0) // only if inout parameters are empty - { - /* request PIN using QT */ - { - queryAccepted = KErrCancel; - CSecQueryUi *iSecQueryUi; - iSecQueryUi = CSecQueryUi::NewL(); - // this queries both, and verifies itself - queryAccepted = iSecQueryUi->SecQueryDialog( _L("PIN1-New|PIN1-Ver"), newPassword, 4, 8, ESecUiAlphaNotSupported | ESecUiCancelSupported | ESecUiEmergencyNotSupported | secCodeType ); - RDEBUG( "newPassword", 1 ); - RDebug::Print( newPassword ); - RDEBUG( "queryAccepted", queryAccepted ); - delete iSecQueryUi; - if( queryAccepted!=KErrNone ) - return KErrAbort; - } - /* end request PIN using QT */ - verifcationPassword.Copy(newPassword); // just to break the while - RDEBUG( "0", 0 ); - } - } - + if (aOldPassword.Length() == 0) // only if input parameters are empty + { + queryAccepted = KErrCancel; + CSecQueryUi *iSecQueryUi; + iSecQueryUi = CSecQueryUi::NewL(); + // this queries both, and verifies itself + queryAccepted = iSecQueryUi->SecQueryDialog(_L( + "PIN1-New|PIN1-Ver"), newPassword, + SEC_C_PIN_CODE_MIN_LENGTH, SEC_C_PIN_CODE_MAX_LENGTH, + ESecUiAlphaNotSupported | ESecUiCancelSupported + | ESecUiEmergencyNotSupported | secCodeType); + RDEBUG("newPassword", 1); + RDebug::Print(newPassword); + RDEBUG("queryAccepted", queryAccepted); + delete iSecQueryUi; + if (queryAccepted != KErrNone) + return KErrAbort; + RDEBUG("0", 0); + } + } + // send code passwords.iOldPassword = oldPassword; passwords.iNewPassword = newPassword; - RDEBUG( "passwords", 0 ); - RDebug::Print( passwords.iOldPassword ); - RDebug::Print( passwords.iNewPassword ); - RDEBUG( "SetRequestType", 0 ); + RDEBUG("passwords", 0); + RDebug::Print(passwords.iOldPassword); + RDebug::Print(passwords.iNewPassword); + RDEBUG("SetRequestType", 0); iWait->SetRequestType(EMobilePhoneChangeSecurityCode); - RDEBUG( "ChangeSecurityCode", 0 ); + RDEBUG("ChangeSecurityCode", 0); iPhone.ChangeSecurityCode(iWait->iStatus, secCodeType, passwords); - RDEBUG( "WaitForRequestL", 0 ); + RDEBUG("WaitForRequestL", 0); res = iWait->WaitForRequestL(); - RDEBUG( "WaitForRequestL res", res ); - #ifdef __WINS__ - if (res == KErrNotSupported) - res = KErrNone; - #endif + RDEBUG("WaitForRequestL res", res); +#ifdef __WINS__ + if (res == KErrNotSupported) + res = KErrNone; +#endif - switch(res) + switch (res) { case KErrNone: { // code changed - ShowResultNoteL(R_PIN_CODE_CHANGED_NOTE, CAknNoteDialog::EConfirmationTone); + ShowResultNoteL(R_PIN_CODE_CHANGED_NOTE, + CAknNoteDialog::EConfirmationTone); break; - } + } case KErrGsm0707IncorrectPassword: case KErrAccessDenied: - { - // code was entered erroneously + { + // code was entered erroneously. This is strange, because it was verified before ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone); ChangePinParamsL(_L(""), _L(""), aFlags, aCaption, aShowError); break; - } + } case KErrGsmSSPasswordAttemptsViolation: case KErrLocked: { @@ -1936,7 +2005,8 @@ case KErrGsm0707OperationNotAllowed: { // not allowed with this sim - ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone); + ShowResultNoteL(R_OPERATION_NOT_ALLOWED, + CAknNoteDialog::EErrorTone); return KErrGsm0707OperationNotAllowed; } case KErrAbort: @@ -1950,187 +2020,222 @@ break; } } - return res; - } + return res; + } /*********************************************/ // qtdone -EXPORT_C TInt CSecuritySettings::ChangeUPinParamsL(RMobilePhone::TMobilePassword aOldPassword, RMobilePhone::TMobilePassword aNewPassword, TInt aFlags, TDes& aCaption, TInt aShowError) - { - RDEBUG( "aFlags", aFlags ); - - RDebug::Print(aOldPassword); - RDebug::Print(aNewPassword); - RDebug::Print(aCaption); +EXPORT_C TInt CSecuritySettings::ChangeUPinParamsL( + RMobilePhone::TMobilePassword aOldPassword, + RMobilePhone::TMobilePassword aNewPassword, TInt aFlags, + TDes& aCaption, TInt aShowError) + { + RDEBUG("aFlags", aFlags); + // the password parameters are not used + if (aOldPassword.Length() > 0) + RDebug::Print(aOldPassword); + if (aNewPassword.Length() > 0) + RDebug::Print(aNewPassword); + + if (aCaption.Length() > 0) + RDebug::Print(aCaption); + + TBool wcdmaSupported( + FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma)); + TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin)); + if (!(wcdmaSupported || upinSupported)) + { + RDEBUG("! upinSupported", upinSupported); + return KErrAccessDenied; + } + + RDEBUG("upinSupported", upinSupported); + TInt simState; + TInt err(KErrGeneral); + err = RProperty::Get(KPSUidStartup, KPSSimStatus, simState); + User::LeaveIfError(err); + TBool simRemoved(simState == ESimNotPresent); + + if (simRemoved) + { + ShowResultNoteL(R_INSERT_SIM, CAknNoteDialog::EErrorTone); + return KErrAccessDenied; + } + + RMobilePhone::TMobilePhoneSecurityCode secCodeType; + secCodeType = RMobilePhone::ESecurityUniversalPin; + + RMobilePhone::TMobilePassword oldPassword; + RMobilePhone::TMobilePassword newPassword; + RMobilePhone::TMobilePassword verifcationPassword; + RMobilePhone::TMobilePhonePasswordChangeV1 passwords; + RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo; + RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo); + RMobilePhone::TMobilePhoneLock lockType; + RMobilePhone::TMobilePhoneLockInfoV1 lockInfo; + TInt queryAccepted = KErrCancel; + + lockType = RMobilePhone::ELockUniversalPin; + + RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo); + iWait->SetRequestType(EMobilePhoneGetLockInfo); + RDEBUG("GetLockInfo", 0); + iPhone.GetLockInfo(iWait->iStatus, lockType, lockInfoPkg); + RDEBUG("WaitForRequestL", 0); + TInt res = iWait->WaitForRequestL(); + RDEBUG("WaitForRequestL res", res); +#ifdef __WINS__ + if (res == KErrNotSupported) + { + res = KErrNone; + lockInfo.iSetting = RMobilePhone::ELockSetEnabled; + } +#endif + User::LeaveIfError(res); - TBool wcdmaSupported(FeatureManager::FeatureSupported( KFeatureIdProtocolWcdma )); - TBool upinSupported(FeatureManager::FeatureSupported( KFeatureIdUpin )); - if(! (wcdmaSupported || upinSupported)) - { - RDEBUG( "! upinSupported", upinSupported ); - return KErrAccessDenied; - } + RDEBUG("lockInfo.iSetting", lockInfo.iSetting); + RDEBUG("RMobilePhone::ELockSetDisabled", RMobilePhone::ELockSetDisabled); + if (lockInfo.iSetting == RMobilePhone::ELockSetDisabled) + { + ShowResultNoteL(R_UPIN_NOT_ALLOWED, CAknNoteDialog::EErrorTone); + return KErrAccessDenied; + } + + iWait->SetRequestType(EMobilePhoneGetSecurityCodeInfo); + RDEBUG("GetSecurityCodeInfo", 0); + iPhone.GetSecurityCodeInfo(iWait->iStatus, secCodeType, codeInfoPkg); + RDEBUG("WaitForRequestL", 0); + res = iWait->WaitForRequestL(); + RDEBUG("WaitForRequestL res", res); +#ifdef __WINS__ + if (res == KErrNotSupported || res == KErrTimedOut) + { + res = KErrNone; + codeInfo.iRemainingEntryAttempts=KMaxNumberOfPINAttempts; + } +#endif + User::LeaveIfError(res); + + RDEBUG("codeInfo.iRemainingEntryAttempts", + codeInfo.iRemainingEntryAttempts); + if (codeInfo.iRemainingEntryAttempts == KMaxNumberOfPINAttempts) + codeInfo.iRemainingEntryAttempts = -1; - RDEBUG( "upinSupported", upinSupported ); - TInt simState; - TInt err( KErrGeneral ); - err = RProperty::Get(KPSUidStartup, KPSSimStatus, simState); - User::LeaveIfError( err ); - TBool simRemoved(simState == ESimNotPresent); - - if ( simRemoved ) + queryAccepted = KErrCancel; + CSecQueryUi *iSecQueryUi; + iSecQueryUi = CSecQueryUi::NewL(); + TBuf<0x100> title; + title.Zero(); + title.Append(_L("UPIN-Old")); + title.Append(_L("#")); + title.AppendNum(codeInfo.iRemainingEntryAttempts); + queryAccepted = iSecQueryUi->SecQueryDialog(title, oldPassword, + SEC_C_PIN_CODE_MIN_LENGTH, SEC_C_PIN_CODE_MAX_LENGTH, + ESecUiAlphaNotSupported | ESecUiCancelSupported + | ESecUiEmergencyNotSupported | secCodeType); + RDEBUG("oldPassword", 0); + RDebug::Print(oldPassword); + RDEBUG("queryAccepted", queryAccepted); + delete iSecQueryUi; + if (queryAccepted != KErrNone) + return KErrAbort; + res = KErrNone; // indicate that everything is ok + + { + queryAccepted = KErrCancel; + CSecQueryUi * iSecQueryUi; + iSecQueryUi = CSecQueryUi::NewL(); + // this queries both, and verifies itself + queryAccepted = iSecQueryUi->SecQueryDialog( + _L("UPIN1-New|UPIN1-Ver"), newPassword, + SEC_C_PIN_CODE_MIN_LENGTH, SEC_C_PIN_CODE_MAX_LENGTH, + ESecUiAlphaNotSupported | ESecUiCancelSupported + | ESecUiEmergencyNotSupported | secCodeType); + RDEBUG("newPassword", 0); + RDebug::Print(newPassword); + RDEBUG("queryAccepted", queryAccepted); + delete iSecQueryUi; + if (queryAccepted != KErrNone) + return KErrAbort; + } + // send code + passwords.iOldPassword = oldPassword; + passwords.iNewPassword = newPassword; + iWait->SetRequestType(EMobilePhoneChangeSecurityCode); + RDEBUG("ChangeSecurityCode", 0); + iPhone.ChangeSecurityCode(iWait->iStatus, secCodeType, passwords); + RDEBUG("WaitForRequestL", 0); + res = iWait->WaitForRequestL(); + RDEBUG("WaitForRequestL res", res); +#ifdef __WINS__ + if (res == KErrNotSupported) + res = KErrNone; +#endif + switch (res) + { + case KErrNone: { - ShowResultNoteL(R_INSERT_SIM, CAknNoteDialog::EErrorTone); - return KErrAccessDenied; - } - - RMobilePhone::TMobilePhoneSecurityCode secCodeType; - secCodeType = RMobilePhone::ESecurityUniversalPin; - - RMobilePhone::TMobilePassword oldPassword; - RMobilePhone::TMobilePassword newPassword; - RMobilePhone::TMobilePassword verifcationPassword; - RMobilePhone::TMobilePhonePasswordChangeV1 passwords; - RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo; - RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo); - RMobilePhone::TMobilePhoneLock lockType; - RMobilePhone::TMobilePhoneLockInfoV1 lockInfo; - TInt queryAccepted = KErrCancel; - - lockType = RMobilePhone::ELockUniversalPin; - - RMobilePhone::TMobilePhoneLockInfoV1Pckg lockInfoPkg(lockInfo); - iWait->SetRequestType(EMobilePhoneGetLockInfo); - RDEBUG( "GetLockInfo", 0 ); - iPhone.GetLockInfo(iWait->iStatus, lockType, lockInfoPkg); - RDEBUG( "WaitForRequestL", 0 ); - TInt res = iWait->WaitForRequestL(); - RDEBUG( "WaitForRequestL res", res ); - #ifdef __WINS__ - if (res == KErrNotSupported) - { - res = KErrNone; - lockInfo.iSetting = RMobilePhone::ELockSetEnabled; - } - #endif - User::LeaveIfError(res); - - RDEBUG( "lockInfo.iSetting", lockInfo.iSetting ); - RDEBUG( "RMobilePhone::ELockSetDisabled", RMobilePhone::ELockSetDisabled ); - if (lockInfo.iSetting == RMobilePhone::ELockSetDisabled) - { - ShowResultNoteL(R_UPIN_NOT_ALLOWED, CAknNoteDialog::EErrorTone); - return KErrAccessDenied; + // code changed + ShowResultNoteL(R_UPIN_CODE_CHANGED_NOTE, + CAknNoteDialog::EConfirmationTone); + break; } - - iWait->SetRequestType(EMobilePhoneGetSecurityCodeInfo); - RDEBUG( "GetSecurityCodeInfo", 0 ); - iPhone.GetSecurityCodeInfo(iWait->iStatus, secCodeType, codeInfoPkg); - RDEBUG( "WaitForRequestL", 0 ); - res = iWait->WaitForRequestL(); - RDEBUG( "WaitForRequestL res", res ); - #ifdef __WINS__ - if (res == KErrNotSupported || res == KErrTimedOut) - { - res = KErrNone; - codeInfo.iRemainingEntryAttempts=KMaxNumberOfPINAttempts; - } - #endif - User::LeaveIfError(res); - - /* request PIN using QT */ - queryAccepted = KErrCancel; - CSecQueryUi *iSecQueryUi; - iSecQueryUi = CSecQueryUi::NewL(); - TBuf<0x100> title; title.Zero(); title.Append(_L("UPIN-Old")); title.Append(_L("#")); title.AppendNum(codeInfo.iRemainingEntryAttempts); - queryAccepted = iSecQueryUi->SecQueryDialog( title, oldPassword, 4, 8, ESecUiAlphaNotSupported | ESecUiCancelSupported | ESecUiEmergencyNotSupported | secCodeType ); - RDEBUG( "oldPassword", 0 ); - RDebug::Print( oldPassword ); - RDEBUG( "queryAccepted", queryAccepted ); - delete iSecQueryUi; - if( queryAccepted!=KErrNone ) - return KErrAbort; - res=1; // indicate that everything is ok - - { - queryAccepted = KErrCancel; - CSecQueryUi *iSecQueryUi; - iSecQueryUi = CSecQueryUi::NewL(); - // this queries both, and verifies itself - queryAccepted = iSecQueryUi->SecQueryDialog( _L("PIN1-New|PIN1-Ver"), newPassword, 4, 8, ESecUiAlphaNotSupported | ESecUiCancelSupported | ESecUiEmergencyNotSupported | secCodeType ); - RDEBUG( "newPassword", 0 ); - RDebug::Print( newPassword ); - RDEBUG( "queryAccepted", queryAccepted ); - delete iSecQueryUi; - if( queryAccepted!=KErrNone ) - return KErrAbort; - } - // send code - passwords.iOldPassword = oldPassword; - passwords.iNewPassword = newPassword; - iWait->SetRequestType(EMobilePhoneChangeSecurityCode); - RDEBUG( "ChangeSecurityCode", 0 ); - iPhone.ChangeSecurityCode(iWait->iStatus, secCodeType, passwords); - RDEBUG( "WaitForRequestL", 0 ); - res = iWait->WaitForRequestL(); - RDEBUG( "WaitForRequestL res", res ); - #ifdef __WINS__ - if (res == KErrNotSupported) - res = KErrNone; - #endif - switch(res) + case KErrGsm0707IncorrectPassword: + case KErrAccessDenied: + { + // code was entered erroneously + ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone); + ChangeUPinParamsL(_L(""), _L(""), aFlags, aCaption, aShowError); + break; + } + case KErrGsmSSPasswordAttemptsViolation: + case KErrLocked: + { + return KErrLocked; + } + case KErrGsm0707OperationNotAllowed: { - case KErrNone: - { - // code changed - ShowResultNoteL(R_UPIN_CODE_CHANGED_NOTE, CAknNoteDialog::EConfirmationTone); - break; - } - case KErrGsm0707IncorrectPassword: - case KErrAccessDenied: - { - // code was entered erroneously - ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone); - ChangeUPinParamsL(_L(""), _L(""), aFlags, aCaption, aShowError); - break; - } - case KErrGsmSSPasswordAttemptsViolation: - case KErrLocked: - { - return KErrLocked; - } - case KErrGsm0707OperationNotAllowed: - { - // not allowed with this sim - ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone); - return KErrGsm0707OperationNotAllowed; - } - case KErrAbort: - { - break; - } - default: - { - ShowErrorNoteL(res); - ChangeUPinParamsL(_L(""), _L(""), aFlags, aCaption, aShowError); - break; - } + // not allowed with this sim + ShowResultNoteL(R_OPERATION_NOT_ALLOWED, + CAknNoteDialog::EErrorTone); + return KErrGsm0707OperationNotAllowed; + } + case KErrAbort: + { + break; } - return res; - } + default: + { + ShowErrorNoteL(res); + ChangeUPinParamsL(_L(""), _L(""), aFlags, aCaption, aShowError); + break; + } + } + return res; + } /***************************************/ // qtdone -EXPORT_C TInt CSecuritySettings::ChangePin2ParamsL(RMobilePhone::TMobilePassword aOldPassword, RMobilePhone::TMobilePassword aNewPassword, TInt aFlags, TDes& aCaption, TInt aShowError) - { - #if defined(_DEBUG) - RDebug::Print(_L("(SECUI)CSecuritySettings::ChangePin2ParamsL()")); - #endif +EXPORT_C TInt CSecuritySettings::ChangePin2ParamsL( + RMobilePhone::TMobilePassword aOldPassword, + RMobilePhone::TMobilePassword aNewPassword, TInt aFlags, + TDes& aCaption, TInt aShowError) + { + RDEBUG("aFlags", aFlags); + // the password parameters are not used + if (aOldPassword.Length() > 0) + RDebug::Print(aOldPassword); + if (aNewPassword.Length() > 0) + RDebug::Print(aNewPassword); + + if (aCaption.Length() > 0) + RDebug::Print(aCaption); + TInt simState; - TInt err( KErrGeneral ); + TInt err(KErrGeneral); err = RProperty::Get(KPSUidStartup, KPSSimStatus, simState); - User::LeaveIfError( err ); + User::LeaveIfError(err); TBool simRemoved(simState == ESimNotPresent); - if ( simRemoved ) + if (simRemoved) { ShowResultNoteL(R_INSERT_SIM, CAknNoteDialog::EErrorTone); return KErrAccessDenied; @@ -2146,22 +2251,22 @@ RMobilePhone::TMobilePhoneSecurityCodeInfoV5 codeInfo; RMobilePhone::TMobilePhoneSecurityCodeInfoV5Pckg codeInfoPkg(codeInfo); TInt queryAccepted = KErrCancel; - + // check if pin2 is blocked... TBool isBlocked = EFalse; - TInt ret = iCustomPhone.IsBlocked(secCodeType,isBlocked); - RDEBUG( "isBlocked", isBlocked ); - if(isBlocked) + TInt ret = iCustomPhone.IsBlocked(secCodeType, isBlocked); + RDEBUG("isBlocked", isBlocked); + if (isBlocked) return KErrAccessDenied; - RDEBUG( "ret", ret ); - #ifdef __WINS__ - if (ret == KErrNotSupported) - ret = KErrNone; - #endif + RDEBUG("ret", ret); +#ifdef __WINS__ + if (ret == KErrNotSupported) + ret = KErrNone; +#endif if (ret != KErrNone) - { + { switch (ret) { // PIN2 Blocked. @@ -2170,11 +2275,13 @@ case KErrGsmSSPasswordAttemptsViolation: case KErrLocked: // Pin2 features blocked permanently! - ShowResultNoteL(R_PIN2_REJECTED, CAknNoteDialog::EConfirmationTone); + ShowResultNoteL(R_PIN2_REJECTED, + CAknNoteDialog::EConfirmationTone); break; case KErrGsm0707SimNotInserted: // not allowed with this sim - ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone); + ShowResultNoteL(R_OPERATION_NOT_ALLOWED, + CAknNoteDialog::EErrorTone); break; default: ShowErrorNoteL(ret); @@ -2182,90 +2289,106 @@ } return KErrAccessDenied; } - // Security code must be changed to Etel API format // Custom API Pin1 and Pin2 have the same enum values as the Etel ones - EtelsecCodeType = (RMobilePhone::TMobilePhoneSecurityCode)secCodeType; + EtelsecCodeType = (RMobilePhone::TMobilePhoneSecurityCode) secCodeType; iWait->SetRequestType(EMobilePhoneGetSecurityCodeInfo); - RDEBUG( "GetSecurityCodeInfo", 0 ); + RDEBUG("GetSecurityCodeInfo", 0); iPhone.GetSecurityCodeInfo(iWait->iStatus, EtelsecCodeType, codeInfoPkg); - RDEBUG( "WaitForRequestL", 0 ); + RDEBUG("WaitForRequestL", 0); ret = iWait->WaitForRequestL(); - RDEBUG( "WaitForRequestL ret", ret ); - #ifdef __WINS__ - if ( ret == KErrNotSupported || ret == KErrTimedOut) - { - codeInfo.iRemainingEntryAttempts = 1; - ret = KErrNone; - } - #endif - User::LeaveIfError(ret); + RDEBUG("WaitForRequestL ret", ret); +#ifdef __WINS__ + if ( ret == KErrNotSupported || ret == KErrTimedOut) + { + codeInfo.iRemainingEntryAttempts = 1; + ret = KErrNone; + } +#endif + User::LeaveIfError(ret); + + RDEBUG("codeInfo.iRemainingEntryAttempts", + codeInfo.iRemainingEntryAttempts); + if (codeInfo.iRemainingEntryAttempts == KMaxNumberOfPINAttempts) // TODO this might be 10 + codeInfo.iRemainingEntryAttempts = -1; - /* request PIN using QT */ - queryAccepted = KErrCancel; - CSecQueryUi *iSecQueryUi; - iSecQueryUi = CSecQueryUi::NewL(); - TBuf<0x100> title; title.Zero(); title.Append(_L("PIN2-Old")); title.Append(_L("#")); title.AppendNum(codeInfo.iRemainingEntryAttempts); - queryAccepted = iSecQueryUi->SecQueryDialog( title, oldPassword, SEC_C_PIN2_CODE_MIN_LENGTH, SEC_C_PIN2_CODE_MAX_LENGTH, ESecUiAlphaNotSupported | ESecUiCancelSupported | ESecUiEmergencyNotSupported | secCodeType ); - RDEBUG( "oldPassword", 0 ); - RDebug::Print( oldPassword ); - RDEBUG( "queryAccepted", queryAccepted ); - delete iSecQueryUi; - if( queryAccepted!=KErrNone ) - return KErrAbort; - /* end request PIN using QT */ + /* request PIN using QT */ + queryAccepted = KErrCancel; + CSecQueryUi *iSecQueryUi; + iSecQueryUi = CSecQueryUi::NewL(); + TBuf<0x100> title; + title.Zero(); + title.Append(_L("PIN2-Old")); + title.Append(_L("#")); + title.AppendNum(codeInfo.iRemainingEntryAttempts); + queryAccepted = iSecQueryUi->SecQueryDialog(title, oldPassword, + SEC_C_PIN2_CODE_MIN_LENGTH, SEC_C_PIN2_CODE_MAX_LENGTH, + ESecUiAlphaNotSupported | ESecUiCancelSupported + | ESecUiEmergencyNotSupported | secCodeType); + RDEBUG("oldPassword", 0); + RDebug::Print(oldPassword); + RDEBUG("queryAccepted", queryAccepted); + delete iSecQueryUi; + if (queryAccepted != KErrNone) + return KErrAbort; + /* end request PIN using QT */ - /* request PIN using QT */ - { - queryAccepted = KErrCancel; - CSecQueryUi *iSecQueryUi; - iSecQueryUi = CSecQueryUi::NewL(); - // this queries both, and verifies itself - queryAccepted = iSecQueryUi->SecQueryDialog( _L("PIN2-New|PIN2-Ver"), newPassword, SEC_C_PIN2_CODE_MIN_LENGTH, SEC_C_PIN2_CODE_MAX_LENGTH, ESecUiAlphaNotSupported | ESecUiCancelSupported | ESecUiEmergencyNotSupported | secCodeType ); - RDEBUG( "newPassword", 0 ); - RDebug::Print( newPassword ); - RDEBUG( "queryAccepted", queryAccepted ); - delete iSecQueryUi; - if( queryAccepted!=KErrNone ) - return KErrAbort; - } - /* end request PIN using QT */ + /* request PIN using QT */ + { + queryAccepted = KErrCancel; + CSecQueryUi * iSecQueryUi; + iSecQueryUi = CSecQueryUi::NewL(); + // this queries both, and verifies itself + queryAccepted = iSecQueryUi->SecQueryDialog(_L("PIN2-New|PIN2-Ver"), + newPassword, SEC_C_PIN2_CODE_MIN_LENGTH, + SEC_C_PIN2_CODE_MAX_LENGTH, ESecUiAlphaNotSupported + | ESecUiCancelSupported | ESecUiEmergencyNotSupported + | secCodeType); + RDEBUG("newPassword", 0); + RDebug::Print(newPassword); + RDEBUG("queryAccepted", queryAccepted); + delete iSecQueryUi; + if (queryAccepted != KErrNone) + return KErrAbort; + } + /* end request PIN using QT */ passwords.iOldPassword = oldPassword; passwords.iNewPassword = newPassword; iWait->SetRequestType(EMobilePhoneChangeSecurityCode); - RDEBUG( "ChangeSecurityCode", 0 ); - iPhone.ChangeSecurityCode(iWait->iStatus,EtelsecCodeType,passwords); - RDEBUG( "WaitForRequestL", 0 ); + RDEBUG("ChangeSecurityCode", 0); + iPhone.ChangeSecurityCode(iWait->iStatus, EtelsecCodeType, passwords); + RDEBUG("WaitForRequestL", 0); TInt res = iWait->WaitForRequestL(); - RDEBUG( "WaitForRequestL res", res ); - #ifdef __WINS__ - if (res == KErrNotSupported) - res = KErrNone; - #endif - switch(res) + RDEBUG("WaitForRequestL res", res); +#ifdef __WINS__ + if (res == KErrNotSupported) + res = KErrNone; +#endif + switch (res) { case KErrNone: { // code changed - ShowResultNoteL(R_PIN2_CODE_CHANGED_NOTE, CAknNoteDialog::EConfirmationTone); + ShowResultNoteL(R_PIN2_CODE_CHANGED_NOTE, + CAknNoteDialog::EConfirmationTone); break; - } + } case KErrGsm0707IncorrectPassword: case KErrAccessDenied: - { + { ShowResultNoteL(R_CODE_ERROR, CAknNoteDialog::EErrorTone); ChangePin2ParamsL(_L(""), _L(""), aFlags, aCaption, aShowError); break; - } + } case KErrGsmSSPasswordAttemptsViolation: case KErrLocked: { // Pin2 blocked! ShowResultNoteL(KErrLocked, CAknNoteDialog::EErrorTone); - CSecurityHandler* handler = new(ELeave) CSecurityHandler(iPhone); - CleanupStack::PushL(handler); + CSecurityHandler* handler = new (ELeave) CSecurityHandler(iPhone); + CleanupStack::PushL(handler); handler->HandleEventL(RMobilePhone::EPuk2Required); CleanupStack::PopAndDestroy(handler); // handler return KErrLocked; @@ -2273,7 +2396,8 @@ case KErrGsm0707OperationNotAllowed: { // not allowed with this sim - ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone); + ShowResultNoteL(R_OPERATION_NOT_ALLOWED, + CAknNoteDialog::EErrorTone); return KErrGsm0707OperationNotAllowed; } case KErrAbort: @@ -2287,189 +2411,202 @@ break; } } - return res; - } + return res; + } /************************************************/ // qtdone -EXPORT_C TInt CSecuritySettings::ChangeSecCodeParamsL(RMobilePhone::TMobilePassword aOldPassword, RMobilePhone::TMobilePassword aNewPassword, TInt aFlags, TDes& aCaption, TInt aShowError) - { - RDEBUG( "aFlags", aFlags ); - RDEBUG( "aShowError", aShowError ); +EXPORT_C TInt CSecuritySettings::ChangeSecCodeParamsL( + RMobilePhone::TMobilePassword aOldPassword, + RMobilePhone::TMobilePassword aNewPassword, TInt aFlags, + TDes& aCaption, TInt aShowError) + { + RDEBUG("aFlags", aFlags); + RDEBUG("aShowError", aShowError); /***************************************************** - * Series 60 Customer / ETel - * Series 60 ETel API - *****************************************************/ - #if defined(_DEBUG) + * Series 60 Customer / ETel + * Series 60 ETel API + *****************************************************/ +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeSecCodeParamsL()")); - #endif - TInt res=0; +#endif + TInt res = KErrNone; TInt queryAccepted = KErrCancel; RMobilePhone::TMobilePassword newPassword; - + RMobilePhone::TMobilePhoneSecurityCode secCodeType; secCodeType = RMobilePhone::ESecurityCodePhonePassword; RMobilePhone::TMobilePassword oldPassword; - RMobilePhone::TMobilePassword verifcationPassword; RMobilePhone::TMobilePassword required_fourth; RMobilePhone::TMobilePhonePasswordChangeV1 passwords; - if(aOldPassword.Length()==0) - { /* request PIN using QT */ - queryAccepted = KErrCancel; - CSecQueryUi *iSecQueryUi; - iSecQueryUi = CSecQueryUi::NewL(); - queryAccepted = iSecQueryUi->SecQueryDialog( _L("Lock-Old"), oldPassword, 4, 8, ESecUiAlphaSupported | ESecUiCancelSupported | ESecUiEmergencyNotSupported | secCodeType ); - RDEBUG( "oldPassword", 0 ); - RDebug::Print( oldPassword ); - RDEBUG( "queryAccepted", queryAccepted ); - delete iSecQueryUi; - if( queryAccepted!=KErrNone ) - return KErrAbort; - res=1; // indicate that everything is ok - /* end request PIN using QT */ - newPassword = _L(""); - verifcationPassword = _L(""); - } - else - { - oldPassword.Copy(aOldPassword); - newPassword.Copy(aNewPassword); - verifcationPassword.Copy(aNewPassword); - } + if (aOldPassword.Length() == 0) + { + queryAccepted = KErrCancel; + CSecQueryUi *iSecQueryUi; + iSecQueryUi = CSecQueryUi::NewL(); + queryAccepted = iSecQueryUi->SecQueryDialog(_L("Lock-Old"), + oldPassword, SEC_C_SECURITY_CODE_MIN_LENGTH, + SEC_C_SECURITY_CODE_MAX_LENGTH, ESecUiAlphaSupported + | ESecUiCancelSupported | ESecUiEmergencyNotSupported + | secCodeType); + RDEBUG("oldPassword", 0); + RDebug::Print(oldPassword); + RDEBUG("queryAccepted", queryAccepted); + delete iSecQueryUi; + if (queryAccepted != KErrNone) + return KErrAbort; + newPassword = _L(""); + } + else + { + oldPassword.Copy(aOldPassword); + newPassword.Copy(aNewPassword); + } - RDEBUG( "EMobilePhoneVerifySecurityCode", EMobilePhoneVerifySecurityCode ); - iWait->SetRequestType(EMobilePhoneVerifySecurityCode); - // check code - RDEBUG( "VerifySecurityCode", 0 ); - iPhone.VerifySecurityCode(iWait->iStatus,secCodeType, oldPassword, required_fourth); - RDEBUG( "WaitForRequestL", 0 ); + RDEBUG("EMobilePhoneVerifySecurityCode", EMobilePhoneVerifySecurityCode); + iWait->SetRequestType(EMobilePhoneVerifySecurityCode); + // check code before proceeding + RDEBUG("VerifySecurityCode", 0); + iPhone.VerifySecurityCode(iWait->iStatus, secCodeType, oldPassword, + required_fourth); + RDEBUG("WaitForRequestL", 0); res = iWait->WaitForRequestL(); - RDEBUG( "WaitForRequestL res", res ); - #ifdef __WINS__ - if (res == KErrNotSupported) - res = KErrNone; - #endif + RDEBUG("WaitForRequestL res", res); +#ifdef __WINS__ + if (res == KErrNotSupported) + res = KErrNone; +#endif - if(res!=KErrNone) - { - ShowResultNoteL(res, CAknNoteDialog::EErrorTone); - return res; - } - - while (newPassword.Length()==0 || newPassword.CompareF(verifcationPassword) != 0) - { + if (res != KErrNone) + { + ShowResultNoteL(res, CAknNoteDialog::EErrorTone); + return res; + } + + while (newPassword.Length() == 0) + { // codes do not match -> note -> ask new pin and verification codes again - if(newPassword.Length()>0) - ShowResultNoteL(R_CODES_DONT_MATCH, CAknNoteDialog::EErrorTone); + // note that this never happens because the dialog doesn't dismiss until both codes match + if (newPassword.Length() > 0) + ShowResultNoteL(R_CODES_DONT_MATCH, CAknNoteDialog::EErrorTone); - { - queryAccepted = KErrCancel; - CSecQueryUi *iSecQueryUi; - iSecQueryUi = CSecQueryUi::NewL(); - // will ask both codes and compare itself - // mix, max , is handled using TARM params, in the dialog itself - TInt lType = ESecUiAlphaNotSupported | ESecUiCancelSupported | ESecUiEmergencyNotSupported | secCodeType; - RDEBUG( "lType", lType ); - queryAccepted = iSecQueryUi->SecQueryDialog( _L("Lock-New|Lock-Verif"), newPassword, 4, 8, lType ); - RDEBUG( "newPassword", 0 ); - RDebug::Print( newPassword ); - RDEBUG( "queryAccepted", queryAccepted ); - delete iSecQueryUi; - if( queryAccepted!=KErrNone ) - return KErrAbort; - } - verifcationPassword.Copy(newPassword); // break the while + { + queryAccepted = KErrCancel; + CSecQueryUi *iSecQueryUi; + iSecQueryUi = CSecQueryUi::NewL(); + // will ask both codes and compare itself + // mix, max , alpha is handled using TARM params, in the dialog itself + TInt lType = ESecUiAlphaSupported | ESecUiCancelSupported + | ESecUiEmergencyNotSupported | secCodeType; + RDEBUG("lType", lType); + queryAccepted = iSecQueryUi->SecQueryDialog(_L( + "Lock-New|Lock-Verif"), newPassword, + SEC_C_PIN_CODE_MIN_LENGTH, SEC_C_PIN_CODE_MAX_LENGTH, + lType); + RDEBUG("newPassword", 0); + RDebug::Print(newPassword); + RDEBUG("queryAccepted", queryAccepted); + delete iSecQueryUi; + if (queryAccepted != KErrNone) + return KErrAbort; + } - } // while + } // while - // change code - RDEBUG( "res", res ); + // change code + RDEBUG("res", res); if (res == KErrNone) { passwords.iOldPassword = oldPassword; passwords.iNewPassword = newPassword; iWait->SetRequestType(EMobilePhoneChangeSecurityCode); - RDEBUG( "ChangeSecurityCode", 0 ); - iPhone.ChangeSecurityCode(iWait->iStatus,secCodeType,passwords); - RDEBUG( "WaitForRequestL", 0 ); + RDEBUG("ChangeSecurityCode", 0); + iPhone.ChangeSecurityCode(iWait->iStatus, secCodeType, passwords); + RDEBUG("WaitForRequestL", 0); res = iWait->WaitForRequestL(); - RDEBUG( "WaitForRequestL res", res ); - #ifdef __WINS__ - if (res == KErrNotSupported) - res = KErrNone; - #endif + RDEBUG("WaitForRequestL res", res); +#ifdef __WINS__ + if (res == KErrNotSupported) + res = KErrNone; +#endif - if(res==KErrNone && 1==0 ) // TODO not possible to enable because it asks code again - { - RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockPhoneDevice; - RMobilePhone::TMobilePhoneLockSetting lockChangeSetting = RMobilePhone::ELockSetEnabled; - if(oldPassword.Length()==6) - { - lockChangeSetting = RMobilePhone::ELockSetDisabled; - RDEBUG( "RMobilePhone::ELockSetDisabled", RMobilePhone::ELockSetDisabled ); - } - iWait->SetRequestType(EMobilePhoneSetLockSetting); - RDEBUG( "SetLockSetting", 0 ); - iPhone.SetLockSetting(iWait->iStatus, lockType, lockChangeSetting ); - RDEBUG( "WaitForRequestL", 0 ); - res = iWait->WaitForRequestL(); - RDEBUG( "WaitForRequestL res", res ); - #ifdef __WINS__ - if (res == KErrNotSupported) - res = KErrNone; - #endif - } + if (res == KErrNone && 1 == 0) // TODO not possible to enable because it asks code again + { + RMobilePhone::TMobilePhoneLock lockType = + RMobilePhone::ELockPhoneDevice; + RMobilePhone::TMobilePhoneLockSetting lockChangeSetting = + RMobilePhone::ELockSetEnabled; + if (oldPassword.Length() == 6) + { + lockChangeSetting = RMobilePhone::ELockSetDisabled; + RDEBUG("RMobilePhone::ELockSetDisabled", + RMobilePhone::ELockSetDisabled); + } + iWait->SetRequestType(EMobilePhoneSetLockSetting); + RDEBUG("SetLockSetting", 0); + iPhone.SetLockSetting(iWait->iStatus, lockType, lockChangeSetting); + RDEBUG("WaitForRequestL", 0); + res = iWait->WaitForRequestL(); + RDEBUG("WaitForRequestL res", res); +#ifdef __WINS__ + if (res == KErrNotSupported || res == KErrTimedOut) + res = KErrNone; +#endif + } } - - RDEBUG( "res", res ); - switch(res) + + RDEBUG("res", res); + switch (res) { case KErrNone: { // code changed - ShowResultNoteL(R_SECURITY_CODE_CHANGED_NOTE, CAknNoteDialog::EConfirmationTone); - { - // Send the changed code to the SCP server, even with device lock enhancements. - RDEBUG( "scpClient.Connect", 0 ); - RSCPClient scpClient; - TSCPSecCode newCode; - TSCPSecCode oldPassword; - newCode.Copy( newPassword ); - if ( scpClient.Connect() == KErrNone ) + ShowResultNoteL(R_SECURITY_CODE_CHANGED_NOTE, + CAknNoteDialog::EConfirmationTone); { - RDEBUG( "scpClient.StoreCode", 0 ); - /* - // scpClient.StoreCode( newCode ); - RArray aFailedPolicies; - TDevicelockPolicies failedPolicy; - TInt retLockcode = KErrNone; - retLockcode = scpClient.StoreLockcode( newCode, oldPassword, aFailedPolicies ); - RDEBUG( "retLockcode", retLockcode ); - RDEBUG( "aFailedPolicies.Count()", aFailedPolicies.Count() ); - for(TInt i=0; i aFailedPolicies; + TDevicelockPolicies failedPolicy; + TInt retLockcode = KErrNone; + retLockcode = scpClient.StoreLockcode( newCode, oldPassword, aFailedPolicies ); + RDEBUG( "retLockcode", retLockcode ); + RDEBUG( "aFailedPolicies.Count()", aFailedPolicies.Count() ); + for(TInt i=0; i maxPeriodBuf; - if ( scpClient.GetParamValue( ESCPMaxAutolockPeriod, maxPeriodBuf ) == KErrNone ) + TInt maxPeriod = 0; + if (FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw )) + { + // Retrieve the current autolock period max. value from the SCP server, + // and check that the value the user + // selected is ok from the Corporate Policy point of view. + RSCPClient scpClient; + TInt ret = scpClient.Connect(); + if (ret == KErrNone) { - TLex lex( maxPeriodBuf ); - if ( ( lex.Val( maxPeriod ) == KErrNone ) && ( maxPeriod > 0 ) ) + CleanupClosePushL(scpClient); + TBuf maxPeriodBuf; + if (scpClient.GetParamValue(ESCPMaxAutolockPeriod, maxPeriodBuf) + == KErrNone) { - RDEBUG( "from SCP maxPeriod", maxPeriod ); - // nothing to do + TLex lex(maxPeriodBuf); + if ((lex.Val(maxPeriod) == KErrNone) && (maxPeriod > 0)) + { + RDEBUG("from SCP maxPeriod", maxPeriod); + // nothing to do + } + else + { + maxPeriod = 0; + RDEBUG("not from SCP maxPeriod", maxPeriod); + } } else { - maxPeriod = 0; - RDEBUG( "not from SCP maxPeriod", maxPeriod ); + RDEBUG("Failed to retrieve max period", maxPeriod); } } else { - RDEBUG( "Failed to retrieve max period", maxPeriod ); - } - } - else - { - RDEBUG( "Failed to connect to SCP", 0 ); + RDEBUG("Failed to connect to SCP", 0); + } + CleanupStack::PopAndDestroy(); // scpClient } - CleanupStack::PopAndDestroy(); // scpClient - } - RDEBUG( "maxPeriod", maxPeriod ); - if(FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw )) - { - TBool allow = ETrue; - - if ((aPeriod == 0) && (maxPeriod > 0)) - { - #if defined(_DEBUG) - RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() \ + RDEBUG("maxPeriod", maxPeriod); + if (FeatureManager::FeatureSupported(KFeatureIdSapTerminalControlFw )) + { + TBool allow = ETrue; + + if ((aPeriod == 0) && (maxPeriod > 0)) + { +#if defined(_DEBUG) + RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() \ The period: %d is not allowed by TARM; max: %d"),aPeriod, maxPeriod ); - #endif - allow = EFalse; - ShowResultNoteL(R_SECUI_TEXT_AUTOLOCK_MUST_BE_ACTIVE, CAknNoteDialog::EErrorTone); - } - if ( !allow ) - { - return ChangeAutoLockPeriodParamsL(aPeriod, aOldPassword, aFlags, aCaption, aShowError); // ask again - } - } +#endif + allow = EFalse; + ShowResultNoteL(R_SECUI_TEXT_AUTOLOCK_MUST_BE_ACTIVE, + CAknNoteDialog::EErrorTone); + } + if (!allow) + { + return ChangeAutoLockPeriodParamsL(aPeriod, aOldPassword, aFlags, + aCaption, aShowError); // ask again + } + } if (aPeriod == 0) { - #ifdef RD_REMOTELOCK +#ifdef RD_REMOTELOCK // If remote lock is enabled, don't disable the domestic OS device lock // since that would render the RemoteLock useless. @@ -2576,106 +2720,111 @@ { // Remote lock is enabled lockChange = RMobilePhone::ELockSetEnabled; - RDEBUG( "RemoteLock is enabled lockChange", lockChange ); + RDEBUG( "RemoteLock is enabled lockChange", lockChange ); } else { // Remote lock is disabled lockChange = RMobilePhone::ELockSetDisabled; - RDEBUG( "RemoteLock is disabled lockChange", lockChange ); + RDEBUG( "RemoteLock is disabled lockChange", lockChange ); } } else { // Failed to get remote lock status - RDEBUG( "Failed to get remote lock status lockChange", lockChange ); + RDEBUG( "Failed to get remote lock status lockChange", lockChange ); } delete remoteLockSettings; remoteLockSettings = NULL; - #else // not defined RD_REMOTELOCK - +#else // not defined RD_REMOTELOCK lockChange = RMobilePhone::ELockSetDisabled; - #endif // RD_REMOTELOCK +#endif // RD_REMOTELOCK } else { lockChange = RMobilePhone::ELockSetEnabled; - RDEBUG( "aPeriod != 0 lockChange", lockChange ); + RDEBUG("aPeriod != 0 lockChange", lockChange); } - iWait->SetRequestType(EMobilePhoneSetLockSetting); - RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, ESecurityUIsQueryRequestOk); - RDEBUG( "SetLockSetting", 0 ); - iPhone.SetLockSetting(iWait->iStatus,lockType,lockChange); // this eventually calls PassPhraseRequiredL - RDEBUG( "WaitForRequestL", 0 ); - TInt status = KErrNone; - status = iWait->WaitForRequestL(); - RDEBUG( "WaitForRequestL status", status ); - #ifdef __WINS__ - if (status == KErrNotSupported) - status = KErrNone; - #endif - switch(status) + iWait->SetRequestType(EMobilePhoneSetLockSetting); + RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, + ESecurityUIsQueryRequestOk); + RDEBUG("SetLockSetting", 0); + iPhone.SetLockSetting(iWait->iStatus, lockType, lockChange); // this eventually calls PassPhraseRequiredL + RDEBUG("WaitForRequestL", 0); + TInt status = KErrNone; + status = iWait->WaitForRequestL(); + RDEBUG("WaitForRequestL status", status); +#ifdef __WINS__ + if (status == KErrNotSupported || status == KErrTimedOut) + status = KErrNone; +#endif + switch (status) { case KErrNone: - #if defined(_DEBUG) +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() KErrNone")); - #endif +#endif break; case KErrGsmSSPasswordAttemptsViolation: case KErrLocked: - #if defined(_DEBUG) +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() PasswordAttemptsViolation")); - #endif - ShowResultNoteL(KErrLocked, CAknNoteDialog::EErrorTone); // the old code didn't show messages - return ChangeAutoLockPeriodParamsL(oldPeriod, aOldPassword, aFlags, aCaption, aShowError); // ask again +#endif + ShowResultNoteL(KErrLocked, CAknNoteDialog::EErrorTone); // the old code didn't show messages + return ChangeAutoLockPeriodParamsL(oldPeriod, aOldPassword, + aFlags, aCaption, aShowError); // ask again case KErrGsm0707IncorrectPassword: case KErrAccessDenied: - #if defined(_DEBUG) +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() IncorrectPassword")); - #endif +#endif // code was entered erroneously - ShowResultNoteL(KErrAccessDenied, CAknNoteDialog::EErrorTone); // the old code didn't show messages - return ChangeAutoLockPeriodParamsL(oldPeriod, aOldPassword, aFlags, aCaption, aShowError); // ask again + ShowResultNoteL(KErrAccessDenied, CAknNoteDialog::EErrorTone); // the old code didn't show messages + return ChangeAutoLockPeriodParamsL(oldPeriod, aOldPassword, + aFlags, aCaption, aShowError); // ask again case KErrAbort: // User pressed "cancel" in the code query dialog. return oldPeriod; default: - #if defined(_DEBUG) +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() default")); - #endif - ShowResultNoteL(status, CAknNoteDialog::EErrorTone); // the old code didn't show messages - return ChangeAutoLockPeriodParamsL(oldPeriod, aOldPassword, aFlags, aCaption, aShowError); // ask again +#endif + ShowResultNoteL(status, CAknNoteDialog::EErrorTone); // the old code didn't show messages + return ChangeAutoLockPeriodParamsL(oldPeriod, aOldPassword, + aFlags, aCaption, aShowError); // ask again } - #if defined(_DEBUG) +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecuritySettings::ChangeAutoLockPeriodL() END")); - #endif - return aPeriod; - } +#endif + return aPeriod; + } /*****************************/ // qtdone -EXPORT_C TInt CSecuritySettings::ChangePinRequestParamsL(TInt aEnable, RMobilePhone::TMobilePassword aOldPassword, TInt aFlags, TDes& aCaption, TInt aShowError) - { - RDEBUG( "aEnable", aEnable ); - RDEBUG( "aFlags", aFlags ); +EXPORT_C TInt CSecuritySettings::ChangePinRequestParamsL(TInt aEnable, + RMobilePhone::TMobilePassword aOldPassword, TInt aFlags, + TDes& aCaption, TInt aShowError) + { + RDEBUG("aEnable", aEnable); + RDEBUG("aFlags", aFlags); /***************************************************** - * Series 60 Customer / ETel - * Series 60 ETel API - *****************************************************/ - #if defined(_DEBUG) + * Series 60 Customer / ETel + * Series 60 ETel API + *****************************************************/ +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecuritySettings::ChangePinRequestParamsL()")); - #endif - TInt simState=0; - TInt lEnable=aEnable; - TInt err( KErrGeneral ); +#endif + TInt simState = 0; + TInt lEnable = aEnable; + TInt err(KErrGeneral); err = RProperty::Get(KPSUidStartup, KPSSimStatus, simState); - User::LeaveIfError( err ); + User::LeaveIfError(err); TBool simRemoved(simState == ESimNotPresent); - if ( simRemoved ) + if (simRemoved) { ShowResultNoteL(R_INSERT_SIM, CAknNoteDialog::EErrorTone); return EFalse; @@ -2686,79 +2835,81 @@ RMobilePhone::TMobilePhoneLock lockType = RMobilePhone::ELockICC; RMobilePhone::TMobilePhoneLockSetting lockChangeSetting; - - + //get lock info iWait->SetRequestType(EMobilePhoneGetLockInfo); iPhone.GetLockInfo(iWait->iStatus, lockType, lockInfoPkg); - RDEBUG( "WaitForRequestL", 0 ); + RDEBUG("WaitForRequestL", 0); TInt status = iWait->WaitForRequestL(); - RDEBUG( "WaitForRequestL status", status ); - #ifdef __WINS__ - if (status == KErrNotSupported) - { - lockInfo.iSetting = RMobilePhone::ELockSetDisabled; - status = KErrNone; - } - #endif - User::LeaveIfError(status); + RDEBUG("WaitForRequestL status", status); +#ifdef __WINS__ + if (status == KErrNotSupported || status == KErrTimedOut) + { + lockInfo.iSetting = RMobilePhone::ELockSetDisabled; + status = KErrNone; + } +#endif + User::LeaveIfError(status); - #if defined(_DEBUG) +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecuritySettings::ChangePinRequestParamsL() GetLockInfo")); - #endif +#endif - if(aOldPassword.Length()==0) // only if input parameters are empty - { - // switch the value. - if (lockInfo.iSetting == RMobilePhone::ELockSetDisabled) - lEnable=1; // on - else - lEnable=0; // off - } + if (aOldPassword.Length() == 0) // only if input parameters are empty + { + // switch the value. + if (lockInfo.iSetting == RMobilePhone::ELockSetDisabled) + lEnable = 1; // on + else + lEnable = 0; // off + } if (lEnable == 0) { - #if defined(_DEBUG) +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecuritySettings::ChangePinRequestParamsL() currentItem: ELockSetDisabled")); - #endif +#endif lockChangeSetting = RMobilePhone::ELockSetDisabled; } else { - #if defined(_DEBUG) +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecuritySettings::ChangePinRequestParamsL() currentItem: ELockSetEnabled")); - #endif +#endif lockChangeSetting = RMobilePhone::ELockSetEnabled; } // Raise a flag to indicate that the PIN // request coming from ETEL has originated from SecUi and not from Engine. - TInt tRet = RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsSecUIOriginated); - if ( tRet != KErrNone ) + TInt tRet = RProperty::Set(KPSUidSecurityUIs, + KSecurityUIsSecUIOriginatedQuery, ESecurityUIsSecUIOriginated); + if (tRet != KErrNone) { - #if defined(_DEBUG) +#if defined(_DEBUG) RDebug::Print(_L("(SECUI)CSecuritySettings::ChangePinRequestParamsL():\ FAILED to set the SECUI query Flag: %d"), tRet); - #endif +#endif } // Change the lock setting iWait->SetRequestType(EMobilePhoneSetLockSetting); - RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, ESecurityUIsQueryRequestOk); - RDEBUG( "SetLockSetting", 0 ); - iPhone.SetLockSetting(iWait->iStatus,lockType,lockChangeSetting); // this will trigger Pin1RequiredL - RDEBUG( "WaitForRequestL", 0 ); + RProperty::Set(KPSUidSecurityUIs, KSecurityUIsQueryRequestCancel, + ESecurityUIsQueryRequestOk); + RDEBUG("SetLockSetting", 0); + iPhone.SetLockSetting(iWait->iStatus, lockType, lockChangeSetting); // this will trigger Pin1RequiredL + RDEBUG("WaitForRequestL", 0); status = iWait->WaitForRequestL(); - RDEBUG( "WaitForRequestL status", status ); - #ifdef __WINS__ - if (status == KErrNotSupported) - status = KErrNone; - #endif + RDEBUG("WaitForRequestL status", status); +#ifdef __WINS__ + if (status == KErrNotSupported || status == KErrTimedOut) + status = KErrNone; +#endif // Lower the flag - RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, ESecurityUIsETelAPIOriginated); + RProperty::Set(KPSUidSecurityUIs, KSecurityUIsSecUIOriginatedQuery, + ESecurityUIsETelAPIOriginated); - switch(status) + switch (status) { case KErrNone: { @@ -2767,15 +2918,17 @@ case KErrGsm0707OperationNotAllowed: { // not allowed with this sim - ShowResultNoteL(R_OPERATION_NOT_ALLOWED, CAknNoteDialog::EErrorTone); + ShowResultNoteL(R_OPERATION_NOT_ALLOWED, + CAknNoteDialog::EErrorTone); return EFalse; } case KErrGsm0707IncorrectPassword: case KErrAccessDenied: - { + { // code was entered erroneously - return ChangePinRequestParamsL(aEnable, aOldPassword, aFlags, aCaption, aShowError); - } + return ChangePinRequestParamsL(aEnable, aOldPassword, aFlags, + aCaption, aShowError); + } case KErrGsmSSPasswordAttemptsViolation: case KErrLocked: { @@ -2787,11 +2940,12 @@ } default: { - return ChangePinRequestParamsL(aEnable, aOldPassword, aFlags, aCaption, aShowError); + return ChangePinRequestParamsL(aEnable, aOldPassword, aFlags, + aCaption, aShowError); } } -return ETrue; -} + return ETrue; + } // // ---------------------------------------------------------- @@ -2800,11 +2954,19 @@ // not used // ---------------------------------------------------------- // qtdone -EXPORT_C TBool CSecuritySettings::AskSecCodeParamsL(RMobilePhone::TMobilePassword &aOldPassword, TInt aFlags, TDes& aCaption, TInt aShowError) +EXPORT_C TBool CSecuritySettings::AskSecCodeParamsL( + RMobilePhone::TMobilePassword &aOldPassword, TInt aFlags, + TDes& aCaption, TInt aShowError) { - RDEBUG( "aFlags", aFlags ); - RDEBUG( "aShowError", aShowError ); - RDEBUG( "This doesn't do anything", 0 ); + RDEBUG("aFlags", aFlags); + RDEBUG("aShowError", aShowError); + RDEBUG("This doesn't do anything", 0); + RDEBUG("aFlags", aFlags); + + // the password parameters are not used + if (aOldPassword.Length() > 0) + RDebug::Print(aOldPassword); + return EFalse; } diff -r 8957df7b0072 -r 098e361762d2 securitydialogs/Securitynotifier/Src/SecurityNotifier.cpp --- a/securitydialogs/Securitynotifier/Src/SecurityNotifier.cpp Mon May 03 13:20:16 2010 +0300 +++ b/securitydialogs/Securitynotifier/Src/SecurityNotifier.cpp Fri May 14 16:43:26 2010 +0300 @@ -228,6 +228,18 @@ #if defined(_DEBUG) RDebug::Printf( "%s %s (%u) searching for autolock.exe =%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 0x0 ); #endif + + // Start Dirty and quick hack + #include // Property values + #include + _LIT_SECURITY_POLICY_PASS(KReadPolicy); + _LIT_SECURITY_POLICY_C1(KWritePolicy, ECapabilityWriteDeviceData); + int ret = RProperty::Define( KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, RProperty::EInt, KReadPolicy, KWritePolicy); + RDebug::Printf( "%s %s (%u) EAutolockOff=%x", __FILE__, __PRETTY_FUNCTION__, __LINE__, 1 ); + RProperty::Set(KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, 1); + // End Dirty and quick hack + + TApaTaskList taskList( CCoeEnv::Static()->WsSession() ); const TUid KAutolockUid = { 0x100059B5 }; TApaTask task( taskList.FindApp( KAutolockUid ) ); diff -r 8957df7b0072 -r 098e361762d2 securitydialogs/lockapp/pubsub/SecurityUIsPrivatePSKeys.h --- a/securitydialogs/lockapp/pubsub/SecurityUIsPrivatePSKeys.h Mon May 03 13:20:16 2010 +0300 +++ b/securitydialogs/lockapp/pubsub/SecurityUIsPrivatePSKeys.h Fri May 14 16:43:26 2010 +0300 @@ -48,7 +48,7 @@ /** * Used by SecUI to tell if a query request set by some ETELMM API lock setting function (i.e. SetXXXXSetting) - * has been canceled sinnce canceling the setting request does not prompt a query cancel event from ETEL. + * has been canceled since canceling the setting request does not prompt a query cancel event from ETEL. * Old Shared Data constant name: KSecUIOriginatedQuery */ const TUint32 KSecurityUIsQueryRequestCancel = 0x00000302; @@ -59,7 +59,26 @@ ESecurityUIsQueryRequestCanceled }; +/** + * Used by Autolock to tell which application has enabled/disabled the keyguard/devicelock , and at which moment. + */ +const TUint32 KSecurityUIsLockInitiatorUID = 0x00000303; +const TUint32 KSecurityUIsLockInitiatorTimeHigh = 0x00000304; +const TUint32 KSecurityUIsLockInitiatorTimeLow = 0x00000305; + +/** + * Used to tell SysAp to switch-on the lights. + */ +const TUint32 KSecurityUIsLights = 0x00000308; +enum TSecurityUIsLights + { + ESecurityUIsLightsUninitialized = 0, + ESecurityUIsLightsLockOnRequest, + ESecurityUIsLightsQueryOnRequest, + ESecurityUIsLightsLockOffRequest, + ESecurityUIsLightsLastValue + }; + #endif // SECURITYUISPRIVATEPSKEYS_H // End of File - diff -r 8957df7b0072 -r 098e361762d2 securitydialogs/lockapp/src/lockappkeyguardcontrol.cpp --- a/securitydialogs/lockapp/src/lockappkeyguardcontrol.cpp Mon May 03 13:20:16 2010 +0300 +++ b/securitydialogs/lockapp/src/lockappkeyguardcontrol.cpp Fri May 14 16:43:26 2010 +0300 @@ -28,7 +28,8 @@ #include // keyguard spesific resources #include #include -#include // publishing keyguard notes to secondary display +// this is not needed +// #include // publishing keyguard notes to secondary display #include // feature manager #include // keyguard soft buttons #include @@ -37,7 +38,7 @@ #include // #include #include -#include +// #include //#include TODO remove #include #include @@ -158,13 +159,15 @@ iKeypadLockedNote->ConstructSleepingNoteL( touchEnabled ? R_KEYLOCK_NOTE_DISPLAY_LOCK_ON_TOUCH : R_KEYLOCK_NOTE_LOCK_ON ); iKeypadLockedNote->ButtonGroupContainer().ButtonGroup()->AsControl()->DrawableWindow()->SetOrdinalPosition( 0, 2 ); - iKeypadLockedNote->PublishDialogL( EAknKeysLockedNote ); + // this is not needed + // iKeypadLockedNote->PublishDialogL( EAknKeysLockedNote ); iKeypadUnlockedNote = new (ELeave) CLockAppLockedNote(); iKeypadUnlockedNote->ConstructSleepingNoteL( touchEnabled ? R_KEYLOCK_NOTE_DISPLAY_LOCK_OFF_TOUCH : R_KEYLOCK_NOTE_LOCK_OFF ); iKeypadUnlockedNote->ButtonGroupContainer().ButtonGroup()->AsControl()->DrawableWindow()->SetOrdinalPosition( 0, 2 ); - iKeypadUnlockedNote->PublishDialogL( EAknKeysReleasedNote ); + // this is not needed + // iKeypadUnlockedNote->PublishDialogL( EAknKeysReleasedNote ); iLockedNote = new (ELeave) CLockAppLockedNote(); if ( touchEnabled ) @@ -294,8 +297,9 @@ ongoingCall = (value > EPSCTsyCallStateNone); INFO_2("CLockAppKeyguardControl::AutoActivationAllowedL - ongoingCall: %d %d", value, ongoingCall); value = 0; - RProperty::Get( KPSUidAiInformation, KActiveIdleState, value ); - idle = (value == EPSAiForeground); + // RProperty::Get( KPSUidAiInformation, KActiveIdleState, value ); + // idle = (value == EPSAiForeground); + idle = ETrue; // don't care about idle state. Phone should autolock on any UI, not only HomeSreeen. INFO_2("CLockAppKeyguardControl::AutoActivationAllowedL - idle: %d %d", value, idle); value = 0; /* This is not used any more because screensavers are removed now diff -r 8957df7b0072 -r 098e361762d2 securitydialogs/lockapp/src/lockappstatecontrol.cpp --- a/securitydialogs/lockapp/src/lockappstatecontrol.cpp Mon May 03 13:20:16 2010 +0300 +++ b/securitydialogs/lockapp/src/lockappstatecontrol.cpp Fri May 14 16:43:26 2010 +0300 @@ -35,7 +35,7 @@ #include // #include #include -#include +// #include #include "GlobalWindowPriorities.h" diff -r 8957df7b0072 -r 098e361762d2 securitydialogs/secuinotifications/secuinotificationdialogplugin/inc/secuinotificationcontentwidget.h --- a/securitydialogs/secuinotifications/secuinotificationdialogplugin/inc/secuinotificationcontentwidget.h Mon May 03 13:20:16 2010 +0300 +++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/inc/secuinotificationcontentwidget.h Fri May 14 16:43:26 2010 +0300 @@ -37,6 +37,7 @@ signals: void memorySelectionChanged(const QString &text); void codeTopChanged(const QString &text); + void codeTopContentChanged(); void codeBottomChanged(const QString &text); void but1Changed(); void but2Changed(); diff -r 8957df7b0072 -r 098e361762d2 securitydialogs/secuinotifications/secuinotificationdialogplugin/inc/secuinotificationdialog.h --- a/securitydialogs/secuinotifications/secuinotificationdialogplugin/inc/secuinotificationdialog.h Mon May 03 13:20:16 2010 +0300 +++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/inc/secuinotificationdialog.h Fri May 14 16:43:26 2010 +0300 @@ -59,6 +59,7 @@ void handleMemorySelectionChanged(const QString &text); void handleCodeTopChanged(const QString &text); void handleCodeBottomChanged(const QString &text); + void handleCodeTopContentChanged(); void saveFocusWidget(QWidget*,QWidget*); void handlebut1Changed(); void handlebut2Changed(); diff -r 8957df7b0072 -r 098e361762d2 securitydialogs/secuinotifications/secuinotificationdialogplugin/inc/secuinotificationdialogpluginkeys.h --- a/securitydialogs/secuinotifications/secuinotificationdialogplugin/inc/secuinotificationdialogpluginkeys.h Mon May 03 13:20:16 2010 +0300 +++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/inc/secuinotificationdialogpluginkeys.h Fri May 14 16:43:26 2010 +0300 @@ -39,6 +39,7 @@ const QString KCodeBottom = "codeBottom"; // not really needed because is never sent back const QString KEmergency = "emergency"; const QString KInvalidNewLockCode = "invalidNewLockCode"; +const QString KDefaultCode = "DefaultCode"; // Keys for the return values passed back to calling application const QString KResultAccepted = "accepted"; // int diff -r 8957df7b0072 -r 098e361762d2 securitydialogs/secuinotifications/secuinotificationdialogplugin/rom/secuinotificationdialogplugin.iby --- a/securitydialogs/secuinotifications/secuinotificationdialogplugin/rom/secuinotificationdialogplugin.iby Mon May 03 13:20:16 2010 +0300 +++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/rom/secuinotificationdialogplugin.iby Fri May 14 16:43:26 2010 +0300 @@ -22,4 +22,9 @@ file=ABI_DIR\UREL\secuinotificationdialogplugin.dll SHARED_LIB_DIR\secuinotificationdialogplugin.dll UNPAGED data=\epoc32\data\z\pluginstub\secuinotificationdialogplugin.qtplugin \resource\plugins\devicedialogs\secuinotificationdialogplugin.qtplugin +/* This is for testing purposes +file=ABI_DIR\UREL\SecUiTest.exe SHARED_LIB_DIR\SecUiTest.exe +data=\epoc32\data\z\resource\apps\SecUiTest.rsc \resource\apps\SecUiTest.rsc +data=\epoc32\data\z\private\10003a3f\import\apps\SecUiTest_reg.rsc \private\10003a3f\import\apps\SecUiTest_reg.rsc +*/ #endif // __SECUINOTIFICATIONDIALOGPLUGIN_IBY__ diff -r 8957df7b0072 -r 098e361762d2 securitydialogs/secuinotifications/secuinotificationdialogplugin/src/secuinotificationcontentwidget.cpp --- a/securitydialogs/secuinotifications/secuinotificationdialogplugin/src/secuinotificationcontentwidget.cpp Mon May 03 13:20:16 2010 +0300 +++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/src/secuinotificationcontentwidget.cpp Fri May 14 16:43:26 2010 +0300 @@ -39,6 +39,9 @@ #define ESecUiAlphaSupported 0x4000000 #define ESecUiAlphaNotSupported 0x0000000 +#define ESecUiSecretSupported 0x8000000 +#define ESecUiSecretNotSupported 0x0000000 + #define ESecUiMaskFlags 0xFF000000 #define ESecUiMaskType 0x00FFFFFF @@ -186,11 +189,26 @@ { qDebug() << "SecUiNotificationContentWidget::KCodeTop setUpAsLatinAlphabetOnlyEditor"; codeTop->setInputMethodHints(Qt::ImhNone); - // what about this: editorInterface.setEditorClass(HbInputEditorClassPassword); + } + if (queryType & ESecUiSecretSupported) + { + qDebug() << "SecUiNotificationContentWidget::KCodeTop ESecUiSecretSupported"; + codeTop->setEchoMode(HbLineEdit::PasswordEchoOnEdit); + // note that codeButtom is never in secret mode. This nevertheless is restricted by the caller. } qDebug() << "SecUiNotificationContentWidget::KCodeTop 3"; + codeTop->setMaxLength(lMaxLength); + + if (parameters.contains(KDefaultCode)) { + qDebug() << "SecUiNotificationContentWidget::KDefaultCode"; + QString defaultCode = parameters.value(KDefaultCode).toString(); + qDebug() << defaultCode; + codeTop->setText(defaultCode); + } + qDebug() << "SecUiNotificationContentWidget::KCodeTop 4"; + connect(codeTop, SIGNAL(textChanged(const QString &)), this, SIGNAL(codeTopChanged(const QString &))); - connect(codeTop, SIGNAL(contentsChanged(const QString &)), this, SIGNAL(codeTopChanged(const QString &))); + connect(codeTop, SIGNAL(contentsChanged()), this, SIGNAL(codeTopContentChanged())); mainLayout->addItem(codeTop); if (parameters.contains(KCodeBottom)) { @@ -225,9 +243,11 @@ connect(but1, SIGNAL(clicked()), this, SIGNAL(but1Changed())); connect(but2, SIGNAL(clicked()), this, SIGNAL(but2Changed())); connect(but3, SIGNAL(clicked()), this, SIGNAL(but3Changed())); + #if defined(_DEBUG) mainLayoutButtons->addItem(but1); mainLayoutButtons->addItem(but2); mainLayoutButtons->addItem(but3); + #endif mainLayout->addItem(mainLayoutButtons); diff -r 8957df7b0072 -r 098e361762d2 securitydialogs/secuinotifications/secuinotificationdialogplugin/src/secuinotificationdialog.cpp --- a/securitydialogs/secuinotifications/secuinotificationdialogplugin/src/secuinotificationdialog.cpp Mon May 03 13:20:16 2010 +0300 +++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/src/secuinotificationdialog.cpp Fri May 14 16:43:26 2010 +0300 @@ -37,6 +37,9 @@ #define ESecUiAlphaSupported 0x4000000 #define ESecUiAlphaNotSupported 0x0000000 +#define ESecUiSecretSupported 0x8000000 +#define ESecUiSecretNotSupported 0x0000000 + #define ESecUiMaskFlags 0xFF000000 #define ESecUiMaskType 0x00FFFFFF @@ -316,6 +319,7 @@ connect(content, SIGNAL(codeTopChanged(const QString &)), this, SLOT(handleCodeTopChanged(const QString &))); connect(content, SIGNAL(codeBottomChanged(const QString &)), this, SLOT(handleCodeBottomChanged(const QString &))); + connect(content, SIGNAL(codeTopContentChanged()), this, SLOT(handleCodeTopContentChanged())); connect(content, SIGNAL(but1Changed()), this, SLOT(handlebut1Changed())); connect(content, SIGNAL(but2Changed()), this, SLOT(handlebut2Changed())); connect(content, SIGNAL(but3Changed()), this, SLOT(handlebut3Changed())); @@ -416,6 +420,13 @@ //emit deviceDialogData(mResultMap); } +void SecUiNotificationDialog::handleCodeTopContentChanged() + { + qDebug() << "SecUiNotificationDialog::handleCodeTopContentChanged"; + qDebug() << codeTop->text(); + handleCodeTopChanged(codeTop->text()); + } + // ---------------------------------------------------------------------------- // SecUiNotificationDialog::handleCodeTopChanged() // ---------------------------------------------------------------------------- @@ -525,6 +536,7 @@ qDebug() << codeTopText; codeTopText = codeTopText + "5" ; qDebug() << "codeTopText+5"; + codeTop->setEchoMode(HbLineEdit::PasswordEchoOnEdit); qDebug() << codeTopText; codeTop->setText(codeTopText); } diff -r 8957df7b0072 -r 098e361762d2 securitydialogs/secuinotifications/secuinotificationdialogplugin/src/secuinotificationdialogplugin.cpp --- a/securitydialogs/secuinotifications/secuinotificationdialogplugin/src/secuinotificationdialogplugin.cpp Mon May 03 13:20:16 2010 +0300 +++ b/securitydialogs/secuinotifications/secuinotificationdialogplugin/src/secuinotificationdialogplugin.cpp Fri May 14 16:43:26 2010 +0300 @@ -90,7 +90,8 @@ Q_UNUSED(deviceDialogType); Q_UNUSED(parameters); - info->group = DeviceNotificationDialogGroup; // TODO this should be SecurityGroup , but it's still not available + //info->group = DeviceNotificationDialogGroup; // TODO this should be SecurityGroup , but it's still not available, Commented out by 10.1 Integration + info->group = SecurityGroup; // Added by 10.1 Integration... It's working better with this layer. info->flags = NoDeviceDialogFlags; info->priority = DefaultPriority; diff -r 8957df7b0072 -r 098e361762d2 securitysrv.pro --- a/securitysrv.pro Mon May 03 13:20:16 2010 +0300 +++ b/securitysrv.pro Fri May 14 16:43:26 2010 +0300 @@ -17,4 +17,4 @@ TEMPLATE = subdirs SUBDIRS += securitydialogs/securitydialogs.pro - +SUBDIRS += cpsecplugins/cpsecplugins.pro