Source-Changes-HG archive

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

[src/trunk]: src/lib/libcrypt Handle non-DES encrypted passwords; currently o...



details:   https://anonhg.NetBSD.org/src/rev/918d282fe268
branches:  trunk
changeset: 494425:918d282fe268
user:      ad <ad%NetBSD.org@localhost>
date:      Thu Jul 06 11:13:49 2000 +0000

description:
Handle non-DES encrypted passwords; currently only MD5.

diffstat:

 lib/libcrypt/crypt.c |  18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diffs (46 lines):

diff -r 78178946581a -r 918d282fe268 lib/libcrypt/crypt.c
--- a/lib/libcrypt/crypt.c      Thu Jul 06 11:12:42 2000 +0000
+++ b/lib/libcrypt/crypt.c      Thu Jul 06 11:13:49 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: crypt.c,v 1.15 2000/06/16 16:27:32 thorpej Exp $       */
+/*     $NetBSD: crypt.c,v 1.16 2000/07/06 11:13:49 ad Exp $    */
 
 /*
  * Copyright (c) 1989, 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)crypt.c    8.1.1.1 (Berkeley) 8/18/93";
 #else
-__RCSID("$NetBSD: crypt.c,v 1.15 2000/06/16 16:27:32 thorpej Exp $");
+__RCSID("$NetBSD: crypt.c,v 1.16 2000/07/06 11:13:49 ad Exp $");
 #endif
 #endif /* not lint */
 
@@ -480,6 +480,7 @@
        const char *key;
        const char *setting;
 {
+       extern char *__md5crypt(const char *, const char *);    /* XXX */
        char *encp;
        int32_t i;
        int t;
@@ -487,6 +488,19 @@
        int num_iter, salt_size;
        C_block keyblock, rsltblock;
 
+       /* Non-DES encryption schemes hook in here. */
+       if (setting[0] == _PASSWORD_NONDES) {
+               switch (setting[1]) {
+#ifdef notyet
+               case '2':
+                       return (__bcrypt(key, setting));
+#endif
+               case '1':
+               default:
+                       return (__md5crypt(key, setting));
+               }
+       }
+
        for (i = 0; i < 8; i++) {
                if ((t = 2*(unsigned char)(*key)) != 0)
                        key++;



Home | Main Index | Thread Index | Old Index