equal
deleted
inserted
replaced
296 { |
296 { |
297 #ifdef _DEBUG |
297 #ifdef _DEBUG |
298 iTransportMain.WriteToLog( _L8( "CXcapHttpAuthManager::RequestDigestLC()" ) ); |
298 iTransportMain.WriteToLog( _L8( "CXcapHttpAuthManager::RequestDigestLC()" ) ); |
299 #endif |
299 #endif |
300 HBufC8* ret = NULL; |
300 HBufC8* ret = NULL; |
301 TPtrC8 nonce( iServerNonce->Des() ); |
|
302 if( iQop == EXcapAuth || iQop == EXcapAuthInt ) |
301 if( iQop == EXcapAuth || iQop == EXcapAuthInt ) |
303 { |
302 { |
304 TBuf8<8> nonceCount; |
303 TBuf8<8> nonceCount; |
305 TBuf8<KXcapHashLength> hashBush; |
304 TBuf8<KXcapHashLength> hashBush; |
306 nonceCount.AppendFormat( _L8( "%08x" ), iNonceCount ); |
305 nonceCount.AppendFormat( _L8( "%08x" ), iNonceCount ); |
307 TPtrC8 nonce( iServerNonce->Des() ); |
306 TPtrC8 nonce( iServerNonce ? iServerNonce->Des() : TPtrC8() ); |
308 TPtrC8 qop( iQop == EXcapAuth ? _L8( "auth" ) : _L8( "auth-int" ) ); |
307 TPtrC8 qop( iQop == EXcapAuth ? _L8( "auth" ) : _L8( "auth-int" ) ); |
309 HBufC8* stringToHash = HBufC8::NewLC( nonce.Length() + qop.Length() + |
308 HBufC8* stringToHash = HBufC8::NewLC( nonce.Length() + qop.Length() + |
310 3 * KXcapHashLength + 8 + 5 ); |
309 3 * KXcapHashLength + 8 + 5 ); |
311 TPtr8 desc( stringToHash->Des() ); |
310 TPtr8 desc( stringToHash->Des() ); |
312 ConstructHA1L( desc ); |
311 ConstructHA1L( desc ); |
319 desc.Append(':'); |
318 desc.Append(':'); |
320 desc.Append( qop ); |
319 desc.Append( qop ); |
321 desc.Append(':'); |
320 desc.Append(':'); |
322 ConstructHA2L( hashBush, aHttpRequest ); |
321 ConstructHA2L( hashBush, aHttpRequest ); |
323 desc.Append( hashBush ); |
322 desc.Append( hashBush ); |
324 hashBush.Zero(); |
323 hashBush.Zero(); |
325 ret = HBufC8::NewL( KXcapHashLength ); |
324 ret = HBufC8::NewL( KXcapHashLength ); |
326 Hash( *stringToHash, hashBush ); |
325 Hash( *stringToHash, hashBush ); |
327 ret->Des().Copy( hashBush ); |
326 ret->Des().Copy( hashBush ); |
328 CleanupStack::PopAndDestroy(); //stringToHash |
327 CleanupStack::PopAndDestroy(); //stringToHash |
329 CleanupStack::PushL( ret ); |
328 CleanupStack::PushL( ret ); |
507 void CXcapHttpAuthManager::ConstructHA1L( TDes8& aResult ) |
506 void CXcapHttpAuthManager::ConstructHA1L( TDes8& aResult ) |
508 { |
507 { |
509 #ifdef _DEBUG |
508 #ifdef _DEBUG |
510 iTransportMain.WriteToLog( _L8( "CXcapHttpAuthManager::ConstructHA1L()" ) ); |
509 iTransportMain.WriteToLog( _L8( "CXcapHttpAuthManager::ConstructHA1L()" ) ); |
511 #endif |
510 #endif |
|
511 |
|
512 TPtrC8 realm( iRealm ? iRealm->Des() : TPtrC8() ); |
|
513 |
512 HBufC8* buffer = HBufC8::NewLC( iUserName.Length() + |
514 HBufC8* buffer = HBufC8::NewLC( iUserName.Length() + |
513 iPassword.Length() + iRealm->Des().Length() + 2 ); |
515 iPassword.Length() + realm.Length() + 2 ); |
514 TPtr8 desc( buffer->Des() ); |
516 TPtr8 desc( buffer->Des() ); |
515 desc.Copy( iUserName ); |
517 desc.Copy( iUserName ); |
516 desc.Append(':'); |
518 desc.Append(':'); |
517 desc.Append( iRealm->Des() ); |
519 desc.Append( realm ); |
518 desc.Append(':'); |
520 desc.Append(':'); |
519 desc.Append( iPassword ); |
521 desc.Append( iPassword ); |
520 Hash( *buffer, aResult ); |
522 Hash( *buffer, aResult ); |
521 CleanupStack::PopAndDestroy(); //buffer |
523 CleanupStack::PopAndDestroy(); //buffer |
522 } |
524 } |
523 |
525 |
524 // ---------------------------------------------------------- |
526 // ---------------------------------------------------------- |
525 // CXcapHttpAuthManager::ConstructHA2L |
527 // CXcapHttpAuthManager::ConstructHA2L |
526 // |
528 // |