mirror of
https://github.com/curl/curl.git
synced 2026-05-07 09:47:29 +03:00
digest: append the timer to the random for the nonce
This commit is contained in:
parent
98b0d66eb4
commit
d689376cb0
1 changed files with 5 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue