RE: Wrong use of random() in auth_digest.c

From: Robert Collins <robert.collins@dont-contact.us>
Date: Sun, 5 May 2002 21:50:43 +1000

Looks fine to me. I'll check it in when I get the auth fixes in, or
someone else can check it in now.

Rob

> -----Original Message-----
> From: Guido Serassio [mailto:serassio@libero.it]
> Sent: Sunday, May 05, 2002 7:36 PM
> To: Henrik Nordstrom
> Cc: squid-dev@squid-cache.org
> Subject: Wrong use of random() in auth_digest.c
>
>
> Hi Henrik,
>
> Adding the digest authentication schema to nt branch, I have
> found that in
> auth_digest.c is still used the random() function instead the
> squid_random() stub used in all other Squid files.
> I think that this is wrong, so this is the patch:
>
> Index: src/auth/digest/auth_digest.c
> ===================================================================
> RCS file: /cvsroot/squid/squid/src/auth/digest/auth_digest.c,v
> retrieving revision 1.14.2.1
> diff -u -p -r1.14.2.1 auth_digest.c
> --- src/auth/digest/auth_digest.c 17 Apr 2002 18:58:23
> -0000 1.14.2.1
>
> +++ src/auth/digest/auth_digest.c 5 May 2002 09:29:24 -0000
> @@ -174,7 +174,7 @@ authenticateDigestNonceNew(void)
> newnonce->flags.valid = 1;
> newnonce->noncedata.self = newnonce;
> newnonce->noncedata.creationtime = current_time.tv_sec;
> - newnonce->noncedata.randomdata = random();
> + newnonce->noncedata.randomdata = squid_random();
>
> authDigestNonceEncode(newnonce);
> /*
> @@ -183,7 +183,7 @@ authenticateDigestNonceNew(void)
> */
> while ((temp =
> authenticateDigestNonceFindNonce(newnonce->hash.key))) {
> /* create a new nonce */
> - newnonce->noncedata.randomdata = random();
> + newnonce->noncedata.randomdata = squid_random();
> authDigestNonceEncode(newnonce);
> }
> hash_join(digest_nonce_cache, &newnonce->hash);
>
> Regards
>
> Guido
>
>
>
> -
> =======================================================
> Serassio Guido
> Via Albenga, 11/4 10134
> - Torino - ITALY
> E-mail: guido.serassio@serassio.it
> WWW: http://www.serassio.it
>
>
Received on Sun May 05 2002 - 05:50:47 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:15:24 MST