From 10823bcb7d0edb95539151a7bf7782c2b1b70563 Mon Sep 17 00:00:00 2001 From: deraadt <> Date: Thu, 7 Aug 2003 00:30:21 +0000 Subject: [PATCH] ansi --- src/lib/libc/crypt/bcrypt.c | 11 +++-------- 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 35959d1f..95251db1 100644 --- a/src/lib/libc/crypt/bcrypt.c +++ b/src/lib/libc/crypt/bcrypt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bcrypt.c,v 1.17 2003/06/25 21:16:47 deraadt Exp $ */ +/* $OpenBSD: bcrypt.c,v 1.18 2003/08/07 00:28:45 deraadt Exp $ */ /* * Copyright 1997 Niels Provos @@ -79,8 +79,7 @@ static char error[] = ":"; const static u_int8_t Base64Code[] = "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; -const static u_int8_t index_64[128] = -{ +const static u_int8_t index_64[128] = { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, @@ -172,12 +171,8 @@ bcrypt_gensalt(u_int8_t log_rounds) /* We handle $Vers$log2(NumRounds)$salt+passwd$ i.e. $2$04$iwouldntknowwhattosayetKdJ6iFtacBqJdKe6aW7ou */ -char *bcrypt(const char *key, const char *salt); - char * -bcrypt(key, salt) - const char *key; - const char *salt; +bcrypt(const char *key, const char *salt) { blf_ctx state; u_int32_t rounds, i, k; diff --git a/src/lib/libc/crypt/md5crypt.c b/src/lib/libc/crypt/md5crypt.c index fb09b375..97717e68 100644 --- a/src/lib/libc/crypt/md5crypt.c +++ b/src/lib/libc/crypt/md5crypt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: md5crypt.c,v 1.12 2003/06/25 21:16:47 deraadt Exp $ */ +/* $OpenBSD: md5crypt.c,v 1.13 2003/08/07 00:30:21 deraadt Exp $ */ /* * ---------------------------------------------------------------------------- @@ -13,7 +13,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: md5crypt.c,v 1.12 2003/06/25 21:16:47 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: md5crypt.c,v 1.13 2003/08/07 00:30:21 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include @@ -28,10 +28,7 @@ static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */ static void to64(char *, u_int32_t, int); static void -to64(s, v, n) - char *s; - u_int32_t v; - int n; +to64(char *s, u_int32_t v, int n) { while (--n >= 0) { *s++ = itoa64[v&0x3f]; @@ -48,9 +45,7 @@ to64(s, v, n) char *md5crypt(const char *pw, const char *salt); char * -md5crypt(pw, salt) - register const char *pw; - register const char *salt; +md5crypt(const char *pw, const char *salt) { /* * This string is magic for this algorithm. Having @@ -151,7 +146,7 @@ md5crypt(pw, salt) *p = '\0'; /* Don't leave anything around in vm they could use. */ - memset(final,0,sizeof final); + memset(final, 0, sizeof final); return passwd; }