summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorprovos <>1997-02-13 16:58:44 +0000
committerprovos <>1997-02-13 16:58:44 +0000
commit9e4670bb3c582a871c11b2b3e7fd678e9226d6e3 (patch)
tree8b7a3affc944afa2aa963b77470e82d9af3f56f8
parent65c8c3adc70f380ddef61bd104903dcbc6b2fc56 (diff)
downloadopenbsd-9e4670bb3c582a871c11b2b3e7fd678e9226d6e3.tar.gz
openbsd-9e4670bb3c582a871c11b2b3e7fd678e9226d6e3.tar.bz2
openbsd-9e4670bb3c582a871c11b2b3e7fd678e9226d6e3.zip
added hook for bcrypt
-rw-r--r--src/lib/libc/crypt/crypt.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/lib/libc/crypt/crypt.c b/src/lib/libc/crypt/crypt.c
index ec2dee8c3f..e28e94e42f 100644
--- a/src/lib/libc/crypt/crypt.c
+++ b/src/lib/libc/crypt/crypt.c
@@ -50,7 +50,7 @@
50 */ 50 */
51 51
52#if defined(LIBC_SCCS) && !defined(lint) 52#if defined(LIBC_SCCS) && !defined(lint)
53static char rcsid[] = "$OpenBSD: crypt.c,v 1.6 1996/08/19 08:19:49 tholo Exp $"; 53static char rcsid[] = "$OpenBSD: crypt.c,v 1.7 1997/02/13 16:58:44 provos Exp $";
54#endif /* LIBC_SCCS and not lint */ 54#endif /* LIBC_SCCS and not lint */
55 55
56#include <sys/types.h> 56#include <sys/types.h>
@@ -603,9 +603,15 @@ crypt(key, setting)
603 u_char *p, *q; 603 u_char *p, *q;
604 static u_char output[21]; 604 static u_char output[21];
605 extern char *md5crypt __P((const char *, const char *)); 605 extern char *md5crypt __P((const char *, const char *));
606 606 extern char *bcrypt __P((const char *, const char *));
607 if (strncmp(setting, "$1$", sizeof("$1")) == 0) 607
608 return (md5crypt(key, setting)); 608 if( setting[0] == '$' )
609 switch(setting[1]) {
610 case '1':
611 return (md5crypt(key, setting));
612 default:
613 return bcrypt(key, setting);
614 }
609 615
610 if (!des_initialised) 616 if (!des_initialised)
611 des_init(); 617 des_init();