mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
Recouple arc4random(9) to the entropy device. This works whether the
entropy device is loaded or not. If the entropy device is NOT loaded, the the quality of perturbations supplied by this will suffer.
This commit is contained in:
parent
e8a49db233
commit
4cb1e53914
1 changed files with 4 additions and 2 deletions
|
|
@ -40,8 +40,10 @@ arc4_randomstir (void)
|
|||
u_int8_t key[256];
|
||||
int r, n;
|
||||
|
||||
/* r = read_random(key, sizeof(key)); */
|
||||
r = 0; /* XXX MarkM - revisit this when /dev/random is done */
|
||||
/* XXX read_random() returns unsafe numbers if the entropy
|
||||
* devce is not loaded - MarkM
|
||||
*/
|
||||
r = read_random(key, sizeof(key));
|
||||
/* if r == 0 || -1, just use what was on the stack */
|
||||
if (r > 0)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue