diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-06-23 03:26:53 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-06-23 03:26:53 +0000 |
commit | 6be7a49258cd787f12d2d4415ea670aaf474da37 (patch) | |
tree | d7d42ce4441e38eacc8369ca12ee67d9f00ef819 /usr.bin/ssh | |
parent | 1448160e154647504f544fa6bf8817750424a662 (diff) |
KNF
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r-- | usr.bin/ssh/cipher.c | 14 | ||||
-rw-r--r-- | usr.bin/ssh/key.c | 10 | ||||
-rw-r--r-- | usr.bin/ssh/tildexpand.c | 5 |
3 files changed, 24 insertions, 5 deletions
diff --git a/usr.bin/ssh/cipher.c b/usr.bin/ssh/cipher.c index 36d616a311c..2279be3aee5 100644 --- a/usr.bin/ssh/cipher.c +++ b/usr.bin/ssh/cipher.c @@ -35,7 +35,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: cipher.c,v 1.59 2002/06/19 18:01:00 markus Exp $"); +RCSID("$OpenBSD: cipher.c,v 1.60 2002/06/23 03:26:52 deraadt Exp $"); #include "xmalloc.h" #include "log.h" @@ -90,11 +90,13 @@ cipher_blocksize(Cipher *c) { return (c->block_size); } + u_int cipher_keylen(Cipher *c) { return (c->key_len); } + u_int cipher_get_number(Cipher *c) { @@ -287,6 +289,7 @@ struct ssh1_3des_ctx { EVP_CIPHER_CTX k1, k2, k3; }; + static int ssh1_3des_init(EVP_CIPHER_CTX *ctx, const u_char *key, const u_char *iv, int enc) @@ -323,6 +326,7 @@ ssh1_3des_init(EVP_CIPHER_CTX *ctx, const u_char *key, const u_char *iv, } return (1); } + static int ssh1_3des_cbc(EVP_CIPHER_CTX *ctx, u_char *dest, const u_char *src, u_int len) { @@ -338,6 +342,7 @@ ssh1_3des_cbc(EVP_CIPHER_CTX *ctx, u_char *dest, const u_char *src, u_int len) return (0); return (1); } + static int ssh1_3des_cleanup(EVP_CIPHER_CTX *ctx) { @@ -350,6 +355,7 @@ ssh1_3des_cleanup(EVP_CIPHER_CTX *ctx) } return (1); } + static const EVP_CIPHER * evp_ssh1_3des(void) { @@ -389,7 +395,9 @@ swap_bytes(const u_char *src, u_char *dst, int n) *dst++ = c[3]; } } + static int (*orig_bf)(EVP_CIPHER_CTX *, u_char *, const u_char *, u_int) = NULL; + static int bf_ssh1_cipher(EVP_CIPHER_CTX *ctx, u_char *out, const u_char *in, u_int len) { @@ -400,6 +408,7 @@ bf_ssh1_cipher(EVP_CIPHER_CTX *ctx, u_char *out, const u_char *in, u_int len) swap_bytes(out, out, len); return (ret); } + static const EVP_CIPHER * evp_ssh1_bf(void) { @@ -442,6 +451,7 @@ ssh_rijndael_init(EVP_CIPHER_CTX *ctx, const u_char *key, const u_char *iv, memcpy(c->r_iv, iv, RIJNDAEL_BLOCKSIZE); return (1); } + static int ssh_rijndael_cbc(EVP_CIPHER_CTX *ctx, u_char *dest, const u_char *src, u_int len) @@ -487,6 +497,7 @@ ssh_rijndael_cbc(EVP_CIPHER_CTX *ctx, u_char *dest, const u_char *src, } return (1); } + static int ssh_rijndael_cleanup(EVP_CIPHER_CTX *ctx) { @@ -499,6 +510,7 @@ ssh_rijndael_cleanup(EVP_CIPHER_CTX *ctx) } return (1); } + static const EVP_CIPHER * evp_rijndael(void) { diff --git a/usr.bin/ssh/key.c b/usr.bin/ssh/key.c index 2d850c8e571..fb1f8410a19 100644 --- a/usr.bin/ssh/key.c +++ b/usr.bin/ssh/key.c @@ -32,7 +32,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" -RCSID("$OpenBSD: key.c,v 1.44 2002/05/31 13:16:48 markus Exp $"); +RCSID("$OpenBSD: key.c,v 1.45 2002/06/23 03:26:19 deraadt Exp $"); #include <openssl/evp.h> @@ -89,6 +89,7 @@ key_new(int type) } return k; } + Key * key_new_private(int type) { @@ -120,6 +121,7 @@ key_new_private(int type) } return k; } + void key_free(Key *k) { @@ -359,6 +361,7 @@ read_bignum(char **cpp, BIGNUM * value) *cpp = cp; return 1; } + static int write_bignum(FILE *f, BIGNUM *num) { @@ -485,6 +488,7 @@ key_read(Key *ret, char **cpp) } return success; } + int key_write(Key *key, FILE *f) { @@ -516,6 +520,7 @@ key_write(Key *key, FILE *f) } return success; } + char * key_type(Key *k) { @@ -532,6 +537,7 @@ key_type(Key *k) } return "unknown"; } + char * key_ssh_name(Key *k) { @@ -545,6 +551,7 @@ key_ssh_name(Key *k) } return "ssh-unknown"; } + u_int key_size(Key *k) { @@ -807,7 +814,6 @@ key_verify( } /* Converts a private to a public key */ - Key * key_demote(Key *k) { diff --git a/usr.bin/ssh/tildexpand.c b/usr.bin/ssh/tildexpand.c index e89a7ade8ac..cbe98114673 100644 --- a/usr.bin/ssh/tildexpand.c +++ b/usr.bin/ssh/tildexpand.c @@ -11,7 +11,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: tildexpand.c,v 1.12 2001/08/11 22:51:27 jakob Exp $"); +RCSID("$OpenBSD: tildexpand.c,v 1.13 2002/06/23 03:25:50 deraadt Exp $"); #include "xmalloc.h" #include "log.h" @@ -67,6 +67,7 @@ tilde_expand_filename(const char *filename, uid_t my_uid) if (len > MAXPATHLEN) fatal("Home directory too long (%d > %d", len-1, MAXPATHLEN-1); expanded = xmalloc(len); - snprintf(expanded, len, "%s%s%s", pw->pw_dir, strcmp(pw->pw_dir, "/") ? "/" : "", cp + 1); + snprintf(expanded, len, "%s%s%s", pw->pw_dir, + strcmp(pw->pw_dir, "/") ? "/" : "", cp + 1); return expanded; } |