]> andersk Git - openssh.git/blobdiff - deattack.c
20010115
[openssh.git] / deattack.c
index 72e7f1e0611e70d898c31ef8ab056ede1364e561..c3c3f08d2eb49089db4599bfd324cd8cc8d4eb89 100644 (file)
@@ -1,5 +1,6 @@
+/*     $OpenBSD: deattack.c,v 1.11 2000/12/19 23:17:56 markus Exp $    */
+
 /*
- * $OpenBSD: deattack.c,v 1.8 2000/08/19 02:17:12 deraadt Exp $
  * Cryptographic attack detector for ssh - source code
  *
  * Copyright (c) 1998 CORE SDI S.A., Buenos Aires, Argentina.
@@ -50,16 +51,16 @@ void
 crc_update(u_int32_t *a, u_int32_t b)
 {
        b ^= *a;
-       *a = ssh_crc32((unsigned char *) &b, sizeof(b));
+       *a = ssh_crc32((u_char *) &b, sizeof(b));
 }
 
 /* detect if a block is used in a particular pattern */
 int
-check_crc(unsigned char *S, unsigned char *buf, u_int32_t len,
-         unsigned char *IV)
+check_crc(u_char *S, u_char *buf, u_int32_t len,
+         u_char *IV)
 {
        u_int32_t crc;
-       unsigned char *c;
+       u_char *c;
 
        crc = 0;
        if (IV && !CMP(S, IV)) {
@@ -81,14 +82,14 @@ check_crc(unsigned char *S, unsigned char *buf, u_int32_t len,
 
 /* Detect a crc32 compensation attack on a packet */
 int
-detect_attack(unsigned char *buf, u_int32_t len, unsigned char *IV)
+detect_attack(u_char *buf, u_int32_t len, u_char *IV)
 {
        static u_int16_t *h = (u_int16_t *) NULL;
-       static u_int16_t n = HASH_MINSIZE / HASH_ENTRYSIZE;
+       static u_int32_t n = HASH_MINSIZE / HASH_ENTRYSIZE;
        register u_int32_t i, j;
        u_int32_t l;
-       register unsigned char *c;
-       unsigned char *d;
+       register u_char *c;
+       u_char *d;
 
        if (len > (SSH_MAXBLOCKS * SSH_BLOCKSIZE) ||
            len % SSH_BLOCKSIZE != 0) {
This page took 0.147141 seconds and 4 git commands to generate.