diff options
author | deraadt <> | 2003-08-07 00:30:21 +0000 |
---|---|---|
committer | deraadt <> | 2003-08-07 00:30:21 +0000 |
commit | 9f9cc8ed4f154b827f6b717b6d3cd5fbbb89ccf9 (patch) | |
tree | 5d787255fad632b9194de414f06b2abdc64ee320 | |
parent | a020ac4fb1142d0bfea481464fcb724c23cf8e87 (diff) | |
download | openbsd-9f9cc8ed4f154b827f6b717b6d3cd5fbbb89ccf9.tar.gz openbsd-9f9cc8ed4f154b827f6b717b6d3cd5fbbb89ccf9.tar.bz2 openbsd-9f9cc8ed4f154b827f6b717b6d3cd5fbbb89ccf9.zip |
ansi
-rw-r--r-- | src/lib/libc/crypt/bcrypt.c | 11 | ||||
-rw-r--r-- | src/lib/libc/crypt/md5crypt.c | 15 |
2 files changed, 8 insertions, 18 deletions
diff --git a/src/lib/libc/crypt/bcrypt.c b/src/lib/libc/crypt/bcrypt.c index 35959d1fc4..95251db1cd 100644 --- a/src/lib/libc/crypt/bcrypt.c +++ b/src/lib/libc/crypt/bcrypt.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bcrypt.c,v 1.17 2003/06/25 21:16:47 deraadt Exp $ */ | 1 | /* $OpenBSD: bcrypt.c,v 1.18 2003/08/07 00:28:45 deraadt Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de> | 4 | * Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de> |
@@ -79,8 +79,7 @@ static char error[] = ":"; | |||
79 | const static u_int8_t Base64Code[] = | 79 | const static u_int8_t Base64Code[] = |
80 | "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; | 80 | "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; |
81 | 81 | ||
82 | const static u_int8_t index_64[128] = | 82 | const static u_int8_t index_64[128] = { |
83 | { | ||
84 | 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, | 83 | 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, |
85 | 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, | 84 | 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, |
86 | 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, | 85 | 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, |
@@ -172,12 +171,8 @@ bcrypt_gensalt(u_int8_t log_rounds) | |||
172 | /* We handle $Vers$log2(NumRounds)$salt+passwd$ | 171 | /* We handle $Vers$log2(NumRounds)$salt+passwd$ |
173 | i.e. $2$04$iwouldntknowwhattosayetKdJ6iFtacBqJdKe6aW7ou */ | 172 | i.e. $2$04$iwouldntknowwhattosayetKdJ6iFtacBqJdKe6aW7ou */ |
174 | 173 | ||
175 | char *bcrypt(const char *key, const char *salt); | ||
176 | |||
177 | char * | 174 | char * |
178 | bcrypt(key, salt) | 175 | bcrypt(const char *key, const char *salt) |
179 | const char *key; | ||
180 | const char *salt; | ||
181 | { | 176 | { |
182 | blf_ctx state; | 177 | blf_ctx state; |
183 | u_int32_t rounds, i, k; | 178 | u_int32_t rounds, i, k; |
diff --git a/src/lib/libc/crypt/md5crypt.c b/src/lib/libc/crypt/md5crypt.c index fb09b375e6..97717e68d5 100644 --- a/src/lib/libc/crypt/md5crypt.c +++ b/src/lib/libc/crypt/md5crypt.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: md5crypt.c,v 1.12 2003/06/25 21:16:47 deraadt Exp $ */ | 1 | /* $OpenBSD: md5crypt.c,v 1.13 2003/08/07 00:30:21 deraadt Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * ---------------------------------------------------------------------------- | 4 | * ---------------------------------------------------------------------------- |
@@ -13,7 +13,7 @@ | |||
13 | */ | 13 | */ |
14 | 14 | ||
15 | #if defined(LIBC_SCCS) && !defined(lint) | 15 | #if defined(LIBC_SCCS) && !defined(lint) |
16 | static char rcsid[] = "$OpenBSD: md5crypt.c,v 1.12 2003/06/25 21:16:47 deraadt Exp $"; | 16 | static char rcsid[] = "$OpenBSD: md5crypt.c,v 1.13 2003/08/07 00:30:21 deraadt Exp $"; |
17 | #endif /* LIBC_SCCS and not lint */ | 17 | #endif /* LIBC_SCCS and not lint */ |
18 | 18 | ||
19 | #include <unistd.h> | 19 | #include <unistd.h> |
@@ -28,10 +28,7 @@ static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */ | |||
28 | static void to64(char *, u_int32_t, int); | 28 | static void to64(char *, u_int32_t, int); |
29 | 29 | ||
30 | static void | 30 | static void |
31 | to64(s, v, n) | 31 | to64(char *s, u_int32_t v, int n) |
32 | char *s; | ||
33 | u_int32_t v; | ||
34 | int n; | ||
35 | { | 32 | { |
36 | while (--n >= 0) { | 33 | while (--n >= 0) { |
37 | *s++ = itoa64[v&0x3f]; | 34 | *s++ = itoa64[v&0x3f]; |
@@ -48,9 +45,7 @@ to64(s, v, n) | |||
48 | char *md5crypt(const char *pw, const char *salt); | 45 | char *md5crypt(const char *pw, const char *salt); |
49 | 46 | ||
50 | char * | 47 | char * |
51 | md5crypt(pw, salt) | 48 | md5crypt(const char *pw, const char *salt) |
52 | register const char *pw; | ||
53 | register const char *salt; | ||
54 | { | 49 | { |
55 | /* | 50 | /* |
56 | * This string is magic for this algorithm. Having | 51 | * This string is magic for this algorithm. Having |
@@ -151,7 +146,7 @@ md5crypt(pw, salt) | |||
151 | *p = '\0'; | 146 | *p = '\0'; |
152 | 147 | ||
153 | /* Don't leave anything around in vm they could use. */ | 148 | /* Don't leave anything around in vm they could use. */ |
154 | memset(final,0,sizeof final); | 149 | memset(final, 0, sizeof final); |
155 | 150 | ||
156 | return passwd; | 151 | return passwd; |
157 | } | 152 | } |