From 7fe82d8289f4aea5692bfb62d76b5081fe2a6546 Mon Sep 17 00:00:00 2001 From: Hakan Olsson Date: Fri, 29 Jun 2001 18:12:08 +0000 Subject: A few more direct sa_len usages. --- sbin/isakmpd/cookie.c | 6 +++--- sbin/isakmpd/sa.c | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sbin/isakmpd/cookie.c b/sbin/isakmpd/cookie.c index 0219c02d188..39e2d1b781e 100644 --- a/sbin/isakmpd/cookie.c +++ b/sbin/isakmpd/cookie.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cookie.c,v 1.7 2001/06/25 00:00:44 ho Exp $ */ +/* $OpenBSD: cookie.c,v 1.8 2001/06/29 18:12:07 ho Exp $ */ /* $EOM: cookie.c,v 1.21 1999/08/05 15:00:04 niklas Exp $ */ /* @@ -68,9 +68,9 @@ cookie_gen (struct transport *t, struct exchange *exchange, u_int8_t *buf, hash->Init (hash->ctx); (*t->vtbl->get_dst) (t, &name, &name_len); - hash->Update (hash->ctx, (u_int8_t *)name, name_len); + hash->Update (hash->ctx, (u_int8_t *)name, name->sa_len); (*t->vtbl->get_src) (t, &name, &name_len); - hash->Update (hash->ctx, (u_int8_t *)name, name_len); + hash->Update (hash->ctx, (u_int8_t *)name, name->sa_len); if (exchange->initiator == 0) hash->Update (hash->ctx, exchange->cookies + ISAKMP_HDR_ICOOKIE_OFF, ISAKMP_HDR_ICOOKIE_LEN); diff --git a/sbin/isakmpd/sa.c b/sbin/isakmpd/sa.c index eff8ddaa113..5ca81f05815 100644 --- a/sbin/isakmpd/sa.c +++ b/sbin/isakmpd/sa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sa.c,v 1.43 2001/06/07 03:20:21 angelos Exp $ */ +/* $OpenBSD: sa.c,v 1.44 2001/06/29 18:12:07 ho Exp $ */ /* $EOM: sa.c,v 1.112 2000/12/12 00:22:52 niklas Exp $ */ /* @@ -203,7 +203,8 @@ sa_check_peer (struct sa *sa, void *v_addr) return 0; sa->transport->vtbl->get_dst (sa->transport, &dst, &dstlen); - return dstlen == addr->len && memcmp (dst, addr->addr, dstlen) == 0; + return dst->sa_len == addr->len + && memcmp (dst, addr->addr, dst->sa_len) == 0; } struct dst_isakmpspi_arg { -- cgit v1.2.3