crypto/weakcryptospi/source/spi/cryptospiutil.cpp
branchRCL_3
changeset 96 a71299154b21
parent 95 641f389e9157
equal deleted inserted replaced
95:641f389e9157 96:a71299154b21
    83 	CleanupStack::PopAndDestroy(&rBuf);
    83 	CleanupStack::PopAndDestroy(&rBuf);
    84 	}
    84 	}
    85 
    85 
    86 TInt CryptoSpiUtil::RetrieveCharacteristicsL(TInt32 aInterface, RDesReadStream& aStream, RBuf8& aBuf, TInt& aCount)
    86 TInt CryptoSpiUtil::RetrieveCharacteristicsL(TInt32 aInterface, RDesReadStream& aStream, RBuf8& aBuf, TInt& aCount)
    87 	{
    87 	{
    88 	// first we are only trying to retrieve the length of the buffer
    88 	TBuf8<KMaxFileName> buf;
    89 	TBuf8<sizeof(TInt32)> buf;
       
    90 	TInt testResult = RProperty::Get(KCryptoSpiPropertyCat, aInterface, buf);
    89 	TInt testResult = RProperty::Get(KCryptoSpiPropertyCat, aInterface, buf);
    91 	if (testResult==KErrNotFound)
    90 	if (testResult==KErrNotFound)
    92 		{
    91 		{
    93 		//run the exe to Publish the properties
    92 		//run the exe to Publish the properties
    94 		RunCryptoSpiPropertySetupExe();
    93 		RunCryptoSpiPropertySetupExe();
    95 		// testresult would be checked outside the loop
       
    96 		testResult = RProperty::Get(KCryptoSpiPropertyCat, aInterface, buf);
    94 		testResult = RProperty::Get(KCryptoSpiPropertyCat, aInterface, buf);
    97 		}
    95 		if (testResult==KErrNotFound)
    98 	
    96 			{
    99 	// overflow will occur as we are only retrieving the length first.
    97 			//Error
   100 	// any other error we should leave
    98 			User::Leave(testResult);
   101 	if(testResult != KErrOverflow)
    99 			}
   102 		{
   100 		}
   103 		User::LeaveIfError(testResult);
   101 	
   104 		}
   102 	//Try to read the length first
   105 	
       
   106 	//read the length
       
   107 	RDesReadStream rStream(buf);
   103 	RDesReadStream rStream(buf);
   108 	TInt32 len=rStream.ReadInt32L();
   104 	TInt32 len=rStream.ReadInt32L();
   109 	
   105 	
   110 	//If the property is empty
   106 	//If the property is empty
   111 	if (len<=4)
   107 	if (len<=4)