summaryrefslogtreecommitdiff
path: root/src/challenge.c
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2019-01-24 14:18:17 +0100
committerToni Uhlig <matzeton@googlemail.com>2019-01-24 14:21:57 +0100
commit22a07d791bf74b7c6478058e8b1c91018b1bc2f7 (patch)
treed9900b963cf331a3a6cb69061576c76800a88501 /src/challenge.c
parent476d6b28848f952c09a094e2227f20d69d4f1482 (diff)
parentcea2b50c81db45d3f0eb19c327d2cc04bc01e1d2 (diff)
Merge branch 'master' into releasev1.32
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/challenge.c')
-rw-r--r--src/challenge.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/challenge.c b/src/challenge.c
index 24a13f7..f269313 100644
--- a/src/challenge.c
+++ b/src/challenge.c
@@ -5,7 +5,7 @@
* Copyright (c) 2004-2011, Daniel Stoedle <daniels@cs.uit.no>,
* Yellow Lemon Software. All rights reserved.
*
- * Copyright (c) 2017 Toni Uhlig <matzeton@googlemail.com>
+ * Copyright (c) 2017-2019, Toni Uhlig <matzeton@googlemail.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -50,6 +50,7 @@
#include "challenge.h"
#include "options.h"
#include "md5.h"
+#include "utils.h"
/* generate_challenge: Generates a random challenge, incorporating the current
* local timestamp to avoid replay attacks.
@@ -62,9 +63,9 @@ challenge_t* generate_challenge(void) {
c = (challenge_t *) calloc(1, sizeof(challenge_t));
gettimeofday(&tt, 0);
c->sec = tt.tv_sec;
- c->usec_rnd = tt.tv_usec + rand();
+ c->usec_rnd = tt.tv_usec + pt_random();
for (i=0;i<6;i++)
- c->random[i] = rand();
+ c->random[i] = pt_random();
return c;
}