summaryrefslogtreecommitdiffstats
path: root/lib/libc/crypt/crypt.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1996-07-02 23:05:55 +0000
committerderaadt <deraadt@openbsd.org>1996-07-02 23:05:55 +0000
commit654e819ced37eb20cedcc38888d0dbcf360dd74f (patch)
tree1621f64c5c441c9fdbdf4c5873baecd795587322 /lib/libc/crypt/crypt.c
parentpretty the comment (diff)
downloadwireguard-openbsd-654e819ced37eb20cedcc38888d0dbcf360dd74f.tar.xz
wireguard-openbsd-654e819ced37eb20cedcc38888d0dbcf360dd74f.zip
for magic MD5 salt, call md5crypt()
Diffstat (limited to 'lib/libc/crypt/crypt.c')
-rw-r--r--lib/libc/crypt/crypt.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/libc/crypt/crypt.c b/lib/libc/crypt/crypt.c
index 38b690d8665..074a40bde86 100644
--- a/lib/libc/crypt/crypt.c
+++ b/lib/libc/crypt/crypt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crypt.c,v 1.4 1996/06/03 22:20:35 niklas Exp $ */
+/* $OpenBSD: crypt.c,v 1.5 1996/07/02 23:05:55 deraadt Exp $ */
/*
* FreeSec: libcrypt
@@ -596,14 +596,17 @@ crypt(key, setting)
const char *setting;
{
int i;
- u_int32_t count, salt, l, r0, r1, keybuf[2];
+ u_int32_t count, salt, l, r0, r1, keybuf[2];
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));
if (!des_initialised)
des_init();
-
/*
* Copy the key, shifting each character up by one bit
* and padding with zeros.