coar        97/09/02 09:12:18

  Modified:    src/main http_core.c md5.h md5c.c util_md5.c util_md5.h
               src/modules/proxy proxy_util.c
               src/modules/standard mod_digest.c
               src/support htdigest.c
  Log:
        `Personalise' Apache's use of MD5 names to avoid collisions,
        by prefixing them with `ap_'.
  
  Reviewed by:  Mark Cox, Randy Terbush
  
  Revision  Changes    Path
  1.118     +3 -3      apachen/src/main/http_core.c
  
  Index: http_core.c
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/main/http_core.c,v
  retrieving revision 1.117
  retrieving revision 1.118
  diff -u -r1.117 -r1.118
  --- http_core.c       1997/09/01 01:47:00     1.117
  +++ http_core.c       1997/09/02 16:12:08     1.118
  @@ -1656,7 +1656,7 @@
   #endif
   
        if (d->content_md5 & 1) {
  -         table_set (r->headers_out, "Content-MD5", md5digest(r->pool, f));
  +         table_set (r->headers_out, "Content-MD5", ap_md5digest(r->pool, f));
        }
   
        rangestatus = set_byterange(r);
  @@ -1685,12 +1685,12 @@
        unblock_alarms();
   
        if (d->content_md5 & 1) {
  -         MD5_CTX context;
  +         AP_MD5_CTX context;
            
            MD5Init(&context);
            MD5Update(&context, (void *)mm, r->finfo.st_size);
            table_set (r->headers_out, "Content-MD5",
  -             md5contextTo64(r->pool, &context));
  +             ap_md5contextTo64(r->pool, &context));
        }
   
        rangestatus = set_byterange(r);
  
  
  
  1.6       +4 -4      apachen/src/main/md5.h
  
  Index: md5.h
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/main/md5.h,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- md5.h     1997/07/19 20:16:13     1.5
  +++ md5.h     1997/09/02 16:12:09     1.6
  @@ -91,9 +91,9 @@
     UINT4 state[4];                                   /* state (ABCD) */
     UINT4 count[2];        /* number of bits, modulo 2^64 (lsb first) */
     unsigned char buffer[64];                         /* input buffer */
  -} MD5_CTX;
  +} AP_MD5_CTX;
   
  -API_EXPORT(void) MD5Init(MD5_CTX *context);
  -API_EXPORT(void) MD5Update(MD5_CTX *context, const unsigned char *input,
  +API_EXPORT(void) MD5Init(AP_MD5_CTX *context);
  +API_EXPORT(void) MD5Update(AP_MD5_CTX *context, const unsigned char *input,
                      unsigned int inputLen);
  -API_EXPORT(void) MD5Final(unsigned char digest[16], MD5_CTX *context);
  +API_EXPORT(void) MD5Final(unsigned char digest[16], AP_MD5_CTX *context);
  
  
  
  1.7       +4 -3      apachen/src/main/md5c.c
  
  Index: md5c.c
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/main/md5c.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- md5c.c    1997/07/21 05:53:47     1.6
  +++ md5c.c    1997/09/02 16:12:09     1.7
  @@ -158,7 +158,7 @@
   
   /* MD5 initialization. Begins an MD5 operation, writing a new context.
    */
  -API_EXPORT(void) MD5Init(MD5_CTX *context)
  +API_EXPORT(void) MD5Init(AP_MD5_CTX *context)
   {
       context->count[0] = context->count[1] = 0;
     /* Load magic initialization constants. */
  @@ -172,7 +172,8 @@
     operation, processing another message block, and updating the
     context.
    */
  -API_EXPORT(void) MD5Update(MD5_CTX *context, const unsigned char *input, 
unsigned int inputLen)
  +API_EXPORT(void) MD5Update(AP_MD5_CTX *context, const unsigned char *input, 
  +                           unsigned int inputLen)
   {
       unsigned int i, idx, partLen;
   
  @@ -207,7 +208,7 @@
   /* MD5 finalization. Ends an MD5 message-digest operation, writing the
     the message digest and zeroizing the context.
    */
  -API_EXPORT(void) MD5Final(unsigned char digest[16], MD5_CTX *context)
  +API_EXPORT(void) MD5Final(unsigned char digest[16], AP_MD5_CTX *context)
   {
       unsigned char bits[8];
       unsigned int idx, padLen;
  
  
  
  1.9       +6 -6      apachen/src/main/util_md5.c
  
  Index: util_md5.c
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/main/util_md5.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- util_md5.c        1997/07/15 21:39:59     1.8
  +++ util_md5.c        1997/09/02 16:12:09     1.9
  @@ -82,9 +82,9 @@
   #include "httpd.h"
   #include "util_md5.h"
   
  -API_EXPORT(char *) md5 (pool *p, unsigned char *string)
  +API_EXPORT(char *) ap_md5 (pool *p, unsigned char *string)
   {
  -    MD5_CTX my_md5;
  +    AP_MD5_CTX my_md5;
       unsigned char hash[16];
       char *r, result[33];
       int i;
  @@ -149,7 +149,7 @@
   static char basis_64[] =
      "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
   
  -API_EXPORT(char *) md5contextTo64(pool *a, MD5_CTX *context)
  +API_EXPORT(char *) ap_md5contextTo64(pool *a, AP_MD5_CTX *context)
   {
       unsigned char digest[18];
       char *encodedDigest;
  @@ -174,9 +174,9 @@
       return encodedDigest;
   }
   
  -API_EXPORT(char *) md5digest(pool *p, FILE *infile)
  +API_EXPORT(char *) ap_md5digest(pool *p, FILE *infile)
   {
  -    MD5_CTX context;
  +    AP_MD5_CTX context;
       unsigned char buf[1000];
       long length = 0;
       int nbytes;
  @@ -187,6 +187,6 @@
           MD5Update(&context, buf, nbytes);
       }
       rewind(infile);
  -    return md5contextTo64(p, &context);
  +    return ap_md5contextTo64(p, &context);
   }
   
  
  
  
  1.7       +3 -3      apachen/src/main/util_md5.h
  
  Index: util_md5.h
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/main/util_md5.h,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- util_md5.h        1997/07/15 21:39:59     1.6
  +++ util_md5.h        1997/09/02 16:12:10     1.7
  @@ -52,7 +52,7 @@
   
   #include "md5.h"
   
  -API_EXPORT(char *) md5(pool *a, unsigned char *string);
  -API_EXPORT(char *) md5contextTo64(pool *p, MD5_CTX *context);
  -API_EXPORT(char *) md5digest(pool *p, FILE *infile);
  +API_EXPORT(char *) ap_md5(pool *a, unsigned char *string);
  +API_EXPORT(char *) ap_md5contextTo64(pool *p, AP_MD5_CTX *context);
  +API_EXPORT(char *) ap_md5digest(pool *p, FILE *infile);
   
  
  
  
  1.27      +2 -2      apachen/src/modules/proxy/proxy_util.c
  
  Index: proxy_util.c
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/modules/proxy/proxy_util.c,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- proxy_util.c      1997/09/02 10:39:34     1.26
  +++ proxy_util.c      1997/09/02 16:12:14     1.27
  @@ -580,7 +580,7 @@
   void
   proxy_hash(const char *it, char *val,int ndepth,int nlength)
   {
  -    MD5_CTX context;
  +    AP_MD5_CTX context;
       unsigned char digest[16];
       char tmp[26];
       int i, k, d;
  @@ -630,7 +630,7 @@
   void
   proxy_hash(const char *it, char *val,int ndepth,int nlength)
   {
  -    MD5_CTX context;
  +    AP_MD5_CTX context;
       unsigned char digest[16];
       char tmp[22];
       int i, k, d;
  
  
  
  1.22      +4 -4      apachen/src/modules/standard/mod_digest.c
  
  Index: mod_digest.c
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/modules/standard/mod_digest.c,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- mod_digest.c      1997/08/31 23:05:33     1.21
  +++ mod_digest.c      1997/09/02 16:12:15     1.22
  @@ -241,10 +241,10 @@
   /* The actual MD5 code... whee */
   
   char *find_digest(request_rec *r, digest_header_rec *h, char *a1) {
  -  return md5(r->pool,
  -          (unsigned char *)pstrcat(r->pool, a1, ":", h->nonce, ":", 
  -                       md5(r->pool,
  -                           (unsigned char *)pstrcat(r->pool,r->method,":",
  +  return ap_md5(r->pool,
  +             (unsigned char *)pstrcat(r->pool, a1, ":", h->nonce, ":", 
  +                       ap_md5(r->pool,
  +                              (unsigned char *)pstrcat(r->pool,r->method,":",
                                                       h->requested_uri,NULL)),
                                      NULL));
   }
  
  
  
  1.10      +1 -1      apachen/src/support/htdigest.c
  
  Index: htdigest.c
  ===================================================================
  RCS file: /export/home/cvs/apachen/src/support/htdigest.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- htdigest.c        1997/08/23 12:11:24     1.9
  +++ htdigest.c        1997/09/02 16:12:16     1.10
  @@ -74,7 +74,7 @@
   
   void add_password(char *user, char *realm, FILE *f) {
       char *pw;
  -    MD5_CTX context;
  +    AP_MD5_CTX context;
       unsigned char digest[16];
       char string[MAX_STRING_LEN];
       unsigned int i;
  
  
  

Reply via email to