Skip to content
Snippets Groups Projects
Commit d689376c authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

digest: append the timer to the random for the nonce

parent 98b0d66e
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment