diff options
author | 1997-03-27 01:09:38 +0000 | |
---|---|---|
committer | 1997-03-27 01:09:38 +0000 | |
commit | d937c54e21033f7e19c24ef00c8c931e18253969 (patch) | |
tree | 456e8ec91be61ef5b6f678ed5000303ed49d670b /lib/libc/crypt/bcrypt.c | |
parent | use arc4random instead of random (diff) | |
download | wireguard-openbsd-d937c54e21033f7e19c24ef00c8c931e18253969.tar.xz wireguard-openbsd-d937c54e21033f7e19c24ef00c8c931e18253969.zip |
yet another random() converted to arc4random()
Diffstat (limited to 'lib/libc/crypt/bcrypt.c')
-rw-r--r-- | lib/libc/crypt/bcrypt.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/libc/crypt/bcrypt.c b/lib/libc/crypt/bcrypt.c index 364555b5da1..d47100cec89 100644 --- a/lib/libc/crypt/bcrypt.c +++ b/lib/libc/crypt/bcrypt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bcrypt.c,v 1.3 1997/02/16 20:58:15 provos Exp $ */ +/* $OpenBSD: bcrypt.c,v 1.4 1997/03/27 01:09:38 provos Exp $ */ /* * Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de> * All rights reserved. @@ -49,7 +49,6 @@ #endif #include <stdlib.h> -#include <time.h> #include <sys/types.h> #include <string.h> #include <pwd.h> @@ -161,10 +160,10 @@ bcrypt_gensalt(log_rounds) u_int8_t csalt[BCRYPT_MAXSALT]; u_int16_t i; u_int32_t seed = 0; - (void) srandom((int) time((time_t *) NULL)); + for (i = 0; i < BCRYPT_MAXSALT; i++) { if (i % 4 == 0) - seed = random(); + seed = arc4random(); csalt[i] = seed & 0xff; seed = seed >> 8; } |