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 awayV_1_2_PRE8
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 e611d6c7..07491351 100644
--- a/cipher.c
+++ b/cipher.c
@@ -13,7 +13,7 @@ Created: Wed Apr 19 17:41:39 1995 ylo
#include "config.h"
#include "includes.h"
-RCSID("$Id: cipher.c,v 1.3 1999/10/28 05:23:30 damien Exp $");
+RCSID("$Id: cipher.c,v 1.4 1999/11/08 05:15:55 damien Exp $");
#include "ssh.h"
#include "cipher.h"
@@ -93,8 +93,6 @@ swap_bytes(const unsigned char *src, unsigned char *dst_, int n)
char c[4];
} t;
- /* assert((n & 7) == 0); */
-
/* Process 8 bytes every lap. */
for (n = n / 8; n > 0; n--)
{
@@ -248,7 +246,8 @@ void cipher_set_key(CipherContext *context, int cipher,
void cipher_encrypt(CipherContext *context, unsigned char *dest,
const unsigned char *src, unsigned int len)
{
- assert((len & 7) == 0);
+ if ((len & 7) != 0)
+ fatal("cipher_encrypt: bad plaintext length %d", len);
switch (context->type)
{
@@ -280,7 +279,8 @@ void cipher_encrypt(CipherContext *context, unsigned char *dest,
void cipher_decrypt(CipherContext *context, unsigned char *dest,
const unsigned char *src, unsigned int len)
{
- assert((len & 7) == 0);
+ if ((len & 7) != 0)
+ fatal("cipher_decrypt: bad ciphertext length %d", len);
switch (context->type)
{