crypto/weakcryptospi/source/bigint/bigint.cpp
changeset 55 581b7c2ef978
parent 17 cd501b96611d
child 72 de46a57f75fb
--- a/crypto/weakcryptospi/source/bigint/bigint.cpp	Tue Jan 26 13:18:49 2010 +0200
+++ b/crypto/weakcryptospi/source/bigint/bigint.cpp	Fri Mar 19 10:03:04 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)
 		{