diff options
author | 1999-11-24 19:53:43 +0000 | |
---|---|---|
committer | 1999-11-24 19:53:43 +0000 | |
commit | bbc3e7c1e8e1af65828ac62d704e08603bfb3791 (patch) | |
tree | 4283772edb80175f48931910dc69d6bca31941f2 /usr.bin/ssh/cipher.c | |
parent | Limit newaliases to root and trusted users; sendmail+gshapiro@sendmail.orG (diff) | |
download | wireguard-openbsd-bbc3e7c1e8e1af65828ac62d704e08603bfb3791.tar.xz wireguard-openbsd-bbc3e7c1e8e1af65828ac62d704e08603bfb3791.zip |
KNF, final part 3
Diffstat (limited to 'usr.bin/ssh/cipher.c')
-rw-r--r-- | usr.bin/ssh/cipher.c | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/usr.bin/ssh/cipher.c b/usr.bin/ssh/cipher.c index 06176271020..2364b71ea84 100644 --- a/usr.bin/ssh/cipher.c +++ b/usr.bin/ssh/cipher.c @@ -12,7 +12,7 @@ */ #include "includes.h" -RCSID("$Id: cipher.c,v 1.17 1999/11/24 00:26:01 deraadt Exp $"); +RCSID("$Id: cipher.c,v 1.18 1999/11/24 19:53:45 markus Exp $"); #include "ssh.h" #include "cipher.h" @@ -116,8 +116,10 @@ detect_cbc_attack(const unsigned char *src, cipher_attack_detected("CRC-32 CBC insertion attack detected"); } -/* Names of all encryption algorithms. These must match the numbers defined - int cipher.h. */ +/* + * Names of all encryption algorithms. + * These must match the numbers defined in cipher.h. + */ static char *cipher_names[] = { "none", @@ -129,9 +131,11 @@ static char *cipher_names[] = "blowfish" }; -/* Returns a bit mask indicating which ciphers are supported by this - implementation. The bit mask has the corresponding bit set of each - supported cipher. */ +/* + * Returns a bit mask indicating which ciphers are supported by this + * implementation. The bit mask has the corresponding bit set of each + * supported cipher. + */ unsigned int cipher_mask() @@ -153,8 +157,10 @@ cipher_name(int cipher) return cipher_names[cipher]; } -/* Parses the name of the cipher. Returns the number of the corresponding - cipher, or -1 on error. */ +/* + * Parses the name of the cipher. Returns the number of the corresponding + * cipher, or -1 on error. + */ int cipher_number(const char *name) @@ -167,8 +173,10 @@ cipher_number(const char *name) return -1; } -/* Selects the cipher, and keys if by computing the MD5 checksum of the - passphrase and using the resulting 16 bytes as the key. */ +/* + * Selects the cipher, and keys if by computing the MD5 checksum of the + * passphrase and using the resulting 16 bytes as the key. + */ void cipher_set_key_string(CipherContext *context, int cipher, @@ -206,15 +214,18 @@ cipher_set_key(CipherContext *context, int cipher, /* Initialize the initialization vector. */ switch (cipher) { case SSH_CIPHER_NONE: - /* Has to stay for authfile saving of private key with - no passphrase */ + /* + * Has to stay for authfile saving of private key with no + * passphrase + */ break; case SSH_CIPHER_3DES: - /* Note: the least significant bit of each byte of key is - parity, and must be ignored by the implementation. 16 - bytes of key are used (first and last keys are the - same). */ + /* + * Note: the least significant bit of each byte of key is + * parity, and must be ignored by the implementation. 16 + * bytes of key are used (first and last keys are the same). + */ if (keylen < 16) error("Key length %d is insufficient for 3DES.", keylen); des_set_key((void *) padded, context->u.des3.key1); |