summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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();