diff options
author | Niels Provos <provos@cvs.openbsd.org> | 1997-06-24 20:48:42 +0000 |
---|---|---|
committer | Niels Provos <provos@cvs.openbsd.org> | 1997-06-24 20:48:42 +0000 |
commit | 94672a5dce650190f7ca828c6f994556b8d60737 (patch) | |
tree | 92a242a633ad7d534036d690d230f36a11139907 /sys/netinet/ip_ahsha1.c | |
parent | 38ecd2c22214aee310e99713afeafe2021803f4b (diff) |
correct AH options hashing.
Diffstat (limited to 'sys/netinet/ip_ahsha1.c')
-rw-r--r-- | sys/netinet/ip_ahsha1.c | 10 |
1 files changed, 5 insertions, 5 deletions
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; } |