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:
parent
e8dc04b743
commit
b3a18a1a17
|
@ -57,9 +57,13 @@ RandomSeed (
|
||||||
RAND_seed (DefaultSeed, sizeof (DefaultSeed));
|
RAND_seed (DefaultSeed, sizeof (DefaultSeed));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (RAND_status () == 1) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Generates a pseudorandom byte stream of the specified size.
|
Generates a pseudorandom byte stream of the specified size.
|
||||||
|
|
||||||
|
|
|
@ -65,9 +65,13 @@ RandomSeed (
|
||||||
RAND_seed (DefaultSeed, sizeof (DefaultSeed));
|
RAND_seed (DefaultSeed, sizeof (DefaultSeed));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (RAND_status () == 1) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Generates a pseudorandom byte stream of the specified size.
|
Generates a pseudorandom byte stream of the specified size.
|
||||||
|
|
||||||
|
|
|
@ -65,9 +65,13 @@ RandomSeed (
|
||||||
RAND_seed (DefaultSeed, sizeof (DefaultSeed));
|
RAND_seed (DefaultSeed, sizeof (DefaultSeed));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (RAND_status () == 1) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Generates a pseudorandom byte stream of the specified size.
|
Generates a pseudorandom byte stream of the specified size.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue