summaryrefslogtreecommitdiffstats
path: root/crypto/openssh/deattack.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/openssh/deattack.c')
-rw-r--r--crypto/openssh/deattack.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/crypto/openssh/deattack.c b/crypto/openssh/deattack.c
index df1d224..36023e0 100644
--- a/crypto/openssh/deattack.c
+++ b/crypto/openssh/deattack.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: deattack.c,v 1.10 2000/10/31 13:18:53 markus Exp $ */
+/* $OpenBSD: deattack.c,v 1.13 2001/03/01 02:45:10 deraadt Exp $ */
/*
* Cryptographic attack detector for ssh - source code
@@ -21,7 +21,7 @@
#include "includes.h"
#include "deattack.h"
-#include "ssh.h"
+#include "log.h"
#include "crc32.h"
#include "getput.h"
#include "xmalloc.h"
@@ -44,23 +44,23 @@
/* Hash function (Input keys are cipher results) */
#define HASH(x) GET_32BIT(x)
-#define CMP(a,b) (memcmp(a, b, SSH_BLOCKSIZE))
+#define CMP(a, b) (memcmp(a, b, SSH_BLOCKSIZE))
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)) {
@@ -82,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_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) {
OpenPOWER on IntegriCloud