summaryrefslogtreecommitdiff
path: root/cipher.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>1999-11-08 16:15:55 +1100
committerDamien Miller <djm@mindrot.org>1999-11-08 16:15:55 +1100
commitfd7c911f090749774cf1869420523c4811beeeb0 (patch)
treecd57567ddb3371c0c805a8bd8ace0c66df02fa53 /cipher.c
parent5ac5f1ca6b5270e1a755d75120f8217f5850c9b2 (diff)
Merged OpenBSD CVS changes that go away
Diffstat (limited to 'cipher.c')
-rw-r--r--cipher.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/cipher.c b/cipher.c
index e611d6c71..074913512 100644
--- a/cipher.c
+++ b/cipher.c
@@ -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"
16RCSID("$Id: cipher.c,v 1.3 1999/10/28 05:23:30 damien Exp $"); 16RCSID("$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,
248void cipher_encrypt(CipherContext *context, unsigned char *dest, 246void 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,
280void cipher_decrypt(CipherContext *context, unsigned char *dest, 279void 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 {