backupandrestore/backupengine/src/sbencrypt.cpp
changeset 47 63cf70d3ecd8
parent 0 d0791faffa3f
equal deleted inserted replaced
44:a5deb6b96675 47:63cf70d3ecd8
    19  @file
    19  @file
    20  @released
    20  @released
    21 */
    21 */
    22 #include "sbencrypt.h"
    22 #include "sbencrypt.h"
    23 #include "sbencryptimpl.h"
    23 #include "sbencryptimpl.h"
       
    24 #include "OstTraceDefinitions.h"
       
    25 #include "sbtrace.h"
       
    26 #ifdef OST_TRACE_COMPILER_IN_USE
       
    27 #include "sbencryptTraces.h"
       
    28 #endif
    24 
    29 
    25 namespace conn
    30 namespace conn
    26 	{
    31 	{
    27 	EXPORT_C CSecureBUREncryptKeySource* CSecureBUREncryptKeySource::NewL()
    32 	EXPORT_C CSecureBUREncryptKeySource* CSecureBUREncryptKeySource::NewL()
    28 		{
    33 		{
       
    34 		OstTraceFunctionEntry0( CSECUREBURENCRYPTKEYSOURCE_NEWL_ENTRY );
    29 		CSecureBUREncryptKeySource* pSelf = new CSecureBUREncryptKeySource();
    35 		CSecureBUREncryptKeySource* pSelf = new CSecureBUREncryptKeySource();
    30 		CleanupStack::PushL(pSelf);
    36 		CleanupStack::PushL(pSelf);
    31 		pSelf->ConstructL();
    37 		pSelf->ConstructL();
    32 		CleanupStack::Pop(pSelf);
    38 		CleanupStack::Pop(pSelf);
    33 		
    39 		
       
    40 		OstTraceFunctionExit0( CSECUREBURENCRYPTKEYSOURCE_NEWL_EXIT );
    34 		return pSelf;
    41 		return pSelf;
    35 		}
    42 		}
    36 
    43 
    37 	CSecureBUREncryptKeySource::CSecureBUREncryptKeySource()
    44 	CSecureBUREncryptKeySource::CSecureBUREncryptKeySource()
    38 	/**
    45 	/**
    39 	C++ constructor
    46 	C++ constructor
    40 	*/
    47 	*/
    41 		{
    48 		{
       
    49 		OstTraceFunctionEntry0( CSECUREBURENCRYPTKEYSOURCE_CSECUREBURENCRYPTKEYSOURCE_CONS_ENTRY );
       
    50 		OstTraceFunctionExit0( CSECUREBURENCRYPTKEYSOURCE_CSECUREBURENCRYPTKEYSOURCE_CONS_EXIT );
    42 		}
    51 		}
    43 		
    52 		
    44 	EXPORT_C CSecureBUREncryptKeySource::~CSecureBUREncryptKeySource()
    53 	EXPORT_C CSecureBUREncryptKeySource::~CSecureBUREncryptKeySource()
    45 		{
    54 		{
       
    55 		OstTraceFunctionEntry0( CSECUREBURENCRYPTKEYSOURCE_CSECUREBURENCRYPTKEYSOURCE_DES_ENTRY );
    46 		delete iImpl;
    56 		delete iImpl;
       
    57 		iImpl = NULL;
       
    58 		OstTraceFunctionExit0( CSECUREBURENCRYPTKEYSOURCE_CSECUREBURENCRYPTKEYSOURCE_DES_EXIT );
    47 		}
    59 		}
    48 
    60 
    49 	void CSecureBUREncryptKeySource::ConstructL()
    61 	void CSecureBUREncryptKeySource::ConstructL()
    50 	/**
    62 	/**
    51 	Symbian 2nd phase construction
    63 	Symbian 2nd phase construction
    52 	*/
    64 	*/
    53 		{
    65 		{
       
    66 		OstTraceFunctionEntry0( CSECUREBURENCRYPTKEYSOURCE_CONSTRUCTL_ENTRY );
    54 		iImpl = CSecureBURKeySourceImpl::NewL();
    67 		iImpl = CSecureBURKeySourceImpl::NewL();
       
    68 		OstTraceFunctionExit0( CSECUREBURENCRYPTKEYSOURCE_CONSTRUCTL_EXIT );
    55 		}
    69 		}
    56 
    70 
    57 	EXPORT_C void CSecureBUREncryptKeySource::GetDefaultBufferForBackupL(TDriveNumber aDrive, 
    71 	EXPORT_C void CSecureBUREncryptKeySource::GetDefaultBufferForBackupL(TDriveNumber aDrive, 
    58 																TBool& aGotBuffer, 
    72 																TBool& aGotBuffer, 
    59 																TDes& aBuffer)
    73 																TDes& aBuffer)
    60 		{
    74 		{
       
    75 		OstTraceFunctionEntry0( CSECUREBURENCRYPTKEYSOURCE_GETDEFAULTBUFFERFORBACKUPL_ENTRY );
    61 		iImpl->GetDefaultBufferForBackupL(aDrive, aGotBuffer, aBuffer);
    76 		iImpl->GetDefaultBufferForBackupL(aDrive, aGotBuffer, aBuffer);
       
    77 		OstTraceFunctionExit0( CSECUREBURENCRYPTKEYSOURCE_GETDEFAULTBUFFERFORBACKUPL_EXIT );
    62 		}
    78 		}
    63 
    79 
    64 
    80 
    65 
    81 
    66 	EXPORT_C void CSecureBUREncryptKeySource::GetBackupKeyL(TDriveNumber aDrive, TSecureId aSID,
    82 	EXPORT_C void CSecureBUREncryptKeySource::GetBackupKeyL(TDriveNumber aDrive, TSecureId aSID,
    67 	                            		  	   TBool &aDoEncrypt, TDes8& aKey,
    83 	                            		  	   TBool &aDoEncrypt, TDes8& aKey,
    68 	                            		  	   TBool& aGotBuffer, TDes& aBuffer)
    84 	                            		  	   TBool& aGotBuffer, TDes& aBuffer)
    69 		{
    85 		{
       
    86 		OstTraceFunctionEntry0( CSECUREBURENCRYPTKEYSOURCE_GETBACKUPKEYL_ENTRY );
    70 		iImpl->GetBackupKeyL(aDrive, aSID, aDoEncrypt, aKey, aGotBuffer, aBuffer);
    87 		iImpl->GetBackupKeyL(aDrive, aSID, aDoEncrypt, aKey, aGotBuffer, aBuffer);
       
    88 		OstTraceFunctionExit0( CSECUREBURENCRYPTKEYSOURCE_GETBACKUPKEYL_EXIT );
    71 		}
    89 		}
    72 
    90 
    73 
    91 
    74 
    92 
    75 	EXPORT_C void CSecureBUREncryptKeySource::GetRestoreKeyL(TDriveNumber aDrive, TSecureId aSID, 
    93 	EXPORT_C void CSecureBUREncryptKeySource::GetRestoreKeyL(TDriveNumber aDrive, TSecureId aSID, 
    76 	                             				TBool aGotBuffer, TDes& aBuffer,
    94 	                             				TBool aGotBuffer, TDes& aBuffer,
    77 	                             				TBool &aGotKey, TDes8& aKey)
    95 	                             				TBool &aGotKey, TDes8& aKey)
    78 		{
    96 		{
       
    97 		OstTraceFunctionEntry0( CSECUREBURENCRYPTKEYSOURCE_GETRESTOREKEYL_ENTRY );
    79 		iImpl->GetRestoreKeyL(aDrive, aSID, aGotBuffer, aBuffer, aGotKey, aKey);
    98 		iImpl->GetRestoreKeyL(aDrive, aSID, aGotBuffer, aBuffer, aGotKey, aKey);
       
    99 		OstTraceFunctionExit0( CSECUREBURENCRYPTKEYSOURCE_GETRESTOREKEYL_EXIT );
    80 		}
   100 		}
    81 	}
   101 	}
    82 
   102