Revision: 201021 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 09 Jun 2010 10:37:30 +0300
branchRCL_3
changeset 34 696f5dd11939
parent 30 2de6635c154b
child 42 490439ac0bd4
Revision: 201021 Kit: 2010123
policymanagement/pmdmadapter/src/pmadapter.cpp
policymanagement/policyengine/policyengineserver/src/TrustedSession.cpp
syncmlfw/common/syncagent/src/NSmlAgentBase.cpp
syncmlfw/common/syncagent/src/nsmlauth.cpp
syncmlfw/dm/provisioningadapter/inc/NSmlDmProvisioningAdapter.h
syncmlfw/dm/provisioningadapter/src/NSmlDmProvisioningAdapter.cpp
terminalsecurity/SCP/SCPClient/src/SCPQueryDialog.cpp
terminalsecurity/SCP/SCPTimestampPlugin/src/SCPTimestampPlugin.cpp
--- a/policymanagement/pmdmadapter/src/pmadapter.cpp	Tue May 25 13:36:17 2010 +0300
+++ b/policymanagement/pmdmadapter/src/pmadapter.cpp	Wed Jun 09 10:37:30 2010 +0300
@@ -771,7 +771,7 @@
 				TBase64 B64Coder;
 				HBufC8 *target = HBufC8::NewLC( ( size * 6 ) / 3 );
 				TPtr8 targetPtr( target->Des() );
-				B64Coder.Encode( *data, targetPtr ); 
+				B64Coder.PortableEncode( *data, targetPtr ); 
 				object->InsertL( 0, ptr );
 				CleanupStack::PopAndDestroy( 3, &fs );
 				ret = EOk;
--- a/policymanagement/policyengine/policyengineserver/src/TrustedSession.cpp	Tue May 25 13:36:17 2010 +0300
+++ b/policymanagement/policyengine/policyengineserver/src/TrustedSession.cpp	Wed Jun 09 10:37:30 2010 +0300
@@ -475,7 +475,7 @@
 	TBase64 base64;
 	HBufC8 * base64coded = HBufC8::NewLC( pck.Length() * 3);
 	TPtr8 base64Ptr = base64coded->Des();
-	User::LeaveIfError( base64.Encode( pck, base64Ptr));	
+	User::LeaveIfError( base64.PortableEncode( pck, base64Ptr));	
 
 	CAttributeValue * aliasValue = CAttributeValue::NewL( base64Ptr, PolicyLanguage::NativeLanguage::AttributeValues::StringDataType);
 	CleanupStack::PopAndDestroy( base64coded);
--- a/syncmlfw/common/syncagent/src/NSmlAgentBase.cpp	Tue May 25 13:36:17 2010 +0300
+++ b/syncmlfw/common/syncagent/src/NSmlAgentBase.cpp	Wed Jun 09 10:37:30 2010 +0300
@@ -134,7 +134,7 @@
 	clearTextPtr += *password;
 	HBufC8* B64String = HBufC8::NewLC( clearText->Length() * 2 );
 	TPtr8 B64StringPtr( B64String->Des() );
-	User::LeaveIfError( B64Coder.Encode( *clearText, B64StringPtr ) );
+	User::LeaveIfError( B64Coder.PortableEncode( *clearText, B64StringPtr ) );
 	CleanupStack::Pop(); // B64String
 	CleanupStack::PopAndDestroy( 3 ); //clearText, password, userName
 	return B64String;
@@ -191,7 +191,7 @@
 	userNamePasswordHash.Set( md5->Hash( *userNamePassword ) );
 	HBufC8* B64UserNamePasswordString = HBufC8::NewLC( userNamePasswordHash.Length() * 2 );
 	TPtr8 B64UserNamePasswordStringPtr( B64UserNamePasswordString->Des() );
-	User::LeaveIfError( B64Coder.Encode( userNamePasswordHash, B64UserNamePasswordStringPtr ) );
+	User::LeaveIfError( B64Coder.PortableEncode( userNamePasswordHash, B64UserNamePasswordStringPtr ) );
 	HBufC8* userNamePasswordNonce = HBufC8::NewLC( B64UserNamePasswordStringPtr.Length() + KColon.iTypeLength + nonce->Length() );
 	TPtr8 userNamePasswordNoncePtr = userNamePasswordNonce->Des();
 	userNamePasswordNoncePtr = B64UserNamePasswordStringPtr;
@@ -203,7 +203,7 @@
 	finalHash.Set( md5->Hash( *userNamePasswordNonce ) );
 	HBufC8* B64String = HBufC8::NewLC( finalHash.Length() * 2 );
 	TPtr8 B64StringPtr( B64String->Des() );
-	User::LeaveIfError( B64Coder.Encode( finalHash, B64StringPtr ) );
+	User::LeaveIfError( B64Coder.PortableEncode( finalHash, B64StringPtr ) );
 	CleanupStack::Pop();   // B64String
 	CleanupStack::PopAndDestroy( 8 ); //userNamePasswordNonce, B64userNamePasswordNonce, userNamePassword, nonce, nonceInUnicode, password, userName, md5
 	return  B64String;
--- a/syncmlfw/common/syncagent/src/nsmlauth.cpp	Tue May 25 13:36:17 2010 +0300
+++ b/syncmlfw/common/syncagent/src/nsmlauth.cpp	Wed Jun 09 10:37:30 2010 +0300
@@ -177,7 +177,7 @@
 	iB64Nonce = NULL;
 	iB64Nonce = HBufC8::NewL( iNonce->Length() * 2 + 1 );
 	TPtr8 B64NoncePtr( iB64Nonce->Des() );
-	User::LeaveIfError( B64Coder.Encode( *iNonce, B64NoncePtr ) );
+	User::LeaveIfError( B64Coder.PortableEncode( *iNonce, B64NoncePtr ) );
 	return *iB64Nonce;
 	}
 
@@ -272,7 +272,7 @@
 		TBase64 B64Coder;
 		B64Cred = HBufC8::NewLC( iCredential->Length() * 2 + 1 );
 		TPtr8 B64CredPtr( B64Cred->Des() );
-		User::LeaveIfError( B64Coder.Encode( *iCredential, B64CredPtr ) );
+		User::LeaveIfError( B64Coder.PortableEncode( *iCredential, B64CredPtr ) );
 		}
 	else
 		{
--- a/syncmlfw/dm/provisioningadapter/inc/NSmlDmProvisioningAdapter.h	Tue May 25 13:36:17 2010 +0300
+++ b/syncmlfw/dm/provisioningadapter/inc/NSmlDmProvisioningAdapter.h	Wed Jun 09 10:37:30 2010 +0300
@@ -164,6 +164,7 @@
 		RSyncMLSession iSession;
 		TUint iInitSession;
 		TUint iAuthSecretLimitIndicator;
+		TBool iLock;
 	};
 
 #endif	// NSMLDMPROVISIONINGADAPTER_H
--- a/syncmlfw/dm/provisioningadapter/src/NSmlDmProvisioningAdapter.cpp	Tue May 25 13:36:17 2010 +0300
+++ b/syncmlfw/dm/provisioningadapter/src/NSmlDmProvisioningAdapter.cpp	Wed Jun 09 10:37:30 2010 +0300
@@ -59,6 +59,7 @@
 // -----------------------------------------------------------------------------
 void CNSmlDmProvisioningAdapter::ConstructL()
 	{
+    iLock = EFalse;
 	iSession.OpenL();
 	FeatureManager::InitializeLibL();
 	}
@@ -217,9 +218,8 @@
 		TInt isprofilelocked=profile.ProfileLocked(EFalse, EFalse);
 		if (isprofilelocked == 1)
 		 {
-		  
-      profile.Close(); 
-      User::Leave(KErrAccessDenied); 	 	
+            profile.ProfileLocked(ETrue, EFalse);
+            iLock = ETrue;	 	
 		 }
 		
 		}
@@ -259,6 +259,14 @@
 	    }
 		    
 	// creates profile -> must be done before opening the connection
+
+	
+	if(iLock)
+	    {
+      profile.ProfileLocked(ETrue, ETrue);
+      iLock = EFalse;
+	    }
+	    
 	profile.UpdateL();
 	
 	RSyncMLConnection connection;
@@ -426,7 +434,7 @@
 	    
 	    CleanupStack::PopAndDestroy(alertMessage);	    
 	    }
-
+	    
 	CleanupStack::PopAndDestroy( &profile );
 
 	_DBG_FILE("CNSmlDmProvisioningAdapter::SaveL(): end");
--- a/terminalsecurity/SCP/SCPClient/src/SCPQueryDialog.cpp	Tue May 25 13:36:17 2010 +0300
+++ b/terminalsecurity/SCP/SCPClient/src/SCPQueryDialog.cpp	Wed Jun 09 10:37:30 2010 +0300
@@ -155,6 +155,11 @@
     
     CAknTextQueryDialog::PreLayoutDynInitL();
     
+    CEikSecretEditor* queryControl = static_cast<CEikSecretEditor*>( 
+                QueryControl()->ControlByLayoutOrNull( QueryControl()->QueryType() ) );
+
+    queryControl->SetFeature(CEikSecretEditor::ELockQuerySCT, ETrue);
+
     //disable in call bubble.
     if ( AknLayoutUtils::PenEnabled() )
         {
--- a/terminalsecurity/SCP/SCPTimestampPlugin/src/SCPTimestampPlugin.cpp	Tue May 25 13:36:17 2010 +0300
+++ b/terminalsecurity/SCP/SCPTimestampPlugin/src/SCPTimestampPlugin.cpp	Wed Jun 09 10:37:30 2010 +0300
@@ -298,7 +298,8 @@
         iConfiguration->Get( KSCPUsedTolerance, tolerance ); // ignore errors
         Dprint( ( _L( "CSCPPatternPlugin::IsChangeAllowedL(): tolerance get: %d"), tolerance ) );                
         Dprint( ( _L( "CSCPPatternPlugin::IsChangeAllowedL(): iMinTolerance : %d"), iMinTolerance ) );                
-        if ( tolerance >= iMinTolerance )
+
+        if ( iMinTolerance > 0 && tolerance >= iMinTolerance )
             {
             ret = KErrSCPCodeChangeNotAllowed;
             Dprint( (_L("CSCPTimestampPlugin::IsChangeAllowedL() KErrSCPCodeChangeNotAllowed") )); 
@@ -426,11 +427,13 @@
             {
             // Set the last time the password was changed, for expiration
             iConfiguration->Set( KSCPLastChangeTime, timeBuf );
-            }        
+            }
+
         Dprint( ( _L( "CSCPPatternPlugin::PasswordChanged(): iMinInterval: %d"), iMinInterval ) );
-        if ( iMinInterval > 0 )
-            {
+
+        if ( iMinInterval > 0 && iMinTolerance > 0) {
             TInt ret = IsAfter( KSCPIntervalStartTime, iMinInterval, KSCPTypeHours );
+
             if ( ret == KSCPIsAfter )
                 {                                                        
                 // Interval exceeded, start a new interval from here
@@ -462,7 +465,12 @@
                 Dprint( ( _L( "CSCPPatternPlugin::PasswordChanged(): tolerance set: %d"), tolerance ) );  
                 }                       
             }        
-        
+		else {
+			iConfiguration->Set( KSCPIntervalStartTime, 0 );
+			iConfiguration->Set( KSCPUsedTolerance, 0 );
+		}
+
+
         WriteConfiguration();
         }
         else