syncmlfw/common/syncagent/src/NSmlAgentBase.cpp
branchRCL_3
changeset 21 504e41245867
parent 19 86979fe66c4c
child 34 696f5dd11939
equal deleted inserted replaced
19:86979fe66c4c 21:504e41245867
    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>
   119 // CNSmlAgentBase::BasicCredentialL
   119 // CNSmlAgentBase::BasicCredentialL
   120 // Creates B64 string form SyncML userID and password 
   120 // Creates B64 string form SyncML userID and password 
   121 // ---------------------------------------------------------
   121 // ---------------------------------------------------------
   122 HBufC8* CNSmlAgentBase::BasicCredentialL() const
   122 HBufC8* CNSmlAgentBase::BasicCredentialL() const
   123 	{
   123 	{
   124 	TImCodecB64 B64Coder;
   124 	TBase64 B64Coder;
   125 	HBufC8* userName;
   125 	HBufC8* userName;
   126 	NSmlUnicodeConverter::HBufC8InUTF8LC( *iSyncMLUserName, userName );
   126 	NSmlUnicodeConverter::HBufC8InUTF8LC( *iSyncMLUserName, userName );
   127 	HBufC8* password;
   127 	HBufC8* password;
   128 	NSmlUnicodeConverter::HBufC8InUTF8LC( *iSyncMLPassword, password );
   128 	NSmlUnicodeConverter::HBufC8InUTF8LC( *iSyncMLPassword, password );
   129 	_LIT8( KColon, ":" );
   129 	_LIT8( KColon, ":" );
   147 HBufC8* CNSmlAgentBase::Md5CredentialL( TBool aServerAuth ) const
   147 HBufC8* CNSmlAgentBase::Md5CredentialL( TBool aServerAuth ) const
   148 	{
   148 	{
   149 
   149 
   150 	CMD5* md5 = CMD5::NewL();
   150 	CMD5* md5 = CMD5::NewL();
   151 	CleanupStack::PushL( md5 );
   151 	CleanupStack::PushL( md5 );
   152 	TImCodecB64 B64Coder;
   152 	TBase64 B64Coder;
   153 	HBufC8* userName;
   153 	HBufC8* userName;
   154 	if ( aServerAuth )
   154 	if ( aServerAuth )
   155 		{
   155 		{
   156 		NSmlUnicodeConverter::HBufC8InUTF8LC( ServerUserName(), userName );
   156 		NSmlUnicodeConverter::HBufC8InUTF8LC( ServerUserName(), userName );
   157 		}
   157 		}
  1109 		TPtrC8 chalFormat;
  1109 		TPtrC8 chalFormat;
  1110 		chalFormat.Set( aResponseController.ChalFormat( aEntryID ) );
  1110 		chalFormat.Set( aResponseController.ChalFormat( aEntryID ) );
  1111 		if ( chalFormat == KNSmlAgentBase64Format )
  1111 		if ( chalFormat == KNSmlAgentBase64Format )
  1112 			{
  1112 			{
  1113 			//decode before saving
  1113 			//decode before saving
  1114 			TImCodecB64 B64Coder;
  1114 			TBase64 B64Coder;
  1115 			B64Coder.Decode( chalNextNonce, nextNonceDecodedPtr );
  1115 			B64Coder.Decode( chalNextNonce, nextNonceDecodedPtr );
  1116 			}
  1116 			}
  1117 		else
  1117 		else
  1118 			{
  1118 			{
  1119 			*nextNonceDecoded = chalNextNonce;
  1119 			*nextNonceDecoded = chalNextNonce;