httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject cvs commit: apache-1.3/src/modules/experimental mod_auth_digest.c
Date Mon, 25 Nov 2002 10:31:31 GMT
martin      2002/11/25 02:31:31

  Modified:    src      CHANGES
               src/modules/experimental mod_auth_digest.c
  Log:
  [PORT] Take advantage of OpenBSD's arc4random() function for the
  initial secret
  
  Submitted by:	Henning Brauer <hb-apache-dev@bsws.de>
  
  Revision  Changes    Path
  1.1863    +3 -0      apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1862
  retrieving revision 1.1863
  diff -u -r1.1862 -r1.1863
  --- CHANGES	17 Nov 2002 22:29:14 -0000	1.1862
  +++ CHANGES	25 Nov 2002 10:31:30 -0000	1.1863
  @@ -1,5 +1,8 @@
   Changes with Apache 1.3.28
   
  +  *) PORT: Take advantage of OpenBSD's arc4random() function for the
  +     initial secret [Henning Brauer <hb-apache-dev at bsws.de>]
  +
     *) If Listen directive is not a port, but just an IP, emit an
        error condition as this case is ambiguous.
        [Rich Bowen, Justin Erenkrantz, Cliff Woolley]
  
  
  
  1.25      +19 -1     apache-1.3/src/modules/experimental/mod_auth_digest.c
  
  Index: mod_auth_digest.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/modules/experimental/mod_auth_digest.c,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- mod_auth_digest.c	18 Jun 2002 00:59:59 -0000	1.24
  +++ mod_auth_digest.c	25 Nov 2002 10:31:31 -0000	1.25
  @@ -291,7 +291,24 @@
   }
   #endif	/* HAVE_SHMEM_MM */
   
  -#ifdef WIN32
  +#ifdef __OpenBSD__
  +static void initialize_secret(server_rec *s)
  +{
  +    u_int32_t rnd = 0, i;
  +
  +    ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, s,
  +		 "Digest: generating secret for digest authentication ...");
  +
  +    for (i = 0; i < sizeof(secret); i++) {
  +	if (i % 4 == 0)
  +	    rnd = arc4random();
  +	secret[i] = rnd;
  +	rnd >>= 8;
  +    }
  +    ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, s,
  +		 "Digest: done");
  +}
  +#elif defined(WIN32)
   /* TODO: abstract out the random number generation. APR? */
   static void initialize_secret(server_rec *s)
   {
  @@ -357,6 +374,7 @@
   
       ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, s, "Digest: done");
   }
  +#endif
   #endif
   
   #ifdef HAVE_SHMEM_MM
  
  
  

Mime
View raw message