diff options
author | Niels Provos <provos@cvs.openbsd.org> | 1997-02-13 16:58:45 +0000 |
---|---|---|
committer | Niels Provos <provos@cvs.openbsd.org> | 1997-02-13 16:58:45 +0000 |
commit | fb6deadc8889e80cebacc3a4975a6c0da4e88117 (patch) | |
tree | ac0673c9f55543bda9395b15dfb6f95be571d73b /lib | |
parent | 6a54f2d5d7e0f79c7d3228c9c9bccb9473c9b553 (diff) |
added hook for bcrypt
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/crypt/crypt.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/libc/crypt/crypt.c b/lib/libc/crypt/crypt.c index ec2dee8c3f9..e28e94e42f6 100644 --- a/lib/libc/crypt/crypt.c +++ b/lib/libc/crypt/crypt.c @@ -50,7 +50,7 @@ */ #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 */ #include <sys/types.h> @@ -603,9 +603,15 @@ crypt(key, setting) u_char *p, *q; static u_char output[21]; 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) des_init(); |