summaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/utils.c b/utils.c
index 24a2c66..24a6be6 100644
--- a/utils.c
+++ b/utils.c
@@ -198,9 +198,10 @@ void new_password(const char *uid, d_char **clear_pwd, d_char **hashed_pwd)
198{ 198{
199 int rndbuf[3]; 199 int rndbuf[3];
200 200
201 rndbuf[0] = arc4random(); 201 srandom(time(NULL) ^ getpid());
202 rndbuf[1] = arc4random(); 202 rndbuf[0] = random() & 0xffffffff;
203 rndbuf[2] = arc4random(); 203 rndbuf[1] = random() & 0xffffffff;
204 rndbuf[2] = random() & 0xffffffff;
204 205
205 *clear_pwd = xs_base64_enc((char *)rndbuf, sizeof(rndbuf)); 206 *clear_pwd = xs_base64_enc((char *)rndbuf, sizeof(rndbuf));
206 *hashed_pwd = hash_password(uid, *clear_pwd, NULL); 207 *hashed_pwd = hash_password(uid, *clear_pwd, NULL);