summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorderaadt <>1996-10-15 09:25:32 +0000
committerderaadt <>1996-10-15 09:25:32 +0000
commit81819216c0b3c1e58c694f9b383e2817a70d31c9 (patch)
tree4ce504db51f53067796a183ada70f658c437fd82 /src/lib
parent51aec3296c8aa1e3443b0db2ad950a19565908d2 (diff)
downloadopenbsd-81819216c0b3c1e58c694f9b383e2817a70d31c9.tar.gz
openbsd-81819216c0b3c1e58c694f9b383e2817a70d31c9.tar.bz2
openbsd-81819216c0b3c1e58c694f9b383e2817a70d31c9.zip
unused variable noticed by asriel(right?), proto from mccanne; fed to freebsd
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libc/crypt/md5crypt.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/lib/libc/crypt/md5crypt.c b/src/lib/libc/crypt/md5crypt.c
index 3e3c681c8e..4b99360f10 100644
--- a/src/lib/libc/crypt/md5crypt.c
+++ b/src/lib/libc/crypt/md5crypt.c
@@ -1,3 +1,5 @@
1/* $OpenBSD: md5crypt.c,v 1.6 1996/10/15 09:25:32 deraadt Exp $ */
2
1/* 3/*
2 * ---------------------------------------------------------------------------- 4 * ----------------------------------------------------------------------------
3 * "THE BEER-WARE LICENSE" (Revision 42): 5 * "THE BEER-WARE LICENSE" (Revision 42):
@@ -6,20 +8,25 @@
6 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp 8 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
7 * ---------------------------------------------------------------------------- 9 * ----------------------------------------------------------------------------
8 * 10 *
11 * $FreeBSD: crypt.c,v 1.5 1996/10/14 08:34:02 phk Exp $
12 *
9 */ 13 */
10 14
11#if defined(LIBC_SCCS) && !defined(lint) 15#if defined(LIBC_SCCS) && !defined(lint)
12static char rcsid[] = "$OpenBSD: md5crypt.c,v 1.5 1996/09/15 09:30:46 tholo Exp $"; 16static char rcsid[] = "$OpenBSD: md5crypt.c,v 1.6 1996/10/15 09:25:32 deraadt Exp $";
13#endif /* LIBC_SCCS and not lint */ 17#endif /* LIBC_SCCS and not lint */
14 18
15#include <unistd.h> 19#include <unistd.h>
16#include <stdio.h> 20#include <stdio.h>
17#include <string.h> 21#include <string.h>
18#include <md5.h> 22#include <md5.h>
23#include <string.h>
19 24
20static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */ 25static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */
21 "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; 26 "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
22 27
28static void to64 __P((char *, unsigned long, int));
29
23static void 30static void
24to64(s, v, n) 31to64(s, v, n)
25 char *s; 32 char *s;
@@ -47,7 +54,7 @@ md5crypt(pw, salt)
47 * This string is magic for this algorithm. Having 54 * This string is magic for this algorithm. Having
48 * it this way, we can get get better later on 55 * it this way, we can get get better later on
49 */ 56 */
50 static char *magic = "$1$"; 57 static char *magic = "$1$";
51 58
52 static char passwd[120], *p; 59 static char passwd[120], *p;
53 static const char *sp,*ep; 60 static const char *sp,*ep;
@@ -94,11 +101,11 @@ md5crypt(pw, salt)
94 memset(final,0,sizeof final); 101 memset(final,0,sizeof final);
95 102
96 /* Then something really weird... */ 103 /* Then something really weird... */
97 for (j=0,i = strlen(pw); i ; i >>= 1) 104 for (i = strlen(pw); i ; i >>= 1)
98 if(i&1) 105 if(i&1)
99 MD5Update(&ctx, final+j, 1); 106 MD5Update(&ctx, final, 1);
100 else 107 else
101 MD5Update(&ctx, pw+j, 1); 108 MD5Update(&ctx, pw, 1);
102 109
103 /* Now make the output string */ 110 /* Now make the output string */
104 strcpy(passwd,magic); 111 strcpy(passwd,magic);