crypto/weakcryptospi/source/spi/cryptospiutil.cpp
branchRCL_3
changeset 62 a71299154b21
parent 61 641f389e9157
--- a/crypto/weakcryptospi/source/spi/cryptospiutil.cpp	Tue Aug 31 17:00:08 2010 +0300
+++ b/crypto/weakcryptospi/source/spi/cryptospiutil.cpp	Wed Sep 01 12:40:57 2010 +0100
@@ -85,25 +85,21 @@
 
 TInt CryptoSpiUtil::RetrieveCharacteristicsL(TInt32 aInterface, RDesReadStream& aStream, RBuf8& aBuf, TInt& aCount)
 	{
-	// first we are only trying to retrieve the length of the buffer
-	TBuf8<sizeof(TInt32)> buf;
+	TBuf8<KMaxFileName> buf;
 	TInt testResult = RProperty::Get(KCryptoSpiPropertyCat, aInterface, buf);
 	if (testResult==KErrNotFound)
 		{
 		//run the exe to Publish the properties
 		RunCryptoSpiPropertySetupExe();
-		// testresult would be checked outside the loop
 		testResult = RProperty::Get(KCryptoSpiPropertyCat, aInterface, buf);
+		if (testResult==KErrNotFound)
+			{
+			//Error
+			User::Leave(testResult);
+			}
 		}
 	
-	// overflow will occur as we are only retrieving the length first.
-	// any other error we should leave
-	if(testResult != KErrOverflow)
-		{
-		User::LeaveIfError(testResult);
-		}
-	
-	//read the length
+	//Try to read the length first
 	RDesReadStream rStream(buf);
 	TInt32 len=rStream.ReadInt32L();