crypto/weakcryptospi/source/bigint/bigint.cpp
branchRCL_3
changeset 41 9b5a3a9fddf8
parent 19 cd501b96611d
child 58 a5e05e7296f9
--- a/crypto/weakcryptospi/source/bigint/bigint.cpp	Tue Jan 26 13:18:49 2010 +0200
+++ b/crypto/weakcryptospi/source/bigint/bigint.cpp	Sat Feb 20 00:36:18 2010 +0200
@@ -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)
 		{