Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libcrypt remove the option to build this against openssl...



details:   https://anonhg.NetBSD.org/src/rev/579598e19043
branches:  trunk
changeset: 771704:579598e19043
user:      drochner <drochner%NetBSD.org@localhost>
date:      Tue Nov 29 17:27:10 2011 +0000

description:
remove the option to build this against openssl - this hasn't been used
in the NetBSD build
since the libc version of MD5Final zeroes out the context, replace
the bzero introduced in the previous commit by comments telling that

diffstat:

 lib/libcrypt/md5crypt.c |  26 ++++----------------------
 1 files changed, 4 insertions(+), 22 deletions(-)

diffs (69 lines):

diff -r d686eb152240 -r 579598e19043 lib/libcrypt/md5crypt.c
--- a/lib/libcrypt/md5crypt.c   Tue Nov 29 13:27:50 2011 +0000
+++ b/lib/libcrypt/md5crypt.c   Tue Nov 29 17:27:10 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: md5crypt.c,v 1.10 2011/11/29 13:18:52 drochner Exp $   */
+/*     $NetBSD: md5crypt.c,v 1.11 2011/11/29 17:27:10 drochner Exp $   */
 
 /*
  * ----------------------------------------------------------------------------
@@ -15,38 +15,22 @@
 
 #include <sys/cdefs.h>
 #if !defined(lint)
-__RCSID("$NetBSD: md5crypt.c,v 1.10 2011/11/29 13:18:52 drochner Exp $");
+__RCSID("$NetBSD: md5crypt.c,v 1.11 2011/11/29 17:27:10 drochner Exp $");
 #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 <stdio.h>
 #include <string.h>
-#ifdef libcrypto
-#include <openssl/md5.h>
-#else
 #include <md5.h>
-#endif
 
 #include "crypt.h"
 
 #define MD5_MAGIC      "$1$"
 #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        UPDATE(x, b, l)         MD5Update((x), (b), (l))
 #define        FINAL(v, x)             MD5Final((v), (x))
-#endif
 
 
 /*
@@ -117,8 +101,7 @@
 
        FINAL(final, &ctx);
 
-       /* Don't leave anything around in vm they could use. */
-       memset(&ctx, 0, sizeof(ctx));
+       /* memset(&ctx, 0, sizeof(ctx)); done by MD5Final() */
 
        /*
         * And now, just to make sure things don't run too fast. On a 60 MHz
@@ -147,8 +130,7 @@
                FINAL(final, &ctx1);
        }
 
-       /* Don't leave anything around in vm they could use. */
-       memset(&ctx1, 0, sizeof(ctx1));
+       /* memset(&ctx1, 0, sizeof(ctx1)); done by MD5Final() */
 
        p = passwd + sl + MD5_MAGIC_LEN + 1;
 



Home | Main Index | Thread Index | Old Index