--- a/fotaapplication/fotaserver/FotaEngine/SRC/fotaengstream.cpp Mon Mar 15 12:43:15 2010 +0200
+++ b/fotaapplication/fotaserver/FotaEngine/SRC/fotaengstream.cpp Wed Mar 31 23:00:03 2010 +0300
@@ -72,7 +72,7 @@
FLOG(_L("TDP2StreamBuf::ResetL() >>" ));
// Define write area (chunk)
TArea a (EWrite) ;
- TInt limitedwritearea(-1);
+ //TInt limitedwritearea(-1);
TInt chunksize = iMyWriteStream->iFotaEngineSession->iChunk.Size();
// TInt writelimit = iMyWriteStream->iWriteLimit;
/* 08-nov-06 flexible mem handling overrides this
--- a/fotaapplication/fotaserver/FotaServer/group/fotaserver.mmp Mon Mar 15 12:43:15 2010 +0200
+++ b/fotaapplication/fotaserver/FotaServer/group/fotaserver.mmp Wed Mar 31 23:00:03 2010 +0300
@@ -117,7 +117,6 @@
LIBRARY fmsclient.lib //FMS Client
LIBRARY cmmanager.lib //Connection Manager
-LIBRARY devenccommonutils.lib
LIBRARY aknnotify.lib
// #ifdef _FOTA_DEBUG
LIBRARY flogger.lib
--- a/fotaapplication/fotaserver/FotaServer/inc/DevEncController.h Mon Mar 15 12:43:15 2010 +0200
+++ b/fotaapplication/fotaserver/FotaServer/inc/DevEncController.h Wed Mar 31 23:00:03 2010 +0300
@@ -20,15 +20,14 @@
// INCLUDES
#include <e32base.h>
-#include <DevEncSession.h>
+
#include <DevEncConstants.h>
#include "DevEncProgressDlg.h"
#define KDevEncUIUid 0x2000259A
//Forward declaration
class CFotaServer;
-
-
+class CDevEncSessionBase;
class CDevEncStarterStarter;
class CDevEncProgressObserver;
@@ -62,6 +61,10 @@
TBool IsDeviceEncryptionSupportedL();
+ void LoadDevEncSessionL();
+
+ void UnloadDevEncSession();
+
void StartDecryptionL();
void StartEncryptionL();
@@ -71,7 +74,9 @@
// Data
CFotaServer* iCallback; // parent
- CDevEncSession* iEncMemorySession; // Device Encryption engine session
+ RLibrary iLibrary;
+
+ CDevEncSessionBase* iEncMemorySession; // Device Encryption engine session
CDevEncProgressObserver* iDevEncObserver; //Observer for the encryption/decryption operation
--- a/fotaapplication/fotaserver/FotaServer/inc/DevEncProgressObserver.h Mon Mar 15 12:43:15 2010 +0200
+++ b/fotaapplication/fotaserver/FotaServer/inc/DevEncProgressObserver.h Wed Mar 31 23:00:03 2010 +0300
@@ -26,7 +26,7 @@
//Forward declarations
class CDevEncController;
-class CDevEncSession;
+class CDevEncSessionBase;
class CDevEncProgressDlg;
//Constants used in this class
@@ -60,7 +60,7 @@
* @return None
*/
- void StartMonitoringL(CDevEncSession* aSession);
+ void StartMonitoringL(CDevEncSessionBase* aSession);
public: // Functions from base classes
@@ -91,7 +91,7 @@
CPeriodic* iPeriodicTimer;
//Not owned
- CDevEncSession* iEncMemorySession;
+ CDevEncSessionBase* iEncMemorySession;
};
--- a/fotaapplication/fotaserver/FotaServer/src/DevEncController.cpp Mon Mar 15 12:43:15 2010 +0200
+++ b/fotaapplication/fotaserver/FotaServer/src/DevEncController.cpp Wed Mar 31 23:00:03 2010 +0300
@@ -15,18 +15,22 @@
*
*/
+//System Include
#include <apgcli.h> // for RApaLsSession
#include <apacmdln.h> // for CApaCommandLine
#include <centralrepository.h>
#include <featmgr.h> // for checking DE feature
+#include <DevEncEngineConstants.h>
+#include <DevEncSessionBase.h> //for device encryption
+#include <DevEncProtectedPSKey.h> //for device encryption
+#include <fotaserver.rsg>
+
+//User Include
#include "DevEncController.h"
#include "FotaServer.h"
+#include "DevEncProgressObserver.h"
#include "FotaSrvDebug.h"
-#include "DevEncSession.h"
-#include <DevEncEngineConstants.h>
-#include "DevEncProgressObserver.h"
-#include <fotaserver.rsg>
-#include <DevEncProtectedPSKey.h>
+
#define __LEAVE_IF_ERROR(x) if(KErrNone!=x) {FLOG(_L("LEAVE in %s: %d"), __FILE__, __LINE__); User::Leave(x); }
// ================= MEMBER FUNCTIONS =======================
@@ -74,11 +78,16 @@
{
FLOG(_L("CDevEncController::ConstructL >>"));
- if (!IsDeviceEncryptionSupportedL())
+ if (IsDeviceEncryptionSupportedL())
{
- FLOG(_L("Device doesn't support encryption!!"));
+ LoadDevEncSessionL();
+ }
+ else
+ {
+ FLOG(_L("Device doesn't support encryption!!"));
User::Leave(KErrNotSupported);
- }
+ }
+
FLOG(_L("CDevEncController::ConstructL <<"));
}
@@ -118,12 +127,7 @@
{
FLOG(_L("CDevEncController::~CDevEncController >>"));
- if (iEncMemorySession)
- {
- iEncMemorySession->Close();
- delete iEncMemorySession;
- iEncMemorySession = NULL;
- }
+ UnloadDevEncSession();
if (iDevEncObserver)
{
@@ -134,6 +138,60 @@
FLOG(_L("CDevEncController::~CDevEncController <<"));
}
+// ----------------------------------------------------------
+// CDevEncController::LoadDevEncSessionL()
+// Loads the devenc library
+// ----------------------------------------------------------
+//
+void CDevEncController::LoadDevEncSessionL()
+ {
+ FLOG(_L("CDevEncController::LoadDevEncSessionL >> "));
+
+ if (!iEncMemorySession)
+ {
+ TInt err = iLibrary.Load(KDevEncCommonUtils);
+ if (err != KErrNone)
+ {
+ FLOG(_L("Error in finding the library... %d"), err);
+ }
+ else
+ {
+ TLibraryFunction entry = iLibrary.Lookup(1);
+
+ if (!entry)
+ {
+ FLOG(_L("Error in loading the library..."));
+ User::Leave(KErrBadLibraryEntryPoint);
+ }
+ iEncMemorySession = (CDevEncSessionBase*) entry();
+ FLOG(_L("Library is found and loaded successfully..."));
+ }
+ }
+ FLOG(_L("CDevEncController::LoadDevEncSessionL << "));
+ }
+
+// ----------------------------------------------------------
+// CDevEncController::UnloadDevEncSessionL()
+// Unloads the devenc library
+// ----------------------------------------------------------
+//
+void CDevEncController::UnloadDevEncSession()
+ {
+ FLOG(_L("CDevEncController::UnloadDevEncSession >> "));
+
+ if (iEncMemorySession)
+ {
+ delete iEncMemorySession;
+ iEncMemorySession = NULL;
+ }
+
+ if (iLibrary.Handle())
+ {
+ iLibrary.Close();
+ }
+ FLOG(_L("CDevEncController::UnloadDevEncSession << "));
+ }
+
TBool CDevEncController::NeedToDecryptL(const TDriveNumber &aDrive)
{
FLOG(_L("CDevEncController::NeedToDecryptL, drive = %d >>"), (TInt) aDrive);
@@ -152,8 +210,7 @@
User::Leave(KErrNotReady);
}
- if (!iEncMemorySession)
- iEncMemorySession = new (ELeave) CDevEncSession( aDrive );
+ iEncMemorySession->SetDrive( aDrive);
err = iEncMemorySession->Connect();
if (err != KErrNone)
@@ -181,8 +238,7 @@
#endif
iEncMemorySession->Close();
- delete iEncMemorySession; iEncMemorySession = NULL;
-
+
FLOG(_L("CDevEncController::NeedToDecrypt, ret = %d <<"), ret);
return ret;
}
@@ -217,9 +273,8 @@
TInt status (KErrNone);
- if (!iEncMemorySession)
- iEncMemorySession = new (ELeave) CDevEncSession( iStorageDrive );
-
+ iEncMemorySession->SetDrive ( iStorageDrive );
+
__LEAVE_IF_ERROR(iEncMemorySession->Connect());
__LEAVE_IF_ERROR(iEncMemorySession->DiskStatus(status));
@@ -247,7 +302,6 @@
iDevEncOperation = EIdle;
iEncMemorySession->Close();
- delete iEncMemorySession; iEncMemorySession = NULL;
iCallback->HandleDecryptionCompleteL(KErrBadPower, EBatteryLevelLevel4);
}
@@ -258,7 +312,6 @@
iDevEncOperation = EIdle;
iEncMemorySession->Close();
- delete iEncMemorySession; iEncMemorySession = NULL;
iCallback->HandleDecryptionCompleteL(KErrNone);
}
@@ -269,7 +322,6 @@
iDevEncOperation = EIdle;
iEncMemorySession->Close();
- delete iEncMemorySession; iEncMemorySession = NULL;
iCallback->HandleDecryptionCompleteL(KErrNotReady);
}
@@ -286,7 +338,6 @@
if (iEncMemorySession)
{
iEncMemorySession->Close();
- delete iEncMemorySession; iEncMemorySession = NULL;
}
CRepository *centrep = CRepository::NewL( KCRUidFotaServer );
@@ -366,8 +417,7 @@
TInt status (KErrNone);
- if (!iEncMemorySession)
- iEncMemorySession = new (ELeave) CDevEncSession( iStorageDrive );
+ iEncMemorySession->SetDrive( iStorageDrive );
__LEAVE_IF_ERROR(iEncMemorySession->Connect());
@@ -396,7 +446,6 @@
iDevEncOperation = EIdle;
iEncMemorySession->Close();
- delete iEncMemorySession; iEncMemorySession = NULL;
iCallback->HandleEncryptionCompleteL(KErrBadPower);
}
@@ -407,7 +456,6 @@
iDevEncOperation = EIdle;
iEncMemorySession->Close();
- delete iEncMemorySession; iEncMemorySession = NULL;
iCallback->HandleEncryptionCompleteL(KErrNone);
}
@@ -418,7 +466,6 @@
iDevEncOperation = EIdle;
iEncMemorySession->Close();
- delete iEncMemorySession; iEncMemorySession = NULL;
iCallback->HandleEncryptionCompleteL(KErrNotReady);
}
--- a/fotaapplication/fotaserver/FotaServer/src/DevEncProgressObserver.cpp Mon Mar 15 12:43:15 2010 +0200
+++ b/fotaapplication/fotaserver/FotaServer/src/DevEncProgressObserver.cpp Wed Mar 31 23:00:03 2010 +0300
@@ -18,7 +18,7 @@
// INCLUDE FILES
-
+#include <DevEncSessionBase.h>
//User Includes
#include "DevEncProgressObserver.h"
@@ -131,7 +131,7 @@
// This method don't leave
// -----------------------------------------------------------------------------
-void CDevEncProgressObserver::StartMonitoringL(CDevEncSession* aSession)
+void CDevEncProgressObserver::StartMonitoringL(CDevEncSessionBase* aSession)
{
FLOG(_L("CDevEncProgressObserver::StartMonitoringL >>"));
--- a/package_definition.xml Mon Mar 15 12:43:15 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,185 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<SystemDefinition schema="3.0.0">
- <package id="remotemgmt" name="Remote Management" levels="plugin framework server generic specific">
- <collection id="omaprovisioning" name="OMA Provisioning" level="specific">
- <component id="pnputil" filter="s60" name="PnP Util">
- <unit bldFile="omaprovisioning/pnputil/group"/>
- <!-- should the test bld.inf be #included? -->
- <!-- <unit bldFile="omaprovisioning/pnputil/tsrc/moduletest/group"/> -->
- </component>
- <component id="provisioning" filter="s60" name="Provisioning">
- <unit bldFile="omaprovisioning/provisioning/group"/>
- <!-- should the test bld.inf be #included? -->
- <!-- <unit bldFile="omaprovisioning/provisioning/tsrc/moduletest/group"/> -->
- </component>
- </collection>
- <collection id="policymanagement" name="Policy Management" level="generic">
- <component id="pmdmadapter" filter="s60" name="PM DM Adapter" class="plugin">
- <unit bldFile="policymanagement/pmdmadapter/group"/>
- </component>
- <component id="dmutilserver" filter="s60" name="DM Util Server">
- <unit bldFile="policymanagement/dmutilserver/group"/>
- </component>
- <component id="policyengine" filter="s60" name="Policy Engine">
- <unit bldFile="policymanagement/policyengine/group"/>
- </component>
- <component id="policymanagement_build" filter="s60" name="Policy Management Build">
- <!-- should un#include above units-->
- <unit bldFile="policymanagement/group"/>
- </component>
- </collection>
- <collection id="syncmlfw" name="SyncML Framework" level="server">
- <component id="syncmlfw_common" filter="s60" name="SyncML Framework Common">
- <!-- can only have one unit, need to have these #included from a single bld.inf -->
- <unit bldFile="syncmlfw/common/alerthandler/bld"/>
- <unit bldFile="syncmlfw/common/alertqueue/bld"/>
- <unit bldFile="syncmlfw/common/debug/bld"/>
- <unit bldFile="syncmlfw/common/historylog/bld"/>
- <unit bldFile="syncmlfw/common/http/bld"/>
- <unit bldFile="syncmlfw/common/inc"/>
- <unit bldFile="syncmlfw/common/inc/modifiedheaders"/>
- <unit bldFile="syncmlfw/common/inc/policy"/>
- <unit bldFile="syncmlfw/common/inc/symbianheaders"/>
- <unit bldFile="syncmlfw/common/notifiers/inc"/>
- <unit bldFile="syncmlfw/common/obex/obexclient/bld"/>
- <unit bldFile="syncmlfw/common/obex/obexcommserver/bld"/>
- <unit bldFile="syncmlfw/common/obex/obexdmplugin/bld"/>
- <unit bldFile="syncmlfw/common/obex/obexdsplugin/bld"/>
- <unit bldFile="syncmlfw/common/obex/obexserverbinding/bld"/>
- <unit bldFile="syncmlfw/common/sosserver/bld"/>
- <unit bldFile="syncmlfw/common/sosserver_clientapi/bld"/>
- <unit bldFile="syncmlfw/common/sosserver_privateapi/bld"/>
- <unit bldFile="syncmlfw/common/sosserver_transporthandler/bld"/>
- <unit bldFile="syncmlfw/common/syncagent/bld"/>
- <unit bldFile="syncmlfw/common/transport/bld"/>
- <unit bldFile="syncmlfw/common/wbxml/bld"/>
- <unit bldFile="syncmlfw/common/xml/bld"/>
- </component>
- <component id="ds" filter="s60" name="Data Sync">
- <!-- can only have one unit, need to have these #included from a single bld.inf -->
- <unit bldFile="syncmlfw/ds/adapterlog/bld"/>
- <unit bldFile="syncmlfw/ds/adapters/dataproviderbase/bld"/>
- <unit bldFile="syncmlfw/ds/agentlog/bld"/>
- <unit bldFile="syncmlfw/ds/alerthandler/bld"/>
- <unit bldFile="syncmlfw/ds/dsutils/changefinder/bld"/>
- <unit bldFile="syncmlfw/ds/dsutils/dbcaps/bld"/>
- <unit bldFile="syncmlfw/ds/dsutils/filter/bld"/>
- <unit bldFile="syncmlfw/ds/dsutils/filterutils/bld"/>
- <unit bldFile="syncmlfw/ds/dsutils/profileutil/bld"/>
- <unit bldFile="syncmlfw/ds/dsutils/storeformat/bld"/>
- <unit bldFile="syncmlfw/ds/hostserver/dshostclient/bld"/>
- <unit bldFile="syncmlfw/ds/hostserver/dshostserverbase/bld"/>
- <unit bldFile="syncmlfw/ds/hostserver/dshostservers/bld"/>
- <unit bldFile="syncmlfw/ds/inc"/>
- <unit bldFile="syncmlfw/ds/netmon/bld"/>
- <!-- <unit bldFile="syncmlfw/ds/ota/bld"/> -->
- <unit bldFile="syncmlfw/ds/provisioningadapter/bld"/>
- <unit bldFile="syncmlfw/ds/settings/bld"/>
- <unit bldFile="syncmlfw/ds/syncagent/bld"/>
- <unit bldFile="syncmlfw/ds/wappushalert/bld"/>
- </component>
- <component id="dm" filter="s60" name="Device Management">
- <!-- can only have one unit, need to have these #included from a single bld.inf -->
- <unit bldFile="syncmlfw/dm/bld"/>
- <unit bldFile="syncmlfw/dm/callbackserver/bld"/>
- <unit bldFile="syncmlfw/dm/dmutils/bld"/>
- <unit bldFile="syncmlfw/dm/hostserver/dmhostserverbase/bld"/>
- <unit bldFile="syncmlfw/dm/hostserver/dmhostservers/bld"/>
- <unit bldFile="syncmlfw/dm/provisioningadapter/bld"/>
- <unit bldFile="syncmlfw/dm/settings/bld"/>
- <unit bldFile="syncmlfw/dm/syncagent/bld"/>
- <unit bldFile="syncmlfw/dm/treedbclient/bld"/>
- <unit bldFile="syncmlfw/dm/treedbhandler/bld"/>
- <unit bldFile="syncmlfw/dm/treemodule/bld"/>
- <!-- <unit bldFile="syncmlfw/dm/tsrc/group"/> -->
- <unit bldFile="syncmlfw/dm/wappushalert/bld"/>
- </component>
- <component id="syncmlnotifier" filter="s60" name="SyncML Notifier">
- <unit bldFile="syncmlfw/syncmlnotifier/group"/>
- </component>
- <component id="syncservice" filter="s60" name="Sync Service">
- <unit bldFile="syncmlfw/syncservice/group"/>
- </component>
- <component id="syncmlfw_build" filter="s60" name="SyncML Framework Build">
- <!-- should un#include the above as necessary -->
- <unit bldFile="syncmlfw/group"/>
- </component>
- </collection>
- <collection id="terminalsecurity" name="Terminal Security" level="specific">
- <component id="scp" filter="s60" name="Security Code Proxy">
- <!-- can only have one unit, need to have these #included from a single bld.inf -->
- <unit bldFile="terminalsecurity/scp/scpclient/group"/>
- <unit bldFile="terminalsecurity/scp/scphistoryplugin/group"/>
- <unit bldFile="terminalsecurity/scp/scppatternplugin/group"/>
- <unit bldFile="terminalsecurity/scp/scpserver/group"/>
- <unit bldFile="terminalsecurity/scp/scptimestampplugin/group"/>
- </component>
- <component id="terminalsecurity_client" filter="s60" name="Terminal Control Client">
- <unit bldFile="terminalsecurity/client/group"/>
- </component>
- <component id="terminalsecurity_server" filter="s60" name="Terminal Control Server">
- <unit bldFile="terminalsecurity/server/group"/>
- </component>
- <component id="tcadapter" filter="s60" name="Terminal Control Adapter">
- <unit bldFile="terminalsecurity/tcadapter/bld"/>
- </component>
- <component id="terminalsecurity_build" filter="s60" name="Terminal Security Build">
- <unit bldFile="terminalsecurity/group"/>
- </component>
- </collection>
- <collection id="devicediagnosticsfw" name="Device Diagnostics Framework" level="framework">
- <component id="diagframework" filter="s60" name="Diagnostics Framework">
- <unit bldFile="devicediagnosticsfw/diagframework/group"/>
- </component>
- <component id="diagpluginbase" filter="s60" name="Diagnostics Plugin Base">
- <unit bldFile="devicediagnosticsfw/diagpluginbase/group"/>
- </component>
- <component id="diagresultsdb" filter="s60" name="Diagnostics Results Database">
- <!-- can only have one unit, merge or split into two components -->
- <unit bldFile="devicediagnosticsfw/diagresultsdb/client/group"/>
- <unit bldFile="devicediagnosticsfw/diagresultsdb/server/group"/>
- </component>
- <component id="devicediagnosticsfw_build" filter="s60" name="Device Diagnostics Framework Build">
- <unit bldFile="devicediagnosticsfw/group"/>
- </component>
- </collection>
- <collection id="fotaapplication" name="FOTA Application" level="generic">
- <component id="fotaserver" filter="s60" name="FOTA Server">
- <!-- can only have one unit, need to put the configuration in the appropriate bld.inf -->
- <unit bldFile="fotaapplication/fotaserver/fotastartupextplg/group"/>
- <unit bldFile="fotaapplication/fotaserver/group"/>
- <!-- <unit bldFile="fotaapplication/fotaserver/fmsclient/group"/> -->
- <!-- <unit bldFile="fotaapplication/fotaserver/fmserver/group"/> -->
- <!-- <unit bldFile="fotaapplication/fotaserver/fotarfsplugin/group"/> -->
- </component>
- <component id="fotaapp" filter="s60" name="FOTA Application">
- <!-- should be able to get rid of this by configuring the above component -->
- <unit bldFile="fotaapplication/group"/>
- </component>
- </collection>
- <collection id="remotemgmt_info" name="Remote Management Info" level="specific">
- <component id="remotemgmt_pub" filter="s60" name="Remote Management Public Interfaces" class="api">
- <unit bldFile="remotemgmt_pub/group"/>
- </component>
- <component id="remotemgmt_plat" filter="s60" name="Remote Management Platform Interfaces" class="api">
- <unit bldFile="remotemgmt_plat/group"/>
- <!-- can these be #included in the above one? -->
- <!-- <unit bldFile="remotemgmt_plat/common_agent_util_and_definitions_api/tsrc/group"/> -->
- <!-- <unit bldFile="remotemgmt_plat/data_synchronization_plugin_api/tsrc/group"/> -->
- <!-- <unit bldFile="remotemgmt_plat/dm_tree_apis/tsrc/group"/> -->
- <!-- <unit bldFile="remotemgmt_plat/dm_utils_api/tsrc/group"/> -->
- <!-- <unit bldFile="remotemgmt_plat/fota_engine_api/tsrc/group"/> -->
- <!-- <unit bldFile="remotemgmt_plat/oma_ds_extensions_api/tsrc/group"/> -->
- <!-- <unit bldFile="remotemgmt_plat/oma_provisioning_engine_api/tsrc/group"/> -->
- <!-- <unit bldFile="remotemgmt_plat/pnpms_utils_api/tsrc/group"/> -->
- <!-- <unit bldFile="remotemgmt_plat/policy_management_certificate_api/tsrc/group"/> -->
- <!-- <unit bldFile="remotemgmt_plat/policy_management_request_api/tsrc/group"/> -->
- <!-- <unit bldFile="remotemgmt_plat/scp_server_api/tsrc/group"/> -->
- <!-- <unit bldFile="remotemgmt_plat/setting_enforcement_info_api/tsrc/group"/> -->
- <!-- <unit bldFile="remotemgmt_plat/syncml_alert_api/tsrc/group"/> -->
- <!-- <unit bldFile="remotemgmt_plat/syncml_client_api/tsrc/group"/> -->
- <!-- <unit bldFile="remotemgmt_plat/terminal_security_device_lock_api/tsrc/group"/> -->
- </component>
- </collection>
- </package>
-</SystemDefinition>
--- a/remotemgmt_plat/scp_server_api/inc/SCPServerInterface.h Mon Mar 15 12:43:15 2010 +0200
+++ b/remotemgmt_plat/scp_server_api/inc/SCPServerInterface.h Wed Mar 31 23:00:03 2010 +0300
@@ -27,6 +27,8 @@
typedef TBuf<8> TSCPSecCode;
const TInt KSCPMaxEnhCodeLen = 256;
+// New DataType to store encrypted information of maximum size 128.
+typedef TBuf<128> TSCPCryptoCode;
// LOCAL CONSTANTS
_LIT( KSCPServerName, "!SCPServer" );
--- a/remotemgmt_plat/syncml_ds_customization_api/group/bld.inf Mon Mar 15 12:43:15 2010 +0200
+++ b/remotemgmt_plat/syncml_ds_customization_api/group/bld.inf Wed Mar 31 23:00:03 2010 +0300
@@ -23,4 +23,4 @@
PRJ_EXPORTS
-..\inc\NsmlOperatorDataCRKeys.h MW_LAYER_PLATFORM_EXPORT_PATH(NsmlOperatorDataCRKeys.h)
\ No newline at end of file
+../inc/NSmlOperatorDataCRKeys.h MW_LAYER_PLATFORM_EXPORT_PATH(NsmlOperatorDataCRKeys.h)
\ No newline at end of file
--- a/remotemgmt_plat/syncml_ds_error_reporting_api/group/bld.inf Mon Mar 15 12:43:15 2010 +0200
+++ b/remotemgmt_plat/syncml_ds_error_reporting_api/group/bld.inf Wed Mar 31 23:00:03 2010 +0300
@@ -23,4 +23,4 @@
PRJ_EXPORTS
-..\inc\NsmlOperatorErrorCRKeys.h MW_LAYER_PLATFORM_EXPORT_PATH(NsmlOperatorErrorCRKeys.h)
\ No newline at end of file
+../inc/NSmlOperatorErrorCRKeys.h MW_LAYER_PLATFORM_EXPORT_PATH(NsmlOperatorErrorCRKeys.h)
\ No newline at end of file
--- a/remotemgmt_plat/terminal_security_device_lock_api/group/bld.inf Mon Mar 15 12:43:15 2010 +0200
+++ b/remotemgmt_plat/terminal_security_device_lock_api/group/bld.inf Wed Mar 31 23:00:03 2010 +0300
@@ -29,3 +29,6 @@
../inc/TerminalControl3rdPartyParamsPlugin.h MW_LAYER_PLATFORM_EXPORT_PATH(TerminalControl3rdPartyParamsPlugin.h)
../inc/TerminalControl3rdPartyParamsPluginDef.h MW_LAYER_PLATFORM_EXPORT_PATH(TerminalControl3rdPartyParamsPluginDef.h)
../inc/TerminalControl3rdPartyParamsPlugin.inl MW_LAYER_PLATFORM_EXPORT_PATH(TerminalControl3rdPartyParamsPlugin.inl)
+../inc/dmencryptionutilinterface.h MW_LAYER_PLATFORM_EXPORT_PATH(dmencryptionutilinterface.h)
+../inc/dmencryptionutil.h MW_LAYER_PLATFORM_EXPORT_PATH(dmencryptionutil.h)
+../inc/dmencryptionutil.inl MW_LAYER_PLATFORM_EXPORT_PATH(dmencryptionutil.inl)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/terminal_security_device_lock_api/inc/dmencryptionutil.h Wed Mar 31 23:00:03 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* 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: implementation of MDMEncryptionUtilInterface.
+*
+*/
+
+#ifndef DMENCRYPTIONUTIL_H_
+#define DMENCRYPTIONUTIL_H_
+
+#include <dmencryptionutilinterface.h>
+
+class CDMEncryptionUtil : public CBase, public MDMEncryptionUtilInterface
+ {
+public:
+ // Instantiates an object of this type
+ /**
+ * Create instance of CDMEncryptionUtil, this NewL always loads only the secenv hardware encryption plugin.
+ * @param Nil
+ * @return Instance of CDMEncryptionUtil
+ */
+ static CDMEncryptionUtil* NewL();
+ /**
+ * Create instance of CDMEncryptionUtil, this NewL always loads the plugin which matches with the default_data.
+ * @param aData is the value of default_data.
+ * @return Instance of CDMEncryptionUtil
+ * Leaves with KErrBadName: if the default_data exists more than 1.
+ */
+ static CDMEncryptionUtil* CDMEncryptionUtil::NewL(const TDesC8& aData);
+
+ /**
+ * C++ Destructor
+ */
+ virtual ~CDMEncryptionUtil();
+
+private:
+ // Unique instance identifier key
+ TUid iDtor_ID_Key;
+
+ };
+
+#include "dmencryptionutil.inl"
+
+
+#endif /* DMENCRYPTIONUTIL_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/terminal_security_device_lock_api/inc/dmencryptionutil.inl Wed Mar 31 23:00:03 2010 +0300
@@ -0,0 +1,119 @@
+/*
+* 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: dmencryptionutil Encryption/Decryption Interface
+*
+*/
+
+
+#include <ecom/implementationproxy.h>
+#include <ecom/ecom.h>
+#include <ecom/ecomresolverparams.h>
+
+/**
+ * C++ Destructor
+ */
+// Inline functions
+CDMEncryptionUtil::~CDMEncryptionUtil()
+ {
+ // Destroy any instance variables and then
+ // inform the framework that this specific
+ // instance of the interface has been destroyed.
+ REComSession::DestroyedImplementation(iDtor_ID_Key);
+ }
+
+/**
+ * Cleans up the ECOM plugin array
+ * @param aUid , implementation Uid
+ * @return Instance of CDMEncryptionUtil
+ */
+void CleanupEComArray(TAny* aArray)
+ {
+ (static_cast<RImplInfoPtrArray*> (aArray))->ResetAndDestroy();
+ (static_cast<RImplInfoPtrArray*> (aArray))->Close();
+ }
+
+/**
+* Create instance of CDMEncryptionUtil, this NewL always loads only the secenv hardware encryption plugin.
+* @param Nil
+* @return Instance of CDMEncryptionUtil
+*/
+inline CDMEncryptionUtil* CDMEncryptionUtil::NewL()
+ {
+ RImplInfoPtrArray infoArray;
+ // Note that a special cleanup function is required to reset and destroy
+ // all items in the array, and then close it.
+ TCleanupItem cleanup(CleanupEComArray, &infoArray);
+ CleanupStack::PushL(cleanup);
+
+ //Only ROM plugins are filtered & listed.
+ TEComResolverParams resolverParams;
+ _LIT8(KOperationName,"extdmencryptionutil");
+
+ resolverParams.SetDataType(KOperationName());
+ resolverParams.SetWildcardMatch(ETrue); // Allow wildcard matching
+ TRAPD(terr, REComSession::ListImplementationsL(KDMEncryptionUtilInterfaceUid, resolverParams,KRomOnlyResolverUid, infoArray));
+ REComSession::FinalClose();
+ if(terr)
+ {
+ User::Leave(terr);
+ }
+ if(infoArray.Count() > 1)
+ {
+ User::Leave(KErrBadName);
+ }
+ TUid retUid = infoArray[0]->ImplementationUid();
+ CleanupStack::PopAndDestroy(); //cleanup
+
+ TAny* ptr = REComSession::CreateImplementationL( retUid, _FOFF(CDMEncryptionUtil, iDtor_ID_Key));
+ CDMEncryptionUtil* self = reinterpret_cast<CDMEncryptionUtil*>( ptr );
+
+ return self;
+ }
+
+/**
+* Create instance of CDMEncryptionUtil, this NewL always loads the plugin which matches with the default_data.
+* @param aData default_data
+* @return Instance of CDMEncryptionUtil
+* Leaves with KErrBadName: if the default_data exists more than 1.
+*/
+inline CDMEncryptionUtil* CDMEncryptionUtil::NewL(const TDesC8& aData)
+ {
+ RImplInfoPtrArray infoArray;
+ // Note that a special cleanup function is required to reset and destroy
+ // all items in the array, and then close it.
+ TCleanupItem cleanup(CleanupEComArray, &infoArray);
+ CleanupStack::PushL(cleanup);
+
+ //Only ROM plugins are filtered & listed.
+ TEComResolverParams resolverParams;
+ resolverParams.SetDataType(aData);
+ resolverParams.SetWildcardMatch(ETrue); // Allow wildcard matching
+ TRAPD(terr, REComSession::ListImplementationsL(KDMEncryptionUtilInterfaceUid, resolverParams,KRomOnlyResolverUid, infoArray));
+ REComSession::FinalClose();
+ if(terr)
+ {
+ User::Leave(terr);
+ }
+ if(infoArray.Count() > 1)
+ {
+ User::Leave(KErrBadName);
+ }
+ TUid retUid = infoArray[0]->ImplementationUid();
+ CleanupStack::PopAndDestroy(); //cleanup
+
+ TAny* ptr = REComSession::CreateImplementationL( retUid, _FOFF(CDMEncryptionUtil, iDtor_ID_Key));
+ CDMEncryptionUtil* self = reinterpret_cast<CDMEncryptionUtil*>( ptr );
+
+ return self;
+ }
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/remotemgmt_plat/terminal_security_device_lock_api/inc/dmencryptionutilinterface.h Wed Mar 31 23:00:03 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: E/D Interface definition
+*
+*/
+
+#ifndef _MDMEncryptionUtilInterface_H__
+#define _MDMEncryptionUtilInterface_H__
+
+#include <e32base.h>
+#include <ecom/ecom.h>
+
+// UID of this interface
+const TUid KDMEncryptionUtilInterfaceUid = {0x2002C2F4};
+
+/**
+ An CDMEncryptionUtil abstract class being representative of the
+ concrete class which the client wishes to use.
+
+ It acts as a base, for a real class to provide all the
+ functionality that a client requires.
+ It supplies instantiation & destruction by using
+ the ECom framework, and functional services
+ by using the methods of the actual class.
+ */
+
+
+class MDMEncryptionUtilInterface
+ {
+public:
+
+ // Pure interface methods
+ // Representative of a method provided on the interface by
+ // the interface definer.
+
+ /**
+ * Encrypts the data.
+ * @param aInput - is the input string which has to be encrypted.
+ * @param aOutput - the encrypted information is stored parameter.
+ * @return Return is KErrNone if successful or any System wide error code.
+ *
+ */
+ virtual TInt EncryptL( TDes& aInput, TDes& aOutput) = 0;
+ /**
+ * Decrypts the data.
+ * @param Input - is the input string which has to be decrypted.
+ * @param aOutput - the decrypted information is stored in this parameter.
+ * @return Return is KErrNone if successful or any System wide error code.
+ */
+ virtual TInt DecryptL( TDes& aInput, TDes& aOutput) = 0;
+
+ };
+
+#endif // _MDMEncryptionUtilInterface_H_
+
--- a/syncmlfw/common/syncagent/src/NSmlAgentBase.cpp Mon Mar 15 12:43:15 2010 +0200
+++ b/syncmlfw/common/syncagent/src/NSmlAgentBase.cpp Wed Mar 31 23:00:03 2010 +0300
@@ -1690,7 +1690,7 @@
CWbxml2XmlConverter* c = CWbxml2XmlConverter::NewLC();
c->ConvertL( document.Ptr(), document.Length() );
RFs fs;
- fs.Connect(); // create connect to fileserver
+ User::LeaveIfError( fs.Connect() ); // create connect to fileserver
CleanupClosePushL( fs );
if( !BaflUtils::FolderExists( fs, _L("C:\\logs\\Sync\\") ) )
{
@@ -1770,7 +1770,7 @@
{
c->ConvertL( document.Ptr(), document.Length() );
RFs fs;
- fs.Connect(); // create connect to fileserver
+ User::LeaveIfError( fs.Connect() ); // create connect to fileserver
CleanupClosePushL( fs );
if( !BaflUtils::FolderExists( fs, _L("C:\\logs\\Sync\\") ) )
{
--- a/syncmlfw/dm/dmnetworkmon/src/DMNetworkMon.cpp Mon Mar 15 12:43:15 2010 +0200
+++ b/syncmlfw/dm/dmnetworkmon/src/DMNetworkMon.cpp Wed Mar 31 23:00:03 2010 +0300
@@ -498,8 +498,8 @@
static _LIT_SECURITY_POLICY_PASS(KAllowAllPolicy);
static _LIT_SECURITY_POLICY_C1(KAllowWriteDeviceDataPolicy, ECapabilityWriteDeviceData);
RProperty::Define(KPSUidNSmlSOSServerKey,KNSmlDMSilentJob,RProperty::EInt,KAllowAllPolicy,KAllowWriteDeviceDataPolicy);
- TInt r2=RProperty::Set(KPSUidNSmlSOSServerKey,KNSmlDMSilentJob,ESilent);
- DBG_FILE_CODE(aError, _S8("CDMNetworkMon::RunError() KNSmlDMSilentJob get error code "));
+ TInt r2=RProperty::Set(KPSUidNSmlSOSServerKey,KNSmlDMSilentJob,ESilent);
+ LOGSTRING2( "CDMNetworkMon::RunError() KNSmlDMSilentJob get error code = %i", r2);
TRAPD(err, dmJob.CreateL( iSyncSession, ProfileId, IAPID));
LOGSTRING("DM JOB CREATED END");
if(err!=KErrNone)
--- a/syncmlfw/dm/syncagent/src/nsmldmagent.cpp Mon Mar 15 12:43:15 2010 +0200
+++ b/syncmlfw/dm/syncagent/src/nsmldmagent.cpp Wed Mar 31 23:00:03 2010 +0300
@@ -1388,6 +1388,8 @@
return;
}
CleanupStack::PushL( profile );
+ if( iError )
+ {
if(iError->SyncLogErrorCode() == KErrNone)
{
RWriteStream& LastSyncStream = profile->LastSyncWriteStreamL();
@@ -1413,6 +1415,7 @@
CleanupStack::PopAndDestroy();
}
}
+ }
CNSmlHistoryArray* array = CNSmlHistoryArray::NewL();
CleanupStack::PushL( array );
array->SetOwnerShip( ETrue );
@@ -1835,15 +1838,16 @@
for(TInt i =0; i< count ; i++)
{
- CNSmlDMAlertItem* iItem = new (ELeave) CNSmlDMAlertItem ;
- iItem->iSource = ((*aItemList)[i].iSource)->AllocL();
- iItem->iTarget = ((*aItemList)[i].iTarget)->AllocL();
- iItem->iMetaType = ((*aItemList)[i].iMetaType)->AllocL();
- iItem->iMetaFormat = ((*aItemList)[i].iMetaFormat)->AllocL();
- iItem->iMetaMark = ((*aItemList)[i].iMetaMark)->AllocL();
- iItem->iData = ((*aItemList)[i].iData)->AllocL();
- iDataItem->AppendL(*iItem);
- delete iItem;
+ CNSmlDMAlertItem* tempItem = new (ELeave) CNSmlDMAlertItem ;
+ CleanupStack::PushL( tempItem );
+ tempItem->iSource = ((*aItemList)[i].iSource)->AllocL();
+ tempItem->iTarget = ((*aItemList)[i].iTarget)->AllocL();
+ tempItem->iMetaType = ((*aItemList)[i].iMetaType)->AllocL();
+ tempItem->iMetaFormat = ((*aItemList)[i].iMetaFormat)->AllocL();
+ tempItem->iMetaMark = ((*aItemList)[i].iMetaMark)->AllocL();
+ tempItem->iData = ((*aItemList)[i].iData)->AllocL();
+ iDataItem->AppendL(*tempItem);
+ CleanupStack::PopAndDestroy( tempItem );
}
}
--- a/syncmlfw/dm/treedbclient/src/nsmldmtreedbclient.cpp Mon Mar 15 12:43:15 2010 +0200
+++ b/syncmlfw/dm/treedbclient/src/nsmldmtreedbclient.cpp Wed Mar 31 23:00:03 2010 +0300
@@ -599,7 +599,10 @@
if( upperURI.Compare(aURI) != 0 )
{
iEnforceCheckdone++;
- CheckDynamicAclL( upperURI, aCmdType, aMgmtTree );
+ if(CheckDynamicAclL( upperURI, aCmdType, aMgmtTree ))
+ {
+ _DBG_FILE("RNSmlDMCallbackSession::CheckDynamicAclL() : returns true");
+ }
}
}
else
--- a/syncmlfw/ds/hostserver/dshostserverbase/bld/nsmldshostserver.mmp Mon Mar 15 12:43:15 2010 +0200
+++ b/syncmlfw/ds/hostserver/dshostserverbase/bld/nsmldshostserver.mmp Wed Mar 31 23:00:03 2010 +0300
@@ -52,7 +52,7 @@
SOURCE Nsmldsasyncrequesthandler.cpp
SOURCE Nsmldsasynccallback.cpp
SOURCE NsmldschangedItemsFetcher.cpp
-SOURCE nsmldshostsessioncancel.cpp
+SOURCE Nsmldshostsessioncancel.cpp
LIBRARY euser.lib ecom.lib efsrv.lib edbms.lib estor.lib bafl.lib smlstoreformat.lib
LIBRARY nsmldebug.lib smldataprovider.lib nsmldshostclient.lib NSmlAdapterLog.lib
--- a/syncmlfw/ds/hostserver/dshostserverbase/src/Nsmldshostsession.cpp Mon Mar 15 12:43:15 2010 +0200
+++ b/syncmlfw/ds/hostserver/dshostserverbase/src/Nsmldshostsession.cpp Wed Mar 31 23:00:03 2010 +0300
@@ -30,7 +30,7 @@
#include "NSmlAdapterLog.h"
#include "nsmldshostconstants.h"
#include "Nsmldshostserver.h"
-#include "nsmldshostsessioncanceleventhandler.h"
+#include "Nsmldshostsessioncanceleventhandler.h"
#include "Nsmldshostsessioncancel.h"
#include "Nsmldshostsession.h"
#include "nsmldsdpinformation.h"
--- a/syncmlfw/ds/hostserver/dshostserverbase/src/Nsmldshostsessioncancel.cpp Mon Mar 15 12:43:15 2010 +0200
+++ b/syncmlfw/ds/hostserver/dshostserverbase/src/Nsmldshostsessioncancel.cpp Wed Mar 31 23:00:03 2010 +0300
@@ -20,8 +20,8 @@
#include <d32dbms.h>
#include <nsmldebug.h>
#include <DataSyncInternalPSKeys.h>
-#include "nsmldshostsessioncanceleventhandler.h"
-#include "nsmldshostsessioncancel.h"
+#include "Nsmldshostsessioncanceleventhandler.h"
+#include "Nsmldshostsessioncancel.h"
// --------------------------------------------------------------------------
// CNSmlHostSessionCancel* CNSmlHostSessionCancel::NewL( MNSmlDsHostSessionCancelEventHandler* aHandler )
// --------------------------------------------------------------------------
--- a/syncmlfw/ds/provisioningadapter/src/NSmlDsProvisioningAdapter.cpp Mon Mar 15 12:43:15 2010 +0200
+++ b/syncmlfw/ds/provisioningadapter/src/NSmlDsProvisioningAdapter.cpp Wed Mar 31 23:00:03 2010 +0300
@@ -29,7 +29,7 @@
#include <ApUtils.h>
#include <barsc.h>
#include <centralrepository.h> //For central Repository
-#include <NSmlOperatorDataCRKeys.h> // KCRUidOperatorDatasyncInternalKeys
+#include <NsmlOperatorDataCRKeys.h> // KCRUidOperatorDatasyncInternalKeys
#include <nsmlconstants.h>
#include <nsmldebug.h>
--- a/syncmlfw/ds/settings/src/NSmlDSSettings.cpp Mon Mar 15 12:43:15 2010 +0200
+++ b/syncmlfw/ds/settings/src/NSmlDSSettings.cpp Wed Mar 31 23:00:03 2010 +0300
@@ -30,8 +30,8 @@
#include "NSmlProfileContentHandler.h"
#include "nsmldsagconstants.h"
#include <centralrepository.h> //CRepository
-#include <NSmlOperatorDataCRKeys.h> // KCRUidOperatorDatasyncInternalKeys
-#include <NSmlOperatorErrorCRKeys.h> // KCRUidOperatorDatasyncErrorKeys
+#include <NsmlOperatorDataCRKeys.h> // KCRUidOperatorDatasyncInternalKeys
+#include <NsmlOperatorErrorCRKeys.h> // KCRUidOperatorDatasyncErrorKeys
_LIT(Kinfile,"z:\\Private\\101F99FB\\VariantData.xml");
const TInt KUrlLength = 256;
--- a/syncmlfw/syncmlnotifier/src/SyncMLFwUpdNotifier.cpp Mon Mar 15 12:43:15 2010 +0200
+++ b/syncmlfw/syncmlnotifier/src/SyncMLFwUpdNotifier.cpp Wed Mar 31 23:00:03 2010 +0300
@@ -1145,6 +1145,13 @@
stringHolder = StringLoader::LoadLC( R_FOTA_POSTPONE_UPDATE_ONE_DAY, *aIntparam);
}
+ else
+ {
+ CleanupStack::PopAndDestroy( aIntparam );
+ CleanupStack::PopAndDestroy( aStrArr );
+ return retval;
+ }
+
CAknInformationNote* infoNote = new (ELeave) CAknInformationNote;
infoNote->ExecuteLD( *stringHolder );
--- a/terminalsecurity/SCP/SCPClient/src/SCPQueryDialog.cpp Mon Mar 15 12:43:15 2010 +0200
+++ b/terminalsecurity/SCP/SCPClient/src/SCPQueryDialog.cpp Wed Mar 31 23:00:03 2010 +0300
@@ -291,8 +291,8 @@
}
else
{
- DrawableWindow()->SetOrdinalPosition(0,ECoeWinPriorityNormal); //
- ButtonGroupContainer().ButtonGroup()->AsControl()->DrawableWindow()->SetOrdinalPosition(0,ECoeWinPriorityNormal);
+ DrawableWindow()->SetOrdinalPosition(0,ECoeWinPriorityNormal + 1); //
+ ButtonGroupContainer().ButtonGroup()->AsControl()->DrawableWindow()->SetOrdinalPosition(0,ECoeWinPriorityNormal + 1);
}
Dprint( (_L("CSCPQueryDialog::PreLayoutDynInitL(): Key sounds") ));
--- a/terminalsecurity/SCP/SCPServer/group/SCPServer.mmp Mon Mar 15 12:43:15 2010 +0200
+++ b/terminalsecurity/SCP/SCPServer/group/SCPServer.mmp Wed Mar 31 23:00:03 2010 +0300
@@ -96,7 +96,6 @@
LIBRARY featmgr.lib
LIBRARY estor.lib
LIBRARY charconv.lib
-LIBRARY devenccommonutils.lib //Device encryption utility
SMPSAFE
--- a/terminalsecurity/SCP/SCPServer/inc/SCPConfiguration.h Mon Mar 15 12:43:15 2010 +0200
+++ b/terminalsecurity/SCP/SCPServer/inc/SCPConfiguration.h Wed Mar 31 23:00:03 2010 +0300
@@ -29,7 +29,8 @@
enum TSCPParamType
{
EParTypeInt = 0,
- EParTypeDesc
+ EParTypeDesc,
+ EParTypeBool
};
// LOCAL CONSTANTS
@@ -54,6 +55,13 @@
const TInt KParamIDBlockedAtTime = 6;
const TInt KParamIDBlockedInOOS = 7;
+// ID number for the encrypted security code.
+const TInt KParamIDCryptoCode = 8;
+//ID number for the boolean for the configuartion check
+const TInt KParamIDConfigChecked = 9;
+
+// Total number of Param IDs
+const TInt KTotalParamIDs = 9;
//#ifdef __SAP_DEVICE_LOCK_ENHANCEMENTS
#define SCP_PARAMETERS_WithFlag { &iConfigFlag, \
@@ -62,7 +70,9 @@
&iEnhSecCode, \
&iFailedAttempts, \
&iBlockedAtTime, \
- &iBlockedInOOS \
+ &iBlockedInOOS, \
+ &iCryptoCode, \
+ &iConfigChecked \
};
#define SCP_PARAMIDS_WithFlag { KParamIDConfigFlag, \
@@ -71,7 +81,9 @@
KParamIDEnhSecCode, \
KParamIDFailedAttempts, \
KParamIDBlockedAtTime, \
- KParamIDBlockedInOOS \
+ KParamIDBlockedInOOS, \
+ KParamIDCryptoCode, \
+ KParamIDConfigChecked \
};
#define SCP_PARAMTYPES_WithFlag { EParTypeInt, \
@@ -80,7 +92,9 @@
EParTypeDesc, \
EParTypeInt, \
EParTypeDesc, \
- EParTypeInt \
+ EParTypeInt, \
+ EParTypeDesc, \
+ EParTypeBool \
};
//#else // !__SAP_DEVICE_LOCK_ENHANCEMENTS
@@ -155,6 +169,15 @@
*/
void TransformStringL( TBool aEncrypt, TDes& aInput, TDes& aOutput );
+ /**
+ * Function to check for any ECOM plugin implementing the MDMEncryptionUtilInterface exist in ROM only.
+ * If any plugin is implemented then Encrypts or decrypts the input string in aInput, saving the output in aOutput.
+ * If the input is not an exact multiple of a DES block, 0-padding is used. The
+ * output buffer must be large enough to store the output blocks.
+ * Returns ETrue if plugin is implemented & exists in ROM only.
+ * EFalse if plugin is not implemented.
+ */
+ TBool NativeTransform(TBool aEncrypt, TDes& aInput, TDes& aOutput);
public: // Data
/** Configuration valid -flag */
@@ -167,6 +190,9 @@
TFileName iConfigFileName;
TInt iBlockedInOOS;
+ //Flag to check whether Configuration checked already
+ TBool iConfigChecked;
+
/** A ptr to a connected RFs, not owned */
RFs* iFsSession;
@@ -178,6 +204,8 @@
/** The time since the code has been blocked */
TBuf<KSCPMaxInt64Length> iBlockedAtTime;
//#endif // __SAP_DEVICE_LOCK_ENHANCEMENTS
+// Member to hold the encrypted/decrypted security code from Crpto HW encryption algorithm
+ TSCPCryptoCode iCryptoCode;
};
--- a/terminalsecurity/SCP/SCPServer/src/SCPConfiguration.cpp Mon Mar 15 12:43:15 2010 +0200
+++ b/terminalsecurity/SCP/SCPServer/src/SCPConfiguration.cpp Wed Mar 31 23:00:03 2010 +0300
@@ -27,6 +27,7 @@
#include "SCPServer.h"
#include <featmgr.h>
+#include <dmencryptionutil.h>
// ================= MEMBER FUNCTIONS =======================
@@ -82,10 +83,9 @@
User::Leave(errf);
}
TInt result = KErrNone;
-
- TAny* KParameters[7];
- TInt KParamIDs[7];
- TSCPParamType KSCPParamTypes[7];
+ TAny* KParameters[KTotalParamIDs];
+ TInt KParamIDs[KTotalParamIDs];
+ TSCPParamType KSCPParamTypes[KTotalParamIDs];
TInt KNumParams;
@@ -155,6 +155,12 @@
break;
}
+ case ( EParTypeBool ):
+ {
+ ret = params->Get( KParamIDs[i], *(reinterpret_cast<TBool*>( KParameters[i] )) );
+ break;
+ }
+
default:
// No implementation needed
break;
@@ -172,7 +178,22 @@
// Decrypt the ISA security code
TSCPSecCode cryptBuf;
cryptBuf.Copy( iSecCode );
- TransformStringL( EFalse, cryptBuf, iSecCode );
+ Dprint( (_L("--> TSCPConfiguration::ReadSetupL NativeTransform iCryptoCode= %S "), &iCryptoCode ));
+ if(EFalse == NativeTransform(EFalse, iCryptoCode, iSecCode))
+ {
+ Dprint( (_L("--> TSCPConfiguration::ReadSetupL NativeTransform returned false") ));
+ // If ECOM decrypt fails after modifying iSecCode.
+ iSecCode.Copy(cryptBuf);
+ TransformStringL( EFalse, cryptBuf, iSecCode );
+ }
+ else
+ {
+ Dprint( (_L("--> TSCPConfiguration::ReadSetupL NativeTransform returned true") ));
+ Dprint( (_L("--> TSCPConfiguration::ReadSetupL NativeTransform iCryptoCode= %S "), &iCryptoCode ));
+ //Dummy code to be written of KSCPCodeMaxLen size, if plugin exist.
+ // Dprint((_L("iSecCode.Copy(iCryptoCode.Ptr(), KSCPCodeMaxLen);")));
+ // iSecCode.Copy(iCryptoCode.Ptr(), KSCPCodeMaxLen);
+ }
iSecCode.SetLength( KSCPCodeMaxLen ); // Remove the suffix
FeatureManager::UnInitializeLib();
@@ -200,9 +221,9 @@
- TAny* KParameters[7];
- TInt KParamIDs[7];
- TSCPParamType KSCPParamTypes[7];
+ TAny* KParameters[KTotalParamIDs];
+ TInt KParamIDs[KTotalParamIDs];
+ TSCPParamType KSCPParamTypes[KTotalParamIDs];
TInt KNumParams;
@@ -245,8 +266,24 @@
TSCPSecCode cryptBuf;
cryptBuf.Copy( iSecCode );
cryptBuf.Append( KSCPCryptSuffix ); // 5 chars for the code + suffix
- TransformStringL( ETrue, cryptBuf, iSecCode );
-
+ if(EFalse == NativeTransform(ETrue, cryptBuf, iCryptoCode))
+ {
+ cryptBuf.FillZ();
+ cryptBuf.Zero();
+ cryptBuf.Copy( iSecCode );
+ cryptBuf.Append( KSCPCryptSuffix ); // 5 chars for the code + suffix
+ Dprint( (_L("--> TSCPConfiguration::WriteSetupL NativeTransform returned false") ));
+ TransformStringL( ETrue, cryptBuf, iSecCode );
+
+ }
+ else
+ {
+ iSecCode.FillZ();
+ iSecCode.Zero();
+
+ Dprint( (_L("--> TSCPConfiguration::WriteSetupL NativeTransform returned true") ));
+ Dprint( (_L("--> TSCPConfiguration::WriteSetupL NativeTransform iCryptoCode= %S "), &iCryptoCode ));
+ }
TInt ret = KErrNone;
for ( TInt i = 0; i < KNumParams; i++ )
{
@@ -265,6 +302,12 @@
break;
}
+ case ( EParTypeBool ):
+ {
+ ret = params->Set( KParamIDs[i], *(reinterpret_cast<TBool*>( KParameters[i] )) );
+ break;
+ }
+
default:
// No implementation needed
break;
@@ -397,8 +440,60 @@
aOutput.SetLength( outputData.Length() / 2 );
#endif // UNICODE
}
+// ---------------------------------------------------------
+// TSCPConfiguration::NativeTransform (TBool aEncrypt, TDes& aInput, TDes& aOutput)
+// Transforms the given aInput buffer using the plugin Encryption/Decryption,
+// and stores the result to aOutput
+//
+// Status : New
+// ---------------------------------------------------------
+//
+TBool TSCPConfiguration::NativeTransform (TBool aEncrypt, TDes& aInput, TDes& aOutput)
+{
+ Dprint( (_L("--> TSCPConfiguration::NativeTransform()") ));
+ TInt err(KErrNone);
+ TBool result(ETrue);
+ CDMEncryptionUtil* eUtil;
+ Dprint( (_L("TSCPConfiguration::NativeTransform(), calling TRAP(err, eUtil = CDMEncryptionUtil::NewL()); ") ));
+
+ TRAP(err, eUtil = CDMEncryptionUtil::NewL());
+ Dprint( (_L("TSCPConfiguration::NativeTransform(), after TRAP(err, eUtil = CDMEncryptionUtil::NewL()); err= %d"), err ));
+ if(err)
+ {
+ result = EFalse;
+ return result;
+ }
+ CleanupStack::PushL(eUtil);
+ if(aEncrypt)
+ {
+ Dprint( (_L(" TSCPConfiguration::NativeTransform()Encrypting...") ));
+ TRAP(err, eUtil->EncryptL( aInput, aOutput));
+ Dprint( (_L("TSCPConfiguration::NativeTransform(), after Encrypting err= %d"), err ));
+ }
+ else
+ {
+ Dprint( (_L(" TSCPConfiguration::NativeTransform()Decrypting...") ));
+ TRAP(err, eUtil->DecryptL( aInput, aOutput));
+ Dprint( (_L("TSCPConfiguration::NativeTransform(), after Decrypting err= %d"), err ));
+ }
+ CleanupStack::PopAndDestroy(); //eUtil
+ if(err)
+ {
+ Dprint( (_L(" TSCPConfiguration::NativeTransform() CDMEncryptionUtil::ListImplementationsL failed") ));
+ result = EFalse;
+ }
+ else
+ {
+ Dprint( (_L(" TSCPConfiguration::NativeTransform() CDMEncryptionUtil::ListImplementationsL success") ));
+ result = ETrue;
+ }
+
+ Dprint( (_L("TSCPConfiguration::NativeTransform(): result = %d"), result ));
+ Dprint( (_L("<-- TSCPConfiguration::NativeTransform()") ));
+ return result;
+}
// End of File
--- a/terminalsecurity/SCP/SCPServer/src/SCPServer.cpp Mon Mar 15 12:43:15 2010 +0200
+++ b/terminalsecurity/SCP/SCPServer/src/SCPServer.cpp Wed Mar 31 23:00:03 2010 +0300
@@ -51,7 +51,7 @@
#include <featmgr.h>
// For Device encryption
#include <DevEncEngineConstants.h>
-#include <DevEncSession.h>
+#include <DevEncSessionBase.h>
// ==================== LOCAL FUNCTIONS ====================
@@ -114,11 +114,16 @@
// Assign default config flag
iConfiguration.iConfigFlag = KSCPConfigUnknown;
+ iConfiguration.iConfigChecked = EFalse;
// Assign the default codes
iConfiguration.iSecCode.Zero();
iConfiguration.iSecCode.Append( KSCPDefaultSecCode );
+ // Assign the default codes
+ iConfiguration.iCryptoCode.Zero();
+ iConfiguration.iCryptoCode.Append( KSCPDefaultSecCode );
+
//#ifdef __SAP_DEVICE_LOCK_ENHANCEMENTS
if(FeatureManager::FeatureSupported(KFeatureIdSapDeviceLockEnhancements))
{
@@ -164,6 +169,25 @@
{
Dprint( (_L("CSCPServer::ConstructL(): Configration read OK") ));
}
+
+
+ //If Configuration is not validated already, validate it
+
+ if (!iConfiguration.iConfigChecked)
+ {
+ TInt valerr = KErrNone;
+ TRAP( valerr, ValidateConfigurationL( KSCPComplete ));
+ if (valerr != KErrNone)
+ {
+ Dprint( (_L("CSCPServer::ConstructL(): Configuration Validation failed: %d"), valerr ));
+ }
+ else
+ {
+ Dprint( (_L("CSCPServer::ConstructL(): Configuration Validation Passed")));
+ }
+ }
+
+
Dprint( (_L("CSCPServer::ConstructL(): Connecting to CenRep") ));
iALPeriodRep = CRepository::NewL( KCRUidSecuritySettings );
@@ -631,7 +655,21 @@
{
Dprint( (_L("--> CSCPServer::ValidateConfigurationL()") ));
- if ( iConfiguration.iConfigFlag == KSCPConfigOK )
+ RMobilePhone::TMobilePassword storedCode;
+ storedCode.Zero();
+ User::LeaveIfError(GetCode(storedCode));
+
+
+ Dprint( (_L("CSCPServer::ValidateConfigurationL(): Checking code: %s"), storedCode.PtrZ() ));
+ // Check that the ISA code is stored correctly
+ TRAPD( err, CheckISACodeL( storedCode ) );
+ //Bool for the correction of Defaultlockcode cenrep
+ TBool lCorrectDefaultlockcode = EFalse;
+
+ Dprint( (_L("CSCPServer::ValidateConfigurationL(): iConfigFlag = %d, iConfigChecked = %d"), iConfiguration.iConfigFlag, iConfiguration.iConfigChecked));
+
+ if ((iConfiguration.iConfigFlag == KSCPConfigOK)
+ && (iConfiguration.iConfigChecked) && (err == KErrNone))
{
// The configuration has already been checked, exit
Dprint( (_L("CSCPServer::ValidateConfigurationL(): Configuration is non-default.") ));
@@ -643,10 +681,7 @@
User::Leave( KErrAccessDenied );
}
- RMobilePhone::TMobilePassword storedCode;
- storedCode.Zero();
-
- User::LeaveIfError( GetCode( storedCode ) );
+
TInt hashedISAcode;
TSCPSecCode hashedCode;
//#ifdef __SAP_DEVICE_LOCK_ENHANCEMENTS
@@ -659,10 +694,13 @@
}
//#endif // __SAP_DEVICE_LOCK_ENHANCEMENTS
- Dprint( (_L("CSCPServer::ValidateConfigurationL(): Checking code: %s"), storedCode.PtrZ() ));
+
- // Check that the ISA code is stored correctly
- TRAPD( err, CheckISACodeL( storedCode ) );
+
+ if (err != KErrNone)
+ {
+ lCorrectDefaultlockcode = ETrue;
+ }
if ( err == KErrNone )
{
iConfiguration.iConfigFlag = KSCPConfigOK;
@@ -710,11 +748,42 @@
if ( StoreCode( hashedCode ) == KErrNone )
{
iConfiguration.iConfigFlag = KSCPConfigOK;
+ lCorrectDefaultlockcode = ETrue;
}
}
}
-}
+
+ //If Correction of Defaultlockcode cenrep is required for the mismatch between Config and ISA
+ if (lCorrectDefaultlockcode)
+ {
+ TInt lDefCode = -1;
+ CRepository* lRepository = CRepository::NewL(KCRUidSCPLockCode);
+ CleanupStack::PushL(lRepository);
+ TInt lRet = lRepository->Get(KSCPLockCodeDefaultLockCode,
+ lDefCode);
+ if (lRet == KErrNone && lDefCode != -1)
+ {
+ if (lDefCode == 12345)
+ {
+ //Although lock code is already set, due to some unexpected condition
+ //like C drive wipe, cenrep status is wrongly shown. Correcting it here.
+ lRepository->Set(KSCPLockCodeDefaultLockCode, 0);
+ Dprint( (_L("RSCPClient::ValidateConfigurationL(): Corrected the Default lock code cenrep status to 0") ));
+ }
+ else if (lDefCode == 0)
+ {
+ //If only ISA side is formatted, then the lock code on ISA side is default;
+ //Cenrep status remains wrongly as the lock code is already set. Correcting it here.
+ lRepository->Set(KSCPLockCodeDefaultLockCode, 12345);
+ Dprint( (_L("RSCPClient::ValidateConfigurationL(): Corrected the Default lock code cenrep status to 12345") ));
+ }
+ }
+ CleanupStack::PopAndDestroy(lRepository);
+ }
+ }
//#endif // __SAP_DEVICE_LOCK_ENHANCEMENTS
+ //Set the flag to True, after config is validated
+ iConfiguration.iConfigChecked = ETrue;
TRAPD( err2, iConfiguration.WriteSetupL() );
if ( err2 != KErrNone )
@@ -2475,9 +2544,7 @@
TBool CSCPServer::IsDeviceMemoryEncrypted()
{
Dprint(_L("CSCPServer::IsDeviceMemoryEncrypted >>"));
-
TBool ret(EFalse);
-
//First check if the feature is supported on device
TRAPD(ferr, FeatureManager::InitializeLibL());
if (ferr != KErrNone)
@@ -2489,42 +2556,74 @@
FeatureManager::UnInitializeLib();
//If feature is supported, check if any drive is encrypted.
+
+
+
if (ret)
{
- CDevEncSession* devEncSession = new CDevEncSession( EDriveC );
+ RLibrary library;
+ CDevEncSessionBase* devEncSession = NULL;
+ TInt err = library.Load(KDevEncCommonUtils);
+ if (err != KErrNone)
+ {
+ Dprint(_L("Error in finding the library... %d"), err);
+ ret = EFalse;
+ }
+ else
+ {
+ TLibraryFunction entry = library.Lookup(1);
+
+ if (!entry)
+ {
+ Dprint(_L("Error in loading the library..."));
+ ret = EFalse;
+ }
+ else
+ {
+ devEncSession = (CDevEncSessionBase*) entry();
+ Dprint(_L("Library is found and loaded successfully..."));
+ }
+ }
+
if (!devEncSession)
{
Dprint(_L("Can't instantiate device encryption session.."));
- return EFalse;
- }
-
- TInt err = devEncSession->Connect();
- if (err == KErrNone)
- {
- //Session with device encryption is established. Check if any drive is encrypted
- TInt encStatus (KErrNone);
- TInt err = devEncSession->DiskStatus( encStatus );
- Dprint(_L("err = %d, encstatus = %d"), err, encStatus);
- if ( err == KErrNone && encStatus != EDecrypted )
- {
- Dprint(_L("Memory is encrypted"));
- ret = ETrue;
- }
- else
- {
- Dprint(_L("Memory is not encrypted"));
- ret = EFalse;
- }
- }
- else
- {
- Dprint(_L("Error %d while establishing connection with device encryption engine"), err);
ret = EFalse;
}
-
- delete devEncSession; devEncSession = NULL;
- }
+ else
+ {
+ devEncSession->SetDrive( EDriveC );
+ TInt err = devEncSession->Connect();
+ if (err == KErrNone)
+ {
+ //Session with device encryption is established. Check if any drive is encrypted
+ TInt encStatus (KErrNone);
+ TInt err = devEncSession->DiskStatus( encStatus );
+ devEncSession->Close();
+ Dprint(_L("err = %d, encstatus = %d"), err, encStatus);
+ if ( err == KErrNone && encStatus != EDecrypted )
+ {
+ Dprint(_L("Memory is encrypted"));
+ ret = ETrue;
+ }
+ else
+ {
+ Dprint(_L("Memory is not encrypted"));
+ ret = EFalse;
+ }
+ }
+ else
+ {
+ Dprint(_L("Error %d while establishing connection with device encryption engine"), err);
+ ret = EFalse;
+ }
+ }
+ delete devEncSession; devEncSession = NULL;
+
+ if (library.Handle())
+ library.Close();
+ }
Dprint(_L("CSCPServer::IsDeviceMemoryEncrypted, ret = %d <<"), ret);
return ret;
--- a/terminalsecurity/SCP/SCPTimestampPlugin/inc/SCPTimestampPlugin.h Mon Mar 15 12:43:15 2010 +0200
+++ b/terminalsecurity/SCP/SCPTimestampPlugin/inc/SCPTimestampPlugin.h Wed Mar 31 23:00:03 2010 +0300
@@ -51,6 +51,8 @@
const TInt KSCPTypeHours = 1;
const TInt KSCPTypeDays = 2;
+const TInt KSCPNoteTimeout = 2000000;
+
_LIT( KSCPTSConfigFile, "SCPTimestampPlugin.ini");
_LIT( KDriveZ, "Z:" );
_LIT(KSCPTimestampPluginResFilename, "\\Resource\\SCPTimestampPluginLang.rsc");
--- a/terminalsecurity/SCP/SCPTimestampPlugin/src/SCPTimestampPlugin.cpp Mon Mar 15 12:43:15 2010 +0200
+++ b/terminalsecurity/SCP/SCPTimestampPlugin/src/SCPTimestampPlugin.cpp Wed Mar 31 23:00:03 2010 +0300
@@ -580,22 +580,19 @@
HBufC16* resText = NULL;
TRAPD( err, resText = LoadResourceL( R_SET_SEC_CODE_AGING ) );
FormatResourceString(*resText);
- if (err == KErrNone) // If this fails, go on anyway to signal the psw change
+ if ( err == KErrNone ) // If this fails, go on anyway to signal the psw change
{
- TPtr16 bufDes = resText->Des();
- TRequestStatus userResponse;
-
- CAknGlobalNote* note = CAknGlobalNote::NewLC();
+ TPtr16 bufDes = resText->Des();
+
TRAP_IGNORE(
- note->SetSoftkeys(R_AVKON_SOFTKEYS_OK_EMPTY);
- note->ShowNoteL(userResponse, EAknGlobalWarningNote,
- bufDes);
- );
-
- // Wait for the User Response
- User::WaitForRequest(userResponse);
- CleanupStack::PopAndDestroy(note);
-
+ CAknGlobalNote* note = CAknGlobalNote::NewLC();
+ note->ShowNoteL( EAknGlobalWarningNote, bufDes );
+ CleanupStack::PopAndDestroy( note );
+ );
+
+ // Wait here a while so the dialog won't appear on top of the note
+ User::After( KSCPNoteTimeout );
+
delete resText;
}
--- a/terminalsecurity/SCP/SCPTimestampPlugin/src/SCPUserInf.cpp Mon Mar 15 12:43:15 2010 +0200
+++ b/terminalsecurity/SCP/SCPTimestampPlugin/src/SCPUserInf.cpp Wed Mar 31 23:00:03 2010 +0300
@@ -17,15 +17,15 @@
#include "SCPUserInf.h"
#include <SCPTimestampPluginLang.rsg>
-#include <AknGlobalConfirmationQuery.h>
-//#include <AknNoteDialog.h>
-#include <aknglobalnote.h>
+
+#include <AknGlobalNote.h>
+#include <aknnotewrappers.h>
#include "SCPDebug.h"
#include <hal.h>
// For wipe
-#include <StarterClient.h>
-#include <SysLangUtil.h>
+#include <starterclient.h>
+#include <syslangutil.h>
#include <rfsClient.h>
#include "DMUtilClient.h"
CSCPUserInf::CSCPUserInf() :
@@ -100,17 +100,15 @@
{
Dprint( (_L("CSCPUserInf::EGlobalConf") ));
TRAP_IGNORE(
- CAknGlobalConfirmationQuery* note = CAknGlobalConfirmationQuery::NewLC();
+ TRequestStatus status;
TPtr16 bufDes = idispText->Des();
- TRequestStatus status;
- note->ShowConfirmationQueryL(status,
- bufDes,
- R_AVKON_SOFTKEYS_OK_EMPTY,
- R_QGN_NOTE_WARNING_ANIM );
- Dprint( (_L("CSCPUserInf::WaitforReq") ));
+ CAknGlobalNote* lInfoNote = CAknGlobalNote :: NewLC();
+ lInfoNote->SetSoftkeys(R_AVKON_SOFTKEYS_OK_EMPTY__OK);
+ lInfoNote->SetAnimation(R_QGN_NOTE_WARNING_ANIM);
+ lInfoNote->ShowNoteL(status, EAknGlobalInformationNote, bufDes);
+ lInfoNote->SetPriority(ECoeWinPriorityAlwaysAtFront + 1);
User::WaitForRequest( status );
- Dprint( (_L("CSCPUserInf::WaitforReq done") ));
- CleanupStack::PopAndDestroy( note );
+ CleanupStack::PopAndDestroy(1); // note
);
}
else if (iState == ERfs)
--- a/terminalsecurity/server/group/TerminalControlServer.mmp Mon Mar 15 12:43:15 2010 +0200
+++ b/terminalsecurity/server/group/TerminalControlServer.mmp Wed Mar 31 23:00:03 2010 +0300
@@ -56,6 +56,5 @@
LIBRARY charconv.lib
LIBRARY flogger.lib
LIBRARY featmgr.lib
-LIBRARY devenccommonutils.lib // Device encryption utility
SMPSAFE
\ No newline at end of file
--- a/terminalsecurity/server/src/TerminalControlSession.cpp Mon Mar 15 12:43:15 2010 +0200
+++ b/terminalsecurity/server/src/TerminalControlSession.cpp Wed Mar 31 23:00:03 2010 +0300
@@ -30,7 +30,7 @@
#include "TcTrustedSession.h"
//Device encryption utility
#include <DevEncEngineConstants.h>
-#include <DevEncSession.h>
+#include <DevEncSessionBase.h>
//Feature manager
#include <featmgr.h>
//For debugging purpose
@@ -1411,9 +1411,7 @@
TBool CTerminalControlSession::IsDeviceMemoryEncrypted()
{
RDEBUG("CTerminalControlSession::IsDeviceMemoryEncrypted >>");
-
TBool ret(EFalse);
-
//First check if the feature is supported on device
TRAPD(ferr, FeatureManager::InitializeLibL());
if (ferr != KErrNone)
@@ -1425,43 +1423,73 @@
FeatureManager::UnInitializeLib();
//If feature is supported, check if any drive is encrypted.
+
if (ret)
{
- CDevEncSession* devEncSession = new CDevEncSession( EDriveC );
+ RLibrary library;
+ CDevEncSessionBase* devEncSession = NULL;
+ TInt err = library.Load(KDevEncCommonUtils);
+ if (err != KErrNone)
+ {
+ RDEBUG_2("Error in finding the library... %d", err);
+ ret = EFalse;
+ }
+ else
+ {
+ TLibraryFunction entry = library.Lookup(1);
+
+ if (!entry)
+ {
+ RDEBUG("Error in loading the library...");
+ ret = EFalse;
+ }
+ else
+ {
+ devEncSession = (CDevEncSessionBase*) entry();
+ RDEBUG("Library is found and loaded successfully...");
+ }
+ }
+
if (!devEncSession)
{
RDEBUG("Can't instantiate device encryption session..");
- return EFalse;
- }
-
- TInt err = devEncSession->Connect();
- if (KErrNone == err)
- {
- //Session with device encryption is established. Check if any drive is encrypted
- TInt encStatus (KErrNone);
- TInt err = devEncSession->DiskStatus( encStatus );
- RDEBUG_3("err = %d, encstatus = %d", err, encStatus);
- if ( KErrNone == err && encStatus != EDecrypted )
- {
- RDEBUG("Memory is encrypted");
- ret = ETrue;
- }
- else
- {
- RDEBUG("Memory is not encrypted");
- ret = EFalse;
- }
- }
- else
- {
- RDEBUG_2("Error %d while establishing connection with device encryption engine", err);
ret = EFalse;
}
-
- delete devEncSession; devEncSession = NULL;
- }
-
+ else
+ {
+ devEncSession->SetDrive( EDriveC );
+ TInt err = devEncSession->Connect();
+ if (err == KErrNone)
+ {
+ //Session with device encryption is established. Check if any drive is encrypted
+ TInt encStatus (KErrNone);
+ TInt err = devEncSession->DiskStatus( encStatus );
+ devEncSession->Close();
+ RDEBUG_2("encstatus = %d", encStatus);
+ if ( err == KErrNone && encStatus != EDecrypted )
+ {
+ RDEBUG("Memory is encrypted");
+ ret = ETrue;
+ }
+ else
+ {
+ RDEBUG("Memory is not encrypted");
+ ret = EFalse;
+ }
+ }
+ else
+ {
+ RDEBUG_2("Error %d while establishing connection with device encryption engine", err);
+ ret = EFalse;
+ }
+ }
+ delete devEncSession; devEncSession = NULL;
+
+ if (library.Handle())
+ library.Close();
+
+ }
RDEBUG_2("CTerminalControlSession::IsDeviceMemoryEncrypted, ret = %d <<", ret);
return ret;
}