summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sbin/isakmpd/ipsec.c18
-rw-r--r--sbin/isakmpd/pf_key_v2.c14
-rw-r--r--sbin/isakmpd/sysdep/openbsd/Makefile.sysdep9
-rw-r--r--sbin/isakmpd/util.c6
4 files changed, 6 insertions, 41 deletions
diff --git a/sbin/isakmpd/ipsec.c b/sbin/isakmpd/ipsec.c
index b1ca3a09050..2cad2c40edb 100644
--- a/sbin/isakmpd/ipsec.c
+++ b/sbin/isakmpd/ipsec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipsec.c,v 1.112 2005/04/06 16:00:20 deraadt Exp $ */
+/* $OpenBSD: ipsec.c,v 1.113 2005/04/08 16:09:25 deraadt Exp $ */
/* $EOM: ipsec.c,v 1.143 2000/12/11 23:57:42 niklas Exp $ */
/*
@@ -461,18 +461,14 @@ ipsec_set_network(u_int8_t *src_id, u_int8_t *dst_id, struct ipsec_sa *isa)
if (!isa->src_net)
goto memfail;
isa->src_net->sa_family = AF_INET;
-#ifndef USE_OLD_SOCKADDR
isa->src_net->sa_len = sizeof(struct sockaddr_in);
-#endif
isa->src_mask = (struct sockaddr *)calloc(1,
sizeof(struct sockaddr_in));
if (!isa->src_mask)
goto memfail;
isa->src_mask->sa_family = AF_INET;
-#ifndef USE_OLD_SOCKADDR
isa->src_mask->sa_len = sizeof(struct sockaddr_in);
-#endif
break;
case IPSEC_ID_IPV6_ADDR:
@@ -482,18 +478,14 @@ ipsec_set_network(u_int8_t *src_id, u_int8_t *dst_id, struct ipsec_sa *isa)
if (!isa->src_net)
goto memfail;
isa->src_net->sa_family = AF_INET6;
-#ifndef USE_OLD_SOCKADDR
isa->src_net->sa_len = sizeof(struct sockaddr_in6);
-#endif
isa->src_mask = (struct sockaddr *)calloc(1,
sizeof(struct sockaddr_in6));
if (!isa->src_mask)
goto memfail;
isa->src_mask->sa_family = AF_INET6;
-#ifndef USE_OLD_SOCKADDR
isa->src_mask->sa_len = sizeof(struct sockaddr_in6);
-#endif
break;
case IPSEC_ID_IPV4_RANGE:
@@ -540,18 +532,14 @@ ipsec_set_network(u_int8_t *src_id, u_int8_t *dst_id, struct ipsec_sa *isa)
if (!isa->dst_net)
goto memfail;
isa->dst_net->sa_family = AF_INET;
-#ifndef USE_OLD_SOCKADDR
isa->dst_net->sa_len = sizeof(struct sockaddr_in);
-#endif
isa->dst_mask = (struct sockaddr *)calloc(1,
sizeof(struct sockaddr_in));
if (!isa->dst_mask)
goto memfail;
isa->dst_mask->sa_family = AF_INET;
-#ifndef USE_OLD_SOCKADDR
isa->dst_mask->sa_len = sizeof(struct sockaddr_in);
-#endif
break;
case IPSEC_ID_IPV6_ADDR:
@@ -561,18 +549,14 @@ ipsec_set_network(u_int8_t *src_id, u_int8_t *dst_id, struct ipsec_sa *isa)
if (!isa->dst_net)
goto memfail;
isa->dst_net->sa_family = AF_INET6;
-#ifndef USE_OLD_SOCKADDR
isa->dst_net->sa_len = sizeof(struct sockaddr_in6);
-#endif
isa->dst_mask = (struct sockaddr *)calloc(1,
sizeof(struct sockaddr_in6));
if (!isa->dst_mask)
goto memfail;
isa->dst_mask->sa_family = AF_INET6;
-#ifndef USE_OLD_SOCKADDR
isa->dst_mask->sa_len = sizeof(struct sockaddr_in6);
-#endif
break;
}
diff --git a/sbin/isakmpd/pf_key_v2.c b/sbin/isakmpd/pf_key_v2.c
index c68514e32d4..678084299c2 100644
--- a/sbin/isakmpd/pf_key_v2.c
+++ b/sbin/isakmpd/pf_key_v2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_key_v2.c,v 1.159 2005/04/08 16:07:21 cloder Exp $ */
+/* $OpenBSD: pf_key_v2.c,v 1.160 2005/04/08 16:09:25 deraadt Exp $ */
/* $EOM: pf_key_v2.c,v 1.79 2000/12/12 00:33:19 niklas Exp $ */
/*
@@ -984,9 +984,7 @@ pf_key_v2_setup_sockaddr(void *res, struct sockaddr *src,
case AF_INET:
ip4_sa = (struct sockaddr_in *) res;
ip4_sa->sin_family = AF_INET;
-#ifndef USE_OLD_SOCKADDR
ip4_sa->sin_len = sizeof *ip4_sa;
-#endif
ip4_sa->sin_port = port;
if (dst)
p = (u_int8_t *) (ingress ?
@@ -1000,9 +998,7 @@ pf_key_v2_setup_sockaddr(void *res, struct sockaddr *src,
case AF_INET6:
ip6_sa = (struct sockaddr_in6 *) res;
ip6_sa->sin6_family = AF_INET6;
-#ifndef USE_OLD_SOCKADDR
ip6_sa->sin6_len = sizeof *ip6_sa;
-#endif
ip6_sa->sin6_port = port;
if (dst)
p = (u_int8_t *) (ingress ?
@@ -2519,19 +2515,15 @@ pf_key_v2_enable_sa(struct sa *sa, struct sa *isakmp_sa)
switch (dst->sa_family) {
case AF_INET:
((struct sockaddr_in *) hostmask)->sin_family = AF_INET;
-#ifndef USE_OLD_SOCKADDR
((struct sockaddr_in *) hostmask)->sin_len =
sizeof(struct in_addr);
-#endif
memset(&((struct sockaddr_in *) hostmask)->sin_addr.s_addr,
0xff, sizeof(struct in_addr));
break;
case AF_INET6:
((struct sockaddr_in6 *) hostmask)->sin6_family = AF_INET6;
-#ifndef USE_OLD_SOCKADDR
((struct sockaddr_in6 *) hostmask)->sin6_len =
sizeof(struct in6_addr);
-#endif
memset(&((struct sockaddr_in6 *) hostmask)->sin6_addr.s6_addr,
0xff, sizeof(struct in6_addr));
break;
@@ -2699,20 +2691,16 @@ pf_key_v2_disable_sa(struct sa *sa, int incoming)
case AF_INET:
((struct sockaddr_in *) hostmask)->sin_family =
AF_INET;
-#ifndef USE_OLD_SOCKADDR
((struct sockaddr_in *) hostmask)->sin_len =
sizeof(struct in_addr);
-#endif
memset(&((struct sockaddr_in *) hostmask)->sin_addr.s_addr,
0xff, sizeof(struct in_addr));
break;
case AF_INET6:
((struct sockaddr_in6 *) hostmask)->sin6_family =
AF_INET6;
-#ifndef USE_OLD_SOCKADDR
((struct sockaddr_in6 *) hostmask)->sin6_len =
sizeof(struct in6_addr);
-#endif
memset(&((struct sockaddr_in6 *) hostmask)->sin6_addr.s6_addr,
0xff, sizeof(struct in6_addr));
break;
diff --git a/sbin/isakmpd/sysdep/openbsd/Makefile.sysdep b/sbin/isakmpd/sysdep/openbsd/Makefile.sysdep
index da3dc976840..2d72338483b 100644
--- a/sbin/isakmpd/sysdep/openbsd/Makefile.sysdep
+++ b/sbin/isakmpd/sysdep/openbsd/Makefile.sysdep
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.sysdep,v 1.25 2004/12/14 10:17:28 mcbride Exp $
+# $OpenBSD: Makefile.sysdep,v 1.26 2005/04/08 16:09:25 deraadt Exp $
# $EOM: Makefile.sysdep,v 1.18 2001/01/26 10:55:22 niklas Exp $
#
@@ -35,8 +35,6 @@ IPSEC_CFLAGS= -DUSE_PF_KEY_V2 -DUSE_DEFAULT_ROUTE
CFLAGS+= -DHAVE_GETIFADDRS -DHAVE_PCAP
CFLAGS+= -DHAVE_CLOSEFROM
-USE_LIBCRYPTO= defined
-
.ifdef FEATURES
.if ${FEATURES:Mpolicy} == "policy"
.if ${MACHINE_ARCH} != "alpha" && ${MACHINE_ARCH} != "vax" && ${MACHINE_ARCH} != "m88k"
@@ -45,8 +43,3 @@ POLICY+= keynote_compat.c
USE_KEYNOTE= defined
.endif
.endif
-
-.ifndef USE_LIBCRYPTO
-DESLIB= -ldes
-DESLIBDEP= ${LIBDES}
-.endif
diff --git a/sbin/isakmpd/util.c b/sbin/isakmpd/util.c
index 4b8c40951bc..6168b22b271 100644
--- a/sbin/isakmpd/util.c
+++ b/sbin/isakmpd/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.53 2005/04/04 19:31:11 deraadt Exp $ */
+/* $OpenBSD: util.c,v 1.54 2005/04/08 16:09:25 deraadt Exp $ */
/* $EOM: util.c,v 1.23 2000/11/23 12:22:08 niklas Exp $ */
/*
@@ -544,7 +544,7 @@ util_ntoa(char **buf, int af, u_int8_t *addr)
bzero(&from, fromlen);
sfrom->sa_family = af;
-#ifndef USE_OLD_SOCKADDR
+
switch (af) {
case AF_INET:
sfrom->sa_len = sizeof(struct sockaddr_in);
@@ -553,7 +553,7 @@ util_ntoa(char **buf, int af, u_int8_t *addr)
sfrom->sa_len = sizeof(struct sockaddr_in6);
break;
}
-#endif
+
memcpy(sockaddr_addrdata(sfrom), addr, sockaddr_addrlen(sfrom));
if (sockaddr2text(sfrom, buf, 0)) {