Wrong use of random() in auth_digest.c

From: Guido Serassio <serassio@dont-contact.us>
Date: Sun, 05 May 2002 11:35:54 +0200

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 - 03:36:04 MDT

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