summaryrefslogtreecommitdiff
path: root/lib/http_digest.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2013-06-25 11:37:27 +0200
committerDaniel Stenberg <daniel@haxx.se>2013-06-25 11:37:27 +0200
commitd689376cb0916cc9517c84f349eb321d424981e8 (patch)
treefd037457afeedf29197dd065a8ee96471feb8fd2 /lib/http_digest.c
parent98b0d66eb48c88191a8908627f722a464b7c4199 (diff)
downloadcurl-d689376cb0916cc9517c84f349eb321d424981e8.tar.gz
digest: append the timer to the random for the nonce
Diffstat (limited to 'lib/http_digest.c')
-rw-r--r--lib/http_digest.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/http_digest.c b/lib/http_digest.c
index 50ccc05ad..bc8e23d43 100644
--- a/lib/http_digest.c
+++ b/lib/http_digest.c
@@ -375,8 +375,11 @@ CURLcode Curl_output_digest(struct connectdata *conn,
d->nc = 1;
if(!d->cnonce) {
- snprintf(cnoncebuf, sizeof(cnoncebuf), "%08x%08x",
- Curl_rand(data), Curl_rand(data));
+ struct timeval now = Curl_tvnow();
+ snprintf(cnoncebuf, sizeof(cnoncebuf), "%08x%08x%08x%08x",
+ Curl_rand(data), Curl_rand(data),
+ (unsigned int)now.tv_sec,
+ (unsigned int)now.tv_usec);
rc = Curl_base64_encode(data, cnoncebuf, strlen(cnoncebuf),
&cnonce, &cnonce_sz);