summaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorNiels Provos <provos@cvs.openbsd.org>1997-06-24 20:48:42 +0000
committerNiels Provos <provos@cvs.openbsd.org>1997-06-24 20:48:42 +0000
commit94672a5dce650190f7ca828c6f994556b8d60737 (patch)
tree92a242a633ad7d534036d690d230f36a11139907 /sys/netinet
parent38ecd2c22214aee310e99713afeafe2021803f4b (diff)
correct AH options hashing.
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/ip_ahhmacmd5.c12
-rw-r--r--sys/netinet/ip_ahhmacsha1.c12
-rw-r--r--sys/netinet/ip_ahmd5.c10
-rw-r--r--sys/netinet/ip_ahsha1.c10
4 files changed, 22 insertions, 22 deletions
diff --git a/sys/netinet/ip_ahhmacmd5.c b/sys/netinet/ip_ahhmacmd5.c
index 00344beee1c..2b12196fe04 100644
--- a/sys/netinet/ip_ahhmacmd5.c
+++ b/sys/netinet/ip_ahhmacmd5.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ahhmacmd5.c,v 1.9 1997/06/24 12:15:20 provos Exp $ */
+/* $OpenBSD: ip_ahhmacmd5.c,v 1.10 1997/06/24 20:48:40 provos Exp $ */
/*
* The author of this code is John Ioannidis, ji@tla.org,
@@ -236,11 +236,11 @@ ahhmacmd5_input(struct mbuf *m, struct tdb *tdb)
for (off = sizeof(struct ip); off < (ip->ip_hl << 2);)
{
optval = ((u_int8_t *)ip)[off];
- MD5Update(&ctx, &optval, 1);
- switch (IPOPT_NUMBER(optval))
+ switch (optval)
{
case IPOPT_EOL:
case IPOPT_NOP:
+ MD5Update(&ctx, ipseczeroes, 1);
off++;
continue;
@@ -248,13 +248,13 @@ ahhmacmd5_input(struct mbuf *m, struct tdb *tdb)
case 133:
case 134:
optval = ((u_int8_t *)ip)[off + 1];
- MD5Update(&ctx, (u_int8_t *)ip + off + 1, optval - 1);
+ MD5Update(&ctx, (u_int8_t *)ip + off, optval);
off += optval;
continue;
default:
- MD5Update(&ctx, &optval, 1);
- MD5Update(&ctx, ipseczeroes, optval - 2);
+ optval = ((u_int8_t *)ip)[off + 1];
+ MD5Update(&ctx, ipseczeroes, optval);
off += optval;
continue;
}
diff --git a/sys/netinet/ip_ahhmacsha1.c b/sys/netinet/ip_ahhmacsha1.c
index 53270358894..4f0ac261006 100644
--- a/sys/netinet/ip_ahhmacsha1.c
+++ b/sys/netinet/ip_ahhmacsha1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ahhmacsha1.c,v 1.7 1997/06/24 12:15:20 provos Exp $ */
+/* $OpenBSD: ip_ahhmacsha1.c,v 1.8 1997/06/24 20:48:40 provos Exp $ */
/*
* The author of this code is John Ioannidis, ji@tla.org,
@@ -237,11 +237,11 @@ ahhmacsha1_input(struct mbuf *m, struct tdb *tdb)
for (off = sizeof(struct ip); off < (ip->ip_hl << 2);)
{
optval = ((u_int8_t *)ip)[off];
- SHA1Update(&ctx, &optval, 1);
- switch (IPOPT_NUMBER(optval))
+ switch (optval)
{
case IPOPT_EOL:
case IPOPT_NOP:
+ SHA1Update(&ctx, ipseczeroes, 1);
off++;
continue;
@@ -249,13 +249,13 @@ ahhmacsha1_input(struct mbuf *m, struct tdb *tdb)
case 133:
case 134:
optval = ((u_int8_t *)ip)[off + 1];
- SHA1Update(&ctx, (u_int8_t *)ip + off + 1, optval - 1);
+ SHA1Update(&ctx, (u_int8_t *)ip + off, optval);
off += optval;
continue;
default:
- SHA1Update(&ctx, &optval, 1);
- SHA1Update(&ctx, ipseczeroes, optval - 2);
+ optval = ((u_int8_t *)ip)[off + 1];
+ SHA1Update(&ctx, ipseczeroes, optval);
off += optval;
continue;
}
diff --git a/sys/netinet/ip_ahmd5.c b/sys/netinet/ip_ahmd5.c
index fdd9fa1c232..b3e7106ebc4 100644
--- a/sys/netinet/ip_ahmd5.c
+++ b/sys/netinet/ip_ahmd5.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ahmd5.c,v 1.6 1997/06/24 12:15:21 provos Exp $ */
+/* $OpenBSD: ip_ahmd5.c,v 1.7 1997/06/24 20:48:41 provos Exp $ */
/*
* The author of this code is John Ioannidis, ji@tla.org,
@@ -192,11 +192,11 @@ ahmd5_input(struct mbuf *m, struct tdb *tdb)
for (off = sizeof(struct ip); off < (ip->ip_hl << 2);)
{
optval = ((u_int8_t *)ip)[off];
- MD5Update(&ctx, &optval, 1);
switch (optval)
{
case IPOPT_EOL:
case IPOPT_NOP:
+ MD5Update(&ctx, ipseczeroes, 1);
off++;
continue;
@@ -204,13 +204,13 @@ ahmd5_input(struct mbuf *m, struct tdb *tdb)
case 133:
case 134:
optval = ((u_int8_t *)ip)[off + 1];
- MD5Update(&ctx, (u_int8_t *)ip + off + 1, optval - 1);
+ MD5Update(&ctx, (u_int8_t *)ip + off, optval);
off += optval;
continue;
default:
- MD5Update(&ctx, &optval, 1);
- MD5Update(&ctx, ipseczeroes, optval - 2);
+ optval = ((u_int8_t *)ip)[off + 1];
+ MD5Update(&ctx, ipseczeroes, optval);
off += optval;
continue;
}
diff --git a/sys/netinet/ip_ahsha1.c b/sys/netinet/ip_ahsha1.c
index 883383eb3b7..ef8d7831f89 100644
--- a/sys/netinet/ip_ahsha1.c
+++ b/sys/netinet/ip_ahsha1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ahsha1.c,v 1.2 1997/06/24 12:15:21 provos Exp $ */
+/* $OpenBSD: ip_ahsha1.c,v 1.3 1997/06/24 20:48:41 provos Exp $ */
/*
* The author of this code is John Ioannidis, ji@tla.org,
@@ -191,11 +191,11 @@ ahsha1_input(struct mbuf *m, struct tdb *tdb)
for (off = sizeof(struct ip); off < (ip->ip_hl << 2);)
{
optval = ((u_int8_t *)ip)[off];
- SHA1Update(&ctx, &optval, 1);
switch (IPOPT_NUMBER(optval))
{
case IPOPT_EOL:
case IPOPT_NOP:
+ SHA1Update(&ctx, ipseczeroes, 1);
off++;
continue;
@@ -203,13 +203,13 @@ ahsha1_input(struct mbuf *m, struct tdb *tdb)
case 133:
case 134:
optval = ((u_int8_t *)ip)[off + 1];
- SHA1Update(&ctx, (u_int8_t *)ip + off + 1, optval - 1);
+ SHA1Update(&ctx, (u_int8_t *)ip + off, optval);
off += optval;
continue;
default:
- SHA1Update(&ctx, &optval, 1);
- SHA1Update(&ctx, ipseczeroes, optval - 2);
+ optval = ((u_int8_t *)ip)[off + 1];
+ SHA1Update(&ctx, ipseczeroes, optval);
off += optval;
continue;
}