summaryrefslogtreecommitdiff
path: root/deattack.c
diff options
context:
space:
mode:
authordamien <damien>1999-11-08 05:15:55 +0000
committerdamien <damien>1999-11-08 05:15:55 +0000
commite1874d493b4425164250febe3cb779c8be6d530b (patch)
treecd57567ddb3371c0c805a8bd8ace0c66df02fa53 /deattack.c
parentfba3e935b790632806615bf16f32917db2312db3 (diff)
downloadopenssh-e1874d493b4425164250febe3cb779c8be6d530b.tar.gz
Merged OpenBSD CVS changes that go awayV_1_2_PRE8
Diffstat (limited to 'deattack.c')
-rw-r--r--deattack.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/deattack.c b/deattack.c
index d5f8608c..afd96e4e 100644
--- a/deattack.c
+++ b/deattack.c
@@ -1,5 +1,5 @@
/*
- * $Id: deattack.c,v 1.1 1999/10/27 03:42:44 damien Exp $
+ * $Id: deattack.c,v 1.2 1999/11/08 05:15:55 damien Exp $
* Cryptographic attack detector for ssh - source code
*
* Copyright (c) 1998 CORE SDI S.A., Buenos Aires, Argentina.
@@ -100,9 +100,10 @@ detect_attack(unsigned char *buf, u_int32_t len, unsigned char *IV)
register unsigned char *c;
unsigned char *d;
-
- assert(len <= (SSH_MAXBLOCKS * SSH_BLOCKSIZE));
- assert(len % SSH_BLOCKSIZE == 0);
+ if (len > (SSH_MAXBLOCKS * SSH_BLOCKSIZE) ||
+ len % SSH_BLOCKSIZE != 0) {
+ fatal("detect_attack: bad length %d", len);
+ }
for (l = n; l < HASH_FACTOR(len / SSH_BLOCKSIZE); l = l << 2);