Browse Source

added hook for bcrypt

OPENBSD_2_1
provos 28 years ago
parent
commit
40aaa132e7
1 changed files with 10 additions and 4 deletions
  1. +10
    -4
      src/lib/libc/crypt/crypt.c

+ 10
- 4
src/lib/libc/crypt/crypt.c View File

@ -50,7 +50,7 @@
*/ */
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char rcsid[] = "$OpenBSD: crypt.c,v 1.6 1996/08/19 08:19:49 tholo Exp $";
static char rcsid[] = "$OpenBSD: crypt.c,v 1.7 1997/02/13 16:58:44 provos Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <sys/types.h> #include <sys/types.h>
@ -603,9 +603,15 @@ crypt(key, setting)
u_char *p, *q; u_char *p, *q;
static u_char output[21]; static u_char output[21];
extern char *md5crypt __P((const char *, const char *)); extern char *md5crypt __P((const char *, const char *));
if (strncmp(setting, "$1$", sizeof("$1")) == 0)
return (md5crypt(key, setting));
extern char *bcrypt __P((const char *, const char *));
if( setting[0] == '$' )
switch(setting[1]) {
case '1':
return (md5crypt(key, setting));
default:
return bcrypt(key, setting);
}
if (!des_initialised) if (!des_initialised)
des_init(); des_init();


Loading…
Cancel
Save