[BACK]Return to md5crypt.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / lib / libcrypt

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/lib/libcrypt/md5crypt.c between version 1.10 and 1.11

version 1.10, 2011/11/29 13:18:52 version 1.11, 2011/11/29 17:27:10
Line 18 
Line 18 
 __RCSID("$NetBSD$");  __RCSID("$NetBSD$");
 #endif /* not lint */  #endif /* not lint */
   
 /*  
  * NOTE: We are also built for inclusion in libcrypto; when built for that  
  * environment, use the libcrypto versions of the MD5 routines, so save  
  * having to pull two versions into the same program.  
  */  
   
 #include <unistd.h>  #include <unistd.h>
 #include <stdio.h>  #include <stdio.h>
 #include <string.h>  #include <string.h>
 #ifdef libcrypto  
 #include <openssl/md5.h>  
 #else  
 #include <md5.h>  #include <md5.h>
 #endif  
   
 #include "crypt.h"  #include "crypt.h"
   
 #define MD5_MAGIC       "$1$"  #define MD5_MAGIC       "$1$"
 #define MD5_MAGIC_LEN   3  #define MD5_MAGIC_LEN   3
   
 #ifdef libcrypto  
 #define INIT(x)                 MD5_Init((x))  
 #define UPDATE(x, b, l)         MD5_Update((x), (b), (l))  
 #define FINAL(v, x)             MD5_Final((v), (x))  
 #else  
 #define INIT(x)                 MD5Init((x))  #define INIT(x)                 MD5Init((x))
 #define UPDATE(x, b, l)         MD5Update((x), (b), (l))  #define UPDATE(x, b, l)         MD5Update((x), (b), (l))
 #define FINAL(v, x)             MD5Final((v), (x))  #define FINAL(v, x)             MD5Final((v), (x))
 #endif  
   
   
 /*  /*
Line 117  __md5crypt(const char *pw, const char *s
Line 101  __md5crypt(const char *pw, const char *s
   
         FINAL(final, &ctx);          FINAL(final, &ctx);
   
         /* Don't leave anything around in vm they could use. */          /* memset(&ctx, 0, sizeof(ctx)); done by MD5Final() */
         memset(&ctx, 0, sizeof(ctx));  
   
         /*          /*
          * And now, just to make sure things don't run too fast. On a 60 MHz           * And now, just to make sure things don't run too fast. On a 60 MHz
Line 147  __md5crypt(const char *pw, const char *s
Line 130  __md5crypt(const char *pw, const char *s
                 FINAL(final, &ctx1);                  FINAL(final, &ctx1);
         }          }
   
         /* Don't leave anything around in vm they could use. */          /* memset(&ctx1, 0, sizeof(ctx1)); done by MD5Final() */
         memset(&ctx1, 0, sizeof(ctx1));  
   
         p = passwd + sl + MD5_MAGIC_LEN + 1;          p = passwd + sl + MD5_MAGIC_LEN + 1;
   

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

CVSweb <webmaster@jp.NetBSD.org>