crypto/weakcryptospi/source/bigint/bigint.cpp
branchCompilerCompatibility
changeset 47 e6ba5d9eabc1
parent 43 9b5a3a9fddf8
child 72 de46a57f75fb
--- a/crypto/weakcryptospi/source/bigint/bigint.cpp	Mon Mar 08 21:45:09 2010 +0000
+++ b/crypto/weakcryptospi/source/bigint/bigint.cpp	Sun Mar 14 13:16:12 2010 +0000
@@ -805,7 +805,9 @@
 	CleanGrowL(words);
 	TPtr8 buf((TUint8*)(Ptr()), bytes, WordsToBytes(Size()));
 	TUint bitpos = aBits % BYTE_BITS;
-	GenerateRandomBytesL(buf);
+	TRAPD(err, GenerateRandomBytesL(buf));
+	if((err != KErrNone) && (err != KErrNotSecure))
+	    User::Leave(err);
 	//mask with 0 all bits above the num requested in the most significant byte
 	if(bitpos)
 		{