Digst: Add microseconds into nounce calculation
authorGabriel Sjoberg <gabrielsjoberg@gmail.com>
Fri, 9 Nov 2012 23:19:46 +0000 (17:19 -0600)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 12 Nov 2012 10:46:27 +0000 (11:46 +0100)
commite237402c47444e97b4947d22d91aa50f90a67d74
treec1a620d93d022468847185036700e194d8b4c81f
parent1c23d2b39290032f739b1b441aba8bf89a0b834f
Digst: Add microseconds into nounce calculation

When using only 1 second precision, curl doesn't create new cnonce
values quickly enough for all uses.

For example, issuing the following command multiple times to a recent
Tomcat causes authentication failures:

curl --digest -utest:test http://tomcat.test.com:8080/manager/list

This is because curl uses the same cnonce for several seconds, but
doesn't increment the nonce counter.  Tomcat correctly interprets
this as a replay attack and rejects the request.

When microsecond-precision is available, this commit causes curl to
change cnonce values much more frequently.

With microsecond resolution, increasing the nounce length used in the
headers to 32 was made to further reduce the risk of duplication.
lib/http_digest.c