Properly initialize the random number generator in pw_getpass().
Right now, the automatically generated passwords have been rather predictable. :-( MFC after: 1 day
This commit is contained in:
parent
376958b412
commit
5c6a35107b
@ -1058,6 +1058,7 @@ pw_getrand(u_char *buf, int len)
|
||||
{
|
||||
int i;
|
||||
|
||||
srandomdev();
|
||||
for (i = 0; i < len; i++) {
|
||||
unsigned long val = random();
|
||||
/* Use all bits in the random value */
|
||||
|
Loading…
x
Reference in New Issue
Block a user