diff options
Diffstat (limited to 'cipher.c')
-rw-r--r-- | cipher.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -35,7 +35,7 @@ | |||
35 | */ | 35 | */ |
36 | 36 | ||
37 | #include "includes.h" | 37 | #include "includes.h" |
38 | RCSID("$OpenBSD: cipher.c,v 1.47 2001/08/23 11:31:59 markus Exp $"); | 38 | RCSID("$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 | } |
185 | static void | 185 | static void |
186 | blowfish_cbc_encrypt(CipherContext *cc, u_char *dest, const u_char *src, | 186 | blowfish_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 | } |
192 | static void | 192 | static void |
193 | blowfish_cbc_decrypt(CipherContext *cc, u_char *dest, const u_char *src, | 193 | blowfish_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) | |||
289 | static void | 289 | static void |
290 | rijndael_setiv(CipherContext *cc, const u_char *iv, u_int ivlen) | 290 | rijndael_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 | |||
417 | cipher_mask_ssh1(int client) | 417 | cipher_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); |