apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: apr-util/include apr_md5.h
Date Wed, 12 Mar 2003 20:20:02 GMT
wrowe       2003/03/12 12:20:01

  Modified:    crypto   apr_md5.c
               test     testmd5.c
               include  apr_md5.h
  Log:
    Reflect the deprecatation of MD5_DIGESTSIZE
 for APR_MD5_DIGESTSIZE
  
  Revision  Changes    Path
  1.5       +9 -9      apr-util/crypto/apr_md5.c
  
  Index: apr_md5.c
  ===================================================================
  RCS file: /home/cvs/apr-util/crypto/apr_md5.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- apr_md5.c	21 Jan 2003 20:27:58 -0000	1.4
  +++ apr_md5.c	12 Mar 2003 20:20:00 -0000	1.5
  @@ -315,7 +315,7 @@
   /* MD5 finalization. Ends an MD5 message-digest operation, writing the
    * the message digest and zeroizing the context.
    */
  -APU_DECLARE(apr_status_t) apr_md5_final(unsigned char digest[MD5_DIGESTSIZE],
  +APU_DECLARE(apr_status_t) apr_md5_final(unsigned char digest[APR_MD5_DIGESTSIZE],
                                           apr_md5_ctx_t *context)
   {
       unsigned char bits[8];
  @@ -338,7 +338,7 @@
       apr_md5_update(context, bits, 8);
   
       /* Store state in digest */
  -    Encode(digest, context->state, MD5_DIGESTSIZE);
  +    Encode(digest, context->state, APR_MD5_DIGESTSIZE);
   
       /* Zeroize sensitive information. */
       memset(context, 0, sizeof(*context));
  @@ -348,7 +348,7 @@
   
   /* MD5 in one step (init, update, final)
    */
  -APU_DECLARE(apr_status_t) apr_md5(unsigned char digest[MD5_DIGESTSIZE],
  +APU_DECLARE(apr_status_t) apr_md5(unsigned char digest[APR_MD5_DIGESTSIZE],
                                     const void *_input,
                                     apr_size_t inputLen)
   {
  @@ -368,7 +368,7 @@
   static void MD5Transform(apr_uint32_t state[4], const unsigned char block[64])
   {
       apr_uint32_t a = state[0], b = state[1], c = state[2], d = state[3],
  -                 x[MD5_DIGESTSIZE];
  +                 x[APR_MD5_DIGESTSIZE];
   
       Decode(x, block, 64);
   
  @@ -528,7 +528,7 @@
   
       char passwd[120], *p;
       const char *sp, *ep;
  -    unsigned char final[MD5_DIGESTSIZE];
  +    unsigned char final[APR_MD5_DIGESTSIZE];
       apr_ssize_t sl, pl, i;
       apr_md5_ctx_t ctx, ctx1;
       unsigned long l;
  @@ -590,9 +590,9 @@
       apr_md5_update(&ctx1, (unsigned char *)sp, sl);
       apr_md5_update(&ctx1, (unsigned char *)pw, strlen(pw));
       apr_md5_final(final, &ctx1);
  -    for (pl = strlen(pw); pl > 0; pl -= MD5_DIGESTSIZE) {
  +    for (pl = strlen(pw); pl > 0; pl -= APR_MD5_DIGESTSIZE) {
           apr_md5_update(&ctx, final, 
  -                      (pl > MD5_DIGESTSIZE) ? MD5_DIGESTSIZE : pl);
  +                      (pl > APR_MD5_DIGESTSIZE) ? APR_MD5_DIGESTSIZE : pl);
       }
   
       /*
  @@ -633,7 +633,7 @@
               apr_md5_update(&ctx1, (unsigned char *)pw, strlen(pw));
           }
           else {
  -            apr_md5_update(&ctx1, final, MD5_DIGESTSIZE);
  +            apr_md5_update(&ctx1, final, APR_MD5_DIGESTSIZE);
           }
           if (i % 3) {
               apr_md5_update(&ctx1, (unsigned char *)sp, sl);
  @@ -644,7 +644,7 @@
           }
   
           if (i & 1) {
  -            apr_md5_update(&ctx1, final, MD5_DIGESTSIZE);
  +            apr_md5_update(&ctx1, final, APR_MD5_DIGESTSIZE);
           }
           else {
               apr_md5_update(&ctx1, (unsigned char *)pw, strlen(pw));
  
  
  
  1.4       +3 -3      apr-util/test/testmd5.c
  
  Index: testmd5.c
  ===================================================================
  RCS file: /home/cvs/apr-util/test/testmd5.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- testmd5.c	1 Jan 2003 00:02:22 -0000	1.3
  +++ testmd5.c	12 Mar 2003 20:20:01 -0000	1.4
  @@ -91,7 +91,7 @@
   {
       int i;
       apr_md5_ctx_t context;
  -    unsigned char hash[MD5_DIGESTSIZE];
  +    unsigned char hash[APR_MD5_DIGESTSIZE];
       
       printf("Trying translation %d\n", cur + 1);
   
  @@ -110,14 +110,14 @@
       STD_TEST_NEQ("    apr_md5_final", apr_md5_final(hash, &context))
   
       printf("     (MD5 hash : ");
  -    for (i = 0; i < MD5_DIGESTSIZE; i++) {
  +    for (i = 0; i < APR_MD5_DIGESTSIZE; i++) {
           printf("%02x",hash[i]);
       }
       
       printf(")\n");
   
       printf("%-60s", "    Checking hash against expected");
  -    if (memcmp(hash, digest, MD5_DIGESTSIZE)) {
  +    if (memcmp(hash, digest, APR_MD5_DIGESTSIZE)) {
           /* This is a fatal error...report on stderr */
           fprintf(stderr, "The digest is not as expected!\n");
   #if 'A' != 0x41
  
  
  
  1.6       +2 -2      apr-util/include/apr_md5.h
  
  Index: apr_md5.h
  ===================================================================
  RCS file: /home/cvs/apr-util/include/apr_md5.h,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- apr_md5.h	7 Mar 2003 21:38:40 -0000	1.5
  +++ apr_md5.h	12 Mar 2003 20:20:01 -0000	1.6
  @@ -155,7 +155,7 @@
    * @param digest The final MD5 digest
    * @param context The MD5 content we are finalizing.
    */
  -APU_DECLARE(apr_status_t) apr_md5_final(unsigned char digest[MD5_DIGESTSIZE],
  +APU_DECLARE(apr_status_t) apr_md5_final(unsigned char digest[APR_MD5_DIGESTSIZE],
                                           apr_md5_ctx_t *context);
   
   /**
  @@ -164,7 +164,7 @@
    * @param input The message block to use
    * @param inputLen The length of the message block
    */
  -APU_DECLARE(apr_status_t) apr_md5(unsigned char digest[MD5_DIGESTSIZE],
  +APU_DECLARE(apr_status_t) apr_md5(unsigned char digest[APR_MD5_DIGESTSIZE],
                                     const void *input,
                                     apr_size_t inputLen);
   
  
  
  

Mime
View raw message