syncmlfw/common/syncagent/src/NSmlAgentBase.cpp
changeset 24 bf47f3b79154
parent 1 a9c0ce913924
child 32 5d0ec111abfc
equal deleted inserted replaced
22:19fb38abab1d 24:bf47f3b79154
    18 
    18 
    19 // INCLUDE FILES
    19 // INCLUDE FILES
    20 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
    20 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
    21 #include <es_enum_partner.h>
    21 #include <es_enum_partner.h>
    22 #endif
    22 #endif
    23 #include <imcvcodc.h>
    23 #include <tconvbase64.h>
    24 #include <hash.h>
    24 #include <hash.h>
    25 #include <SyncMLHistory.h>
    25 #include <SyncMLHistory.h>
    26 #include <nsmlconstants.h>
    26 #include <nsmlconstants.h>
    27 #include <nsmldebug.h>
    27 #include <nsmldebug.h>
    28 #include <nsmldefines.h>
    28 #include <nsmldefines.h>
   118 // CNSmlAgentBase::BasicCredentialL
   118 // CNSmlAgentBase::BasicCredentialL
   119 // Creates B64 string form SyncML userID and password 
   119 // Creates B64 string form SyncML userID and password 
   120 // ---------------------------------------------------------
   120 // ---------------------------------------------------------
   121 HBufC8* CNSmlAgentBase::BasicCredentialL() const
   121 HBufC8* CNSmlAgentBase::BasicCredentialL() const
   122 	{
   122 	{
   123 	TImCodecB64 B64Coder;
   123 	TBase64 B64Coder;
   124 	HBufC8* userName;
   124 	HBufC8* userName;
   125 	NSmlUnicodeConverter::HBufC8InUTF8LC( *iSyncMLUserName, userName );
   125 	NSmlUnicodeConverter::HBufC8InUTF8LC( *iSyncMLUserName, userName );
   126 	HBufC8* password;
   126 	HBufC8* password;
   127 	NSmlUnicodeConverter::HBufC8InUTF8LC( *iSyncMLPassword, password );
   127 	NSmlUnicodeConverter::HBufC8InUTF8LC( *iSyncMLPassword, password );
   128 	_LIT8( KColon, ":" );
   128 	_LIT8( KColon, ":" );
   146 HBufC8* CNSmlAgentBase::Md5CredentialL( TBool aServerAuth ) const
   146 HBufC8* CNSmlAgentBase::Md5CredentialL( TBool aServerAuth ) const
   147 	{
   147 	{
   148 
   148 
   149 	CMD5* md5 = CMD5::NewL();
   149 	CMD5* md5 = CMD5::NewL();
   150 	CleanupStack::PushL( md5 );
   150 	CleanupStack::PushL( md5 );
   151 	TImCodecB64 B64Coder;
   151 	TBase64 B64Coder;
   152 	HBufC8* userName;
   152 	HBufC8* userName;
   153 	if ( aServerAuth )
   153 	if ( aServerAuth )
   154 		{
   154 		{
   155 		NSmlUnicodeConverter::HBufC8InUTF8LC( ServerUserName(), userName );
   155 		NSmlUnicodeConverter::HBufC8InUTF8LC( ServerUserName(), userName );
   156 		}
   156 		}
  1108 		TPtrC8 chalFormat;
  1108 		TPtrC8 chalFormat;
  1109 		chalFormat.Set( aResponseController.ChalFormat( aEntryID ) );
  1109 		chalFormat.Set( aResponseController.ChalFormat( aEntryID ) );
  1110 		if ( chalFormat == KNSmlAgentBase64Format )
  1110 		if ( chalFormat == KNSmlAgentBase64Format )
  1111 			{
  1111 			{
  1112 			//decode before saving
  1112 			//decode before saving
  1113 			TImCodecB64 B64Coder;
  1113 			TBase64 B64Coder;
  1114 			B64Coder.Decode( chalNextNonce, nextNonceDecodedPtr );
  1114 			B64Coder.Decode( chalNextNonce, nextNonceDecodedPtr );
  1115 			}
  1115 			}
  1116 		else
  1116 		else
  1117 			{
  1117 			{
  1118 			*nextNonceDecoded = chalNextNonce;
  1118 			*nextNonceDecoded = chalNextNonce;