diff options
author | damien <damien> | 1999-11-08 05:15:55 +0000 |
---|---|---|
committer | damien <damien> | 1999-11-08 05:15:55 +0000 |
commit | e1874d493b4425164250febe3cb779c8be6d530b (patch) | |
tree | cd57567ddb3371c0c805a8bd8ace0c66df02fa53 /deattack.c | |
parent | fba3e935b790632806615bf16f32917db2312db3 (diff) | |
download | openssh-e1874d493b4425164250febe3cb779c8be6d530b.tar.gz |
Merged OpenBSD CVS changes that go awayV_1_2_PRE8
Diffstat (limited to 'deattack.c')
-rw-r--r-- | deattack.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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); |