diff options
author | Damien Miller <djm@mindrot.org> | 1999-11-08 06:15:55 +0100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 1999-11-08 06:15:55 +0100 |
commit | fd7c911f090749774cf1869420523c4811beeeb0 (patch) | |
tree | cd57567ddb3371c0c805a8bd8ace0c66df02fa53 /cipher.c | |
parent | *** empty log message *** (diff) | |
download | openssh-fd7c911f090749774cf1869420523c4811beeeb0.tar.xz openssh-fd7c911f090749774cf1869420523c4811beeeb0.zip |
Merged OpenBSD CVS changes that go awayV_1_2_PRE8
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 #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) { |