Source-Changes-HG archive

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

[src/netbsd-1-5]: src/lib/libcrypt Pull up revisions 1.16-1.17 (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/6a3b6484f885
branches:  netbsd-1-5
changeset: 492589:6a3b6484f885
user:      he <he%NetBSD.org@localhost>
date:      Tue Jan 22 19:32:17 2002 +0000

description:
Pull up revisions 1.16-1.17 (requested by jonathan):
  Add support for MD5-hashed passwords.

diffstat:

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

diffs (47 lines):

diff -r 43dc14d4b3a0 -r 6a3b6484f885 lib/libcrypt/crypt.c
--- a/lib/libcrypt/crypt.c      Tue Jan 22 19:31:59 2002 +0000
+++ b/lib/libcrypt/crypt.c      Tue Jan 22 19:32:17 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: crypt.c,v 1.15 2000/06/16 16:27:32 thorpej Exp $       */
+/*     $NetBSD: crypt.c,v 1.15.2.1 2002/01/22 19:32:17 he 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.15.2.1 2002/01/22 19:32:17 he Exp $");
 #endif
 #endif /* not lint */
 
@@ -471,6 +471,8 @@
 static C_block constdatablock;                 /* encryption constant */
 static char    cryptresult[1+4+4+11+1];        /* encrypted result */
 
+extern char *__md5crypt(const char *, const char *);   /* XXX */
+
 /*
  * Return a pointer to static data consisting of the "setting"
  * followed by an encryption produced by the "key" and "setting".
@@ -487,6 +489,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