diff options
Diffstat (limited to 'cipher.c')
-rw-r--r-- | cipher.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -13,7 +13,7 @@ Created: Wed Apr 19 17:41:39 1995 ylo | |||
13 | 13 | ||
14 | #include "config.h" | 14 | #include "config.h" |
15 | #include "includes.h" | 15 | #include "includes.h" |
16 | RCSID("$Id: cipher.c,v 1.3 1999/10/28 05:23:30 damien Exp $"); | 16 | RCSID("$Id: cipher.c,v 1.4 1999/11/08 05:15:55 damien Exp $"); |
17 | 17 | ||
18 | #include "ssh.h" | 18 | #include "ssh.h" |
19 | #include "cipher.h" | 19 | #include "cipher.h" |
@@ -93,8 +93,6 @@ swap_bytes(const unsigned char *src, unsigned char *dst_, int n) | |||
93 | char c[4]; | 93 | char c[4]; |
94 | } t; | 94 | } t; |
95 | 95 | ||
96 | /* assert((n & 7) == 0); */ | ||
97 | |||
98 | /* Process 8 bytes every lap. */ | 96 | /* Process 8 bytes every lap. */ |
99 | for (n = n / 8; n > 0; n--) | 97 | for (n = n / 8; n > 0; n--) |
100 | { | 98 | { |
@@ -248,7 +246,8 @@ void cipher_set_key(CipherContext *context, int cipher, | |||
248 | void cipher_encrypt(CipherContext *context, unsigned char *dest, | 246 | void cipher_encrypt(CipherContext *context, unsigned char *dest, |
249 | const unsigned char *src, unsigned int len) | 247 | const unsigned char *src, unsigned int len) |
250 | { | 248 | { |
251 | assert((len & 7) == 0); | 249 | if ((len & 7) != 0) |
250 | fatal("cipher_encrypt: bad plaintext length %d", len); | ||
252 | 251 | ||
253 | switch (context->type) | 252 | switch (context->type) |
254 | { | 253 | { |
@@ -280,7 +279,8 @@ void cipher_encrypt(CipherContext *context, unsigned char *dest, | |||
280 | void cipher_decrypt(CipherContext *context, unsigned char *dest, | 279 | void cipher_decrypt(CipherContext *context, unsigned char *dest, |
281 | const unsigned char *src, unsigned int len) | 280 | const unsigned char *src, unsigned int len) |
282 | { | 281 | { |
283 | assert((len & 7) == 0); | 282 | if ((len & 7) != 0) |
283 | fatal("cipher_decrypt: bad ciphertext length %d", len); | ||
284 | 284 | ||
285 | switch (context->type) | 285 | switch (context->type) |
286 | { | 286 | { |