summaryrefslogtreecommitdiffstats
path: root/cipher.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>1999-11-25 11:54:57 +1100
committerDamien Miller <djm@mindrot.org>1999-11-25 11:54:57 +1100
commit5428f646ad32da88ddd04a8c287d595524674fbf (patch)
treecc1f1e5d7852e1f44d41077f776abf7dab7ac06d /cipher.c
parent9072e1889648988da38b7b81bce95291c1dc3a23 (diff)
- More reformatting merged from OpenBSD CVS
- Merged OpenBSD CVS changes: - [channels.c] report from mrwizard@psu.edu via djm@ibs.com.au - [channels.c] set SO_REUSEADDR and SO_LINGER for forwarded ports. chip@valinux.com via damien@ibs.com.au - [nchan.c] it's not an error() if shutdown_write failes in nchan. - [readconf.c] remove dead #ifdef-0-code - [readconf.c servconf.c] strcasecmp instead of tolower - [scp.c] progress meter overflow fix from damien@ibs.com.au - [ssh-add.1 ssh-add.c] SSH_ASKPASS support - [ssh.1 ssh.c] postpone fork_after_authentication until command execution, request/patch from jahakala@cc.jyu.fi via damien@ibs.com.au plus: use daemon() for backgrounding
Diffstat (limited to 'cipher.c')
-rw-r--r--cipher.c43
1 files changed, 27 insertions, 16 deletions
diff --git a/cipher.c b/cipher.c
index 92fcd474..e3bb05d1 100644
--- a/cipher.c
+++ b/cipher.c
@@ -12,7 +12,7 @@
*/
#include "includes.h"
-RCSID("$Id: cipher.c,v 1.7 1999/11/24 13:26:22 damien Exp $");
+RCSID("$Id: cipher.c,v 1.8 1999/11/25 00:54:58 damien Exp $");
#include "ssh.h"
#include "cipher.h"
@@ -121,8 +121,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",
@@ -134,9 +136,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()
@@ -158,8 +162,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)
@@ -172,8 +178,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,
@@ -211,15 +219,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);