Diff for /parser3/src/lib/md5/pa_md5c.c between versions 1.6.2.1 and 1.19

version 1.6.2.1, 2003/01/31 12:34:33 version 1.19, 2017/02/07 22:00:38
Line 3 Line 3
         Replaced ap_ to pa_ prefixes. linked into all targets but Apache-module target,          Replaced ap_ to pa_ prefixes. linked into all targets but Apache-module target,
         where linked targets/apache/pa_md5c.c stub instead.          where linked targets/apache/pa_md5c.c stub instead.
   
         Copyright (c) 2001-2003 ArtLebedev Group (http://www.artlebedev.com)          Copyright (c) 2001-2017 Art. Lebedev Studio (http://www.artlebedev.com)
 */  */
   
 /*  /*
Line 107 Line 107
  * ----------------------------------------------------------------------------   * ----------------------------------------------------------------------------
  */   */
   
 static const char* IDENT_MD5_C="$Date$";  
   
 #include <string.h>  
   
 #include "pa_md5.h"  #include "pa_md5.h"
 //#include "ap.h"  
 //#ifdef CHARSET_EBCDIC  
 //#include "ebcdic.h"  
 //#endif /*CHARSET_EBCDIC*/  
 //#if HAVE_CRYPT_H  
 //#include <crypt.h>  
 //#endif  
   
 #define pa_pa_cpystrn(strDest, strSource, count) strncpy(strDest, strSource, count)  volatile const char * IDENT_PA_MD5_C="$Id$" IDENT_PA_MD5_H;
   
 /* Constants for MD5Transform routine.  /* Constants for MD5Transform routine.
  */   */
Line 192  static unsigned char PADDING[64] = Line 181  static unsigned char PADDING[64] =
   
 /* MD5 initialization. Begins an MD5 operation, writing a new context.  /* MD5 initialization. Begins an MD5 operation, writing a new context.
  */   */
 PA_API_EXPORT(void) pa_MD5Init(PA_MD5_CTX *context)  void pa_MD5Init(PA_MD5_CTX *context)
 {  {
     context->count[0] = context->count[1] = 0;      context->count[0] = context->count[1] = 0;
     /* Load magic initialization constants. */      /* Load magic initialization constants. */
Line 206  PA_API_EXPORT(void) pa_MD5Init(PA_MD5_CT Line 195  PA_API_EXPORT(void) pa_MD5Init(PA_MD5_CT
    operation, processing another message block, and updating the     operation, processing another message block, and updating the
    context.     context.
  */   */
 PA_API_EXPORT(void) pa_MD5Update(PA_MD5_CTX *context, const unsigned char *input,  void pa_MD5Update(PA_MD5_CTX *context, const unsigned char *input,
                               unsigned int inputLen)                                unsigned int inputLen)
 {  {
     unsigned int i, idx, partLen;      unsigned int i, idx, partLen;
Line 266  PA_API_EXPORT(void) pa_MD5Update(PA_MD5_ Line 255  PA_API_EXPORT(void) pa_MD5Update(PA_MD5_
 /* MD5 finalization. Ends an MD5 message-digest operation, writing the  /* MD5 finalization. Ends an MD5 message-digest operation, writing the
    the message digest and zeroizing the context.     the message digest and zeroizing the context.
  */   */
 PA_API_EXPORT(void) pa_MD5Final(unsigned char digest[16], PA_MD5_CTX *context)  void pa_MD5Final(unsigned char digest[16], PA_MD5_CTX *context)
 {  {
     unsigned char bits[8];      unsigned char bits[8];
     unsigned int idx, padLen;      unsigned int idx, padLen;
Line 427  static void Decode(UINT4 *output, const Line 416  static void Decode(UINT4 *output, const
  * the FreeBSD 3.0 /usr/src/lib/libcrypt/crypt.c file, which is   * the FreeBSD 3.0 /usr/src/lib/libcrypt/crypt.c file, which is
  * licenced as stated at the top of this file.   * licenced as stated at the top of this file.
  */   */
 PA_API_EXPORT(void) pa_to64(char *s, unsigned long v, int n)  void pa_to64(char *s, unsigned long v, int n)
 {  {
     static unsigned char itoa64[] =         /* 0 ... 63 => ASCII - 64 */      static unsigned char itoa64[] =         /* 0 ... 63 => ASCII - 64 */
         "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";          "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
Line 438  PA_API_EXPORT(void) pa_to64(char *s, uns Line 427  PA_API_EXPORT(void) pa_to64(char *s, uns
     }      }
 }  }
   
 PA_API_EXPORT(void) pa_MD5Encode(const unsigned char *pw,  void pa_MD5Encode(const unsigned char *pw,
                               const unsigned char *salt,                                const unsigned char *salt,
                               char *result, size_t nbytes)                                char *result, size_t nbytes)
 {  {
Line 538  PA_API_EXPORT(void) pa_MD5Encode(const u Line 527  PA_API_EXPORT(void) pa_MD5Encode(const u
      * Now make the output string.  We know our limitations, so we       * Now make the output string.  We know our limitations, so we
      * can use the string routines without bounds checking.       * can use the string routines without bounds checking.
      */       */
     pa_pa_cpystrn(passwd, PA_MD5PW_ID, PA_MD5PW_IDLEN + 1);      strncpy(passwd, PA_MD5PW_ID, PA_MD5PW_IDLEN + 1);
     pa_pa_cpystrn(passwd + PA_MD5PW_IDLEN, (char *)sp, sl + 1);      strncpy(passwd + PA_MD5PW_IDLEN, (char *)sp, sl + 1);
     passwd[PA_MD5PW_IDLEN + sl]     = '$';      passwd[PA_MD5PW_IDLEN + sl]     = '$';
     passwd[PA_MD5PW_IDLEN + sl + 1] = '\0';      passwd[PA_MD5PW_IDLEN + sl + 1] = '\0';
   
Line 590  PA_API_EXPORT(void) pa_MD5Encode(const u Line 579  PA_API_EXPORT(void) pa_MD5Encode(const u
      */       */
     memset(final, 0, sizeof(final));      memset(final, 0, sizeof(final));
   
     pa_pa_cpystrn(result, passwd, nbytes - 1);      strncpy(result, passwd, nbytes - 1);
 }  }

Removed from v.1.6.2.1  
changed lines
  Added in v.1.19


E-mail: