Though the comment of RandomSeed() states it should return FALSE if there is not...
authortye1 <tye1@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 29 May 2013 05:30:13 +0000 (05:30 +0000)
committertye1 <tye1@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 29 May 2013 05:30:13 +0000 (05:30 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by: Gary Ching-Pang Lin <glin@suse.com>
Reviewed-by: Long Qin <qin.long@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14392 6f19259b-4bc3-4df7-8a09-765794883524

CryptoPkg/Library/BaseCryptLib/Rand/CryptRand.c
CryptoPkg/Library/BaseCryptLib/Rand/CryptRandItc.c
CryptoPkg/Library/BaseCryptLib/Rand/CryptRandTsc.c

index 4a056e8..dc3ab99 100644 (file)
@@ -57,7 +57,11 @@ RandomSeed (
     RAND_seed (DefaultSeed, sizeof (DefaultSeed));\r
   }\r
 \r
-  return TRUE;\r
+  if (RAND_status () == 1) {\r
+    return TRUE;\r
+  }\r
+\r
+  return FALSE;\r
 }\r
 \r
 /**\r
index dcc1853..0f27f25 100644 (file)
@@ -65,7 +65,11 @@ RandomSeed (
     RAND_seed (DefaultSeed, sizeof (DefaultSeed));\r
   }\r
 \r
-  return TRUE;\r
+  if (RAND_status () == 1) {\r
+    return TRUE;\r
+  }\r
+\r
+  return FALSE;\r
 }\r
 \r
 /**\r
index 7259ed5..dbdd638 100644 (file)
@@ -65,7 +65,11 @@ RandomSeed (
     RAND_seed (DefaultSeed, sizeof (DefaultSeed));\r
   }\r
 \r
-  return TRUE;\r
+  if (RAND_status () == 1) {\r
+    return TRUE;\r
+  }\r
+\r
+  return FALSE;\r
 }\r
 \r
 /**\r