cURL / Mailing Lists / curl-library / Single Mail


RE: [bagder/curl] eefeb7: curl_sasl: Extended native DIGEST-MD5 cnonce to be...

From: Steve Holme <>
Date: Mon, 2 Jun 2014 23:33:09 +0100

On Mon, 2 Jun 2014, Daniel Stenberg wrote:

> > Rather than use a short 8-byte hex string, extended the cnonce to be
> > 32-bytes long, like Windows SSPI does.
> >
> > Used a combination of random data as well as the current date and
> > time for the generation.
> If we really want to add more "randomness", wouldn't it be better to
> call Curl_rand() two more times instead? It is getting "real" random data
> from the underlying TLS/crypto library and that is bound to be safer than
> adding the current time.

Quite possibly - Although I wasn't very inventive here and simply stole code
from (sorry - took inspiration from) http_digest.c :-(

I'm not sure what the benefits of either are...

...except I guess, technically/possibly?, by using two random numbers and
the current date/time the chance of obtaining the same 16-bytes is less than
using 4 random numbers?? I guess it depends of the random number generator
but I'm certainly no expert here!

If we change it, I think we should also do the same for http_digest.c.

If we don't, we can add your getenv("CURL_FORCETIME") override can't we?

On the subject of the entropy changes, I was going to try and commit some of
your changes this week - as I've still got your patches from a while back
and I also appreciate you're a busy man, plus you've been waiting for me to
finish my sasl_digest changes ;-)

> Also, you accidentally added tv_sec twice - I figured one of them at least
> (curl_sasl.c line 462) was meant to be tv_usec ?

Ooops - Thank you. I've pushed commit 62a26ec696 whilst we decide whether 4
random numbers is better or not.

Kind Regards

List admin:
Received on 2014-06-03