summaryrefslogtreecommitdiff
path: root/cipher.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2001-12-21 14:45:46 +1100
committerDamien Miller <djm@mindrot.org>2001-12-21 14:45:46 +1100
commit9f0f5c64bc4b6144e3fed6a7f538f7c21819a492 (patch)
treef79317ab211f59181a61b526f566e9c8cfe70c73 /cipher.c
parent89681214ca2f50a1b1ed6164c3afe1ce14995ffc (diff)
- deraadt@cvs.openbsd.org 2001/12/19 07:18:56
[auth1.c auth2.c auth2-chall.c auth-bsdauth.c auth.c authfile.c auth.h] [auth-krb4.c auth-rhosts.c auth-skey.c bufaux.c canohost.c channels.c] [cipher.c clientloop.c compat.c compress.c deattack.c key.c log.c mac.c] [match.c misc.c nchan.c packet.c readconf.c rijndael.c rijndael.h scard.c] [servconf.c servconf.h serverloop.c session.c sftp.c sftp-client.c] [sftp-glob.c sftp-int.c sftp-server.c ssh-add.c ssh-agent.c ssh.c] [sshconnect1.c sshconnect2.c sshconnect.c sshd.8 sshd.c sshd_config] [ssh-keygen.c sshlogin.c sshpty.c sshtty.c ttymodes.c uidswap.c] basic KNF done while i was looking for something else
Diffstat (limited to 'cipher.c')
-rw-r--r--cipher.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/cipher.c b/cipher.c
index de25ff096..c02b35161 100644
--- a/cipher.c
+++ b/cipher.c
@@ -35,7 +35,7 @@
35 */ 35 */
36 36
37#include "includes.h" 37#include "includes.h"
38RCSID("$OpenBSD: cipher.c,v 1.47 2001/08/23 11:31:59 markus Exp $"); 38RCSID("$OpenBSD: cipher.c,v 1.48 2001/12/19 07:18:56 deraadt Exp $");
39 39
40#include "xmalloc.h" 40#include "xmalloc.h"
41#include "log.h" 41#include "log.h"
@@ -184,14 +184,14 @@ blowfish_setiv(CipherContext *cc, const u_char *iv, u_int ivlen)
184} 184}
185static void 185static void
186blowfish_cbc_encrypt(CipherContext *cc, u_char *dest, const u_char *src, 186blowfish_cbc_encrypt(CipherContext *cc, u_char *dest, const u_char *src,
187 u_int len) 187 u_int len)
188{ 188{
189 BF_cbc_encrypt((void *)src, dest, len, &cc->u.bf.key, cc->u.bf.iv, 189 BF_cbc_encrypt((void *)src, dest, len, &cc->u.bf.key, cc->u.bf.iv,
190 BF_ENCRYPT); 190 BF_ENCRYPT);
191} 191}
192static void 192static void
193blowfish_cbc_decrypt(CipherContext *cc, u_char *dest, const u_char *src, 193blowfish_cbc_decrypt(CipherContext *cc, u_char *dest, const u_char *src,
194 u_int len) 194 u_int len)
195{ 195{
196 BF_cbc_encrypt((void *)src, dest, len, &cc->u.bf.key, cc->u.bf.iv, 196 BF_cbc_encrypt((void *)src, dest, len, &cc->u.bf.key, cc->u.bf.iv,
197 BF_DECRYPT); 197 BF_DECRYPT);
@@ -289,7 +289,7 @@ rijndael_setkey(CipherContext *cc, const u_char *key, u_int keylen)
289static void 289static void
290rijndael_setiv(CipherContext *cc, const u_char *iv, u_int ivlen) 290rijndael_setiv(CipherContext *cc, const u_char *iv, u_int ivlen)
291{ 291{
292 if (iv == NULL || ivlen != RIJNDAEL_BLOCKSIZE) 292 if (iv == NULL || ivlen != RIJNDAEL_BLOCKSIZE)
293 fatal("bad/no IV for %s.", cc->cipher->name); 293 fatal("bad/no IV for %s.", cc->cipher->name);
294 memcpy(cc->u.rijndael.iv, iv, RIJNDAEL_BLOCKSIZE); 294 memcpy(cc->u.rijndael.iv, iv, RIJNDAEL_BLOCKSIZE);
295} 295}
@@ -417,7 +417,7 @@ u_int
417cipher_mask_ssh1(int client) 417cipher_mask_ssh1(int client)
418{ 418{
419 u_int mask = 0; 419 u_int mask = 0;
420 mask |= 1 << SSH_CIPHER_3DES; /* Mandatory */ 420 mask |= 1 << SSH_CIPHER_3DES; /* Mandatory */
421 mask |= 1 << SSH_CIPHER_BLOWFISH; 421 mask |= 1 << SSH_CIPHER_BLOWFISH;
422 if (client) { 422 if (client) {
423 mask |= 1 << SSH_CIPHER_DES; 423 mask |= 1 << SSH_CIPHER_DES;
@@ -457,7 +457,7 @@ ciphers_valid(const char *names)
457 return 0; 457 return 0;
458 ciphers = cp = xstrdup(names); 458 ciphers = cp = xstrdup(names);
459 for ((p = strsep(&cp, CIPHER_SEP)); p && *p != '\0'; 459 for ((p = strsep(&cp, CIPHER_SEP)); p && *p != '\0';
460 (p = strsep(&cp, CIPHER_SEP))) { 460 (p = strsep(&cp, CIPHER_SEP))) {
461 c = cipher_by_name(p); 461 c = cipher_by_name(p);
462 if (c == NULL || c->number != SSH_CIPHER_SSH2) { 462 if (c == NULL || c->number != SSH_CIPHER_SSH2) {
463 debug("bad cipher %s [%s]", p, names); 463 debug("bad cipher %s [%s]", p, names);