Though the comment of RandomSeed() states it should return FALSE if there is not enough entropy for random generation, the function always returns TRUE. This commit checks the status of pseudorandom number generator to match the comment.

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
This commit is contained in:
tye1 2013-05-29 05:30:13 +00:00
parent e8dc04b743
commit b3a18a1a17
3 changed files with 15 additions and 3 deletions

View File

@ -57,7 +57,11 @@ RandomSeed (
RAND_seed (DefaultSeed, sizeof (DefaultSeed));
}
return TRUE;
if (RAND_status () == 1) {
return TRUE;
}
return FALSE;
}
/**

View File

@ -65,7 +65,11 @@ RandomSeed (
RAND_seed (DefaultSeed, sizeof (DefaultSeed));
}
return TRUE;
if (RAND_status () == 1) {
return TRUE;
}
return FALSE;
}
/**

View File

@ -65,7 +65,11 @@ RandomSeed (
RAND_seed (DefaultSeed, sizeof (DefaultSeed));
}
return TRUE;
if (RAND_status () == 1) {
return TRUE;
}
return FALSE;
}
/**