summaryrefslogtreecommitdiff
path: root/sbin/isakmpd
diff options
context:
space:
mode:
authorHans-Joerg Hoexer <hshoexer@cvs.openbsd.org>2005-02-27 13:12:13 +0000
committerHans-Joerg Hoexer <hshoexer@cvs.openbsd.org>2005-02-27 13:12:13 +0000
commita458571f1903e5f772b13da17b87d5825a92a8d2 (patch)
tree11f7ccfd17b076d3fabbc76cbfa9616e8ba277f4 /sbin/isakmpd
parent029d751cb54abd6e29954490d7a1ab467b7202f5 (diff)
where possible, use bzero instead of memset
ok cloder henning
Diffstat (limited to 'sbin/isakmpd')
-rw-r--r--sbin/isakmpd/dnssec.c6
-rw-r--r--sbin/isakmpd/exchange.c6
-rw-r--r--sbin/isakmpd/hash.c6
-rw-r--r--sbin/isakmpd/isakmpd.c6
-rw-r--r--sbin/isakmpd/log.c10
-rw-r--r--sbin/isakmpd/math_2n.c10
-rw-r--r--sbin/isakmpd/message.c4
-rw-r--r--sbin/isakmpd/monitor.c6
-rw-r--r--sbin/isakmpd/monitor_fdpass.c6
-rw-r--r--sbin/isakmpd/nat_traversal.c4
-rw-r--r--sbin/isakmpd/pf_key_v2.c16
-rw-r--r--sbin/isakmpd/policy.c54
-rw-r--r--sbin/isakmpd/sa.c4
-rw-r--r--sbin/isakmpd/util.c8
-rw-r--r--sbin/isakmpd/virtual.c4
-rw-r--r--sbin/isakmpd/x509.c4
16 files changed, 77 insertions, 77 deletions
diff --git a/sbin/isakmpd/dnssec.c b/sbin/isakmpd/dnssec.c
index b7ee75f7860..95b721028ac 100644
--- a/sbin/isakmpd/dnssec.c
+++ b/sbin/isakmpd/dnssec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dnssec.c,v 1.20 2004/06/14 09:55:41 ho Exp $ */
+/* $OpenBSD: dnssec.c,v 1.21 2005/02/27 13:12:12 hshoexer Exp $ */
/*
* Copyright (c) 2001 Håkan Olsson. All rights reserved.
@@ -98,7 +98,7 @@ dns_get_key(int type, struct message *msg, int *keylen)
id = exchange->initiator ? exchange->id_r : exchange->id_i;
id_len = exchange->initiator ? exchange->id_r_len : exchange->id_i_len;
- memset(name, 0, sizeof name);
+ bzero(name, sizeof name);
if (!id || id_len == 0) {
log_print("dns_get_key: ID is missing");
@@ -187,7 +187,7 @@ dns_get_key(int type, struct message *msg, int *keylen)
freerrset(rr);
return 0;
}
- memset(&key_rr, 0, sizeof key_rr);
+ bzero(&key_rr, sizeof key_rr);
/*
* Find a key with the wanted algorithm, if any.
diff --git a/sbin/isakmpd/exchange.c b/sbin/isakmpd/exchange.c
index 8218e21b6a1..0c3c584f020 100644
--- a/sbin/isakmpd/exchange.c
+++ b/sbin/isakmpd/exchange.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exchange.c,v 1.106 2005/01/31 10:30:49 hshoexer Exp $ */
+/* $OpenBSD: exchange.c,v 1.107 2005/02/27 13:12:12 hshoexer Exp $ */
/* $EOM: exchange.c,v 1.143 2000/12/04 00:02:25 angelos Exp $ */
/*
@@ -626,8 +626,8 @@ exchange_create(int phase, int initiator, int doi, int type)
exchange->phase = phase;
exchange->step = 0;
exchange->initiator = initiator;
- memset(exchange->cookies, 0, ISAKMP_HDR_COOKIES_LEN);
- memset(exchange->message_id, 0, ISAKMP_HDR_MESSAGE_ID_LEN);
+ bzero(exchange->cookies, ISAKMP_HDR_COOKIES_LEN);
+ bzero(exchange->message_id, ISAKMP_HDR_MESSAGE_ID_LEN);
exchange->doi = doi_lookup(doi);
exchange->type = type;
exchange->policy_id = -1;
diff --git a/sbin/isakmpd/hash.c b/sbin/isakmpd/hash.c
index 84773f875b0..6aab504d713 100644
--- a/sbin/isakmpd/hash.c
+++ b/sbin/isakmpd/hash.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hash.c,v 1.17 2004/06/14 09:55:41 ho Exp $ */
+/* $OpenBSD: hash.c,v 1.18 2005/02/27 13:12:12 hshoexer Exp $ */
/* $EOM: hash.c,v 1.10 1999/04/17 23:20:34 niklas Exp $ */
/*
@@ -106,7 +106,7 @@ hmac_init(struct hash *hash, unsigned char *okey, unsigned int len)
unsigned int i, blocklen = HMAC_BLOCKLEN;
unsigned char key[HMAC_BLOCKLEN];
- memset(key, 0, blocklen);
+ bzero(key, blocklen);
if (len > blocklen) {
/* Truncate key down to blocklen */
hash->Init(hash->ctx);
@@ -129,7 +129,7 @@ hmac_init(struct hash *hash, unsigned char *okey, unsigned int len)
hash->Init(hash->ctx2);
hash->Update(hash->ctx2, key, blocklen);
- memset(key, 0, blocklen);
+ bzero(key, blocklen);
}
/*
diff --git a/sbin/isakmpd/isakmpd.c b/sbin/isakmpd/isakmpd.c
index 8c742b67353..684161ae284 100644
--- a/sbin/isakmpd/isakmpd.c
+++ b/sbin/isakmpd/isakmpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isakmpd.c,v 1.72 2005/02/25 14:21:20 hshoexer Exp $ */
+/* $OpenBSD: isakmpd.c,v 1.73 2005/02/27 13:12:12 hshoexer Exp $ */
/* $EOM: isakmpd.c,v 1.54 2000/10/05 09:28:22 niklas Exp $ */
/*
@@ -501,7 +501,7 @@ main(int argc, char *argv[])
daemon_shutdown();
/* Setup the descriptors to look for incoming messages at. */
- memset(rfds, 0, mask_size);
+ bzero(rfds, mask_size);
n = transport_fd_set(rfds);
FD_SET(ui_socket, rfds);
if (ui_socket + 1 > n)
@@ -518,7 +518,7 @@ main(int argc, char *argv[])
n = app_socket + 1;
}
/* Setup the descriptors that have pending messages to send. */
- memset(wfds, 0, mask_size);
+ bzero(wfds, mask_size);
m = transport_pending_wfd_set(wfds);
if (m > n)
n = m;
diff --git a/sbin/isakmpd/log.c b/sbin/isakmpd/log.c
index 3b904e43a2e..b4abd320148 100644
--- a/sbin/isakmpd/log.c
+++ b/sbin/isakmpd/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.50 2004/11/08 11:59:37 hshoexer Exp $ */
+/* $OpenBSD: log.c,v 1.51 2005/02/27 13:12:12 hshoexer Exp $ */
/* $EOM: log.c,v 1.30 2000/09/29 08:19:23 niklas Exp $ */
/*
@@ -322,7 +322,7 @@ log_debug_toggle(void)
LOG_DBG((LOG_MISC, 50, "log_debug_toggle: "
"debug levels cleared"));
memcpy(&log_level_copy, &log_level, sizeof log_level);
- memset(&log_level, 0, sizeof log_level);
+ bzero(&log_level, sizeof log_level);
} else {
memcpy(&log_level, &log_level_copy, sizeof log_level);
LOG_DBG((LOG_MISC, 50, "log_debug_toggle: "
@@ -518,8 +518,8 @@ log_packet_iov(struct sockaddr *src, struct sockaddr *dst, struct iovec *iov,
off += iov[i].iov_len;
}
- memset(&hdr, 0, sizeof hdr);
- memset(&udp, 0, sizeof udp);
+ bzero(&hdr, sizeof hdr);
+ bzero(&udp, sizeof udp);
/* isakmp - turn off the encryption bit in the isakmp hdr */
isakmphdr = (struct isakmp_hdr *) packet_buf;
@@ -638,7 +638,7 @@ udp_cksum(struct packhdr *hdr, const struct udphdr *u, u_int16_t *d)
u_int32_t sum;
/* Setup pseudoheader. */
- memset(phu.pa, 0, sizeof phu);
+ bzero(phu.pa, sizeof phu);
switch (ntohl(hdr->sa_family)) {
case AF_INET:
ip4 = &hdr->ip.ip4;
diff --git a/sbin/isakmpd/math_2n.c b/sbin/isakmpd/math_2n.c
index f8828efc527..47efd79ce5f 100644
--- a/sbin/isakmpd/math_2n.c
+++ b/sbin/isakmpd/math_2n.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: math_2n.c,v 1.16 2004/06/14 09:55:41 ho Exp $ */
+/* $OpenBSD: math_2n.c,v 1.17 2005/02/27 13:12:12 hshoexer Exp $ */
/* $EOM: math_2n.c,v 1.15 1999/04/20 09:23:30 niklas Exp $ */
/*
@@ -135,7 +135,7 @@ b2n_resize(b2n_ptr n, unsigned int chunks)
n->dirty = 1;
if (chunks > old)
- memset(n->limp + old, 0, size - CHUNK_BYTES * old);
+ bzero(n->limp + old, size - CHUNK_BYTES * old);
return 0;
}
@@ -213,7 +213,7 @@ b2n_set_str(b2n_ptr n, char *str)
chunks = (CHUNK_BYTES - 1 + len) / CHUNK_BYTES;
if (b2n_resize(n, chunks))
return -1;
- memset(n->limp, 0, CHUNK_BYTES * n->chunks);
+ bzero(n->limp, CHUNK_BYTES * n->chunks);
for (w = 0, i = 0; i < chunks; i++) {
tmp = 0;
@@ -426,7 +426,7 @@ b2n_lshift(b2n_ptr d, b2n_ptr n, unsigned int s)
memmove(d->limp + maj, n->limp, CHUNK_BYTES * chunks);
if (maj)
- memset(d->limp, 0, CHUNK_BYTES * maj);
+ bzero(d->limp, CHUNK_BYTES * maj);
if (add)
d->limp[d->chunks - 1] = 0;
@@ -644,7 +644,7 @@ b2n_div(b2n_ptr q, b2n_ptr r, b2n_ptr n, b2n_ptr m)
if (b2n_resize(q, (sn - sm + CHUNK_MASK) >> CHUNK_SHIFTS))
goto fail;
- memset(q->limp, 0, CHUNK_BYTES * q->chunks);
+ bzero(q->limp, CHUNK_BYTES * q->chunks);
if (b2n_lshift(shift, shift, sn - sm))
goto fail;
diff --git a/sbin/isakmpd/message.c b/sbin/isakmpd/message.c
index 6c03c1888bd..3b3f0074a4a 100644
--- a/sbin/isakmpd/message.c
+++ b/sbin/isakmpd/message.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: message.c,v 1.95 2005/02/24 00:30:41 cloder Exp $ */
+/* $OpenBSD: message.c,v 1.96 2005/02/27 13:12:12 hshoexer Exp $ */
/* $EOM: message.c,v 1.156 2000/10/10 12:36:39 provos Exp $ */
/*
@@ -2518,7 +2518,7 @@ message_init(void)
{
u_int8_t i;
- memset(&payload_map, 0, sizeof payload_map);
+ bzero(&payload_map, sizeof payload_map);
payload_index_max = sizeof payload_revmap / sizeof payload_revmap[0];
for (i = 0; i < payload_index_max; i++) {
diff --git a/sbin/isakmpd/monitor.c b/sbin/isakmpd/monitor.c
index b32170321e9..44415ddfa8e 100644
--- a/sbin/isakmpd/monitor.c
+++ b/sbin/isakmpd/monitor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: monitor.c,v 1.33 2004/11/08 12:40:19 hshoexer Exp $ */
+/* $OpenBSD: monitor.c,v 1.34 2005/02/27 13:12:12 hshoexer Exp $ */
/*
* Copyright (c) 2003 Håkan Olsson. All rights reserved.
@@ -97,7 +97,7 @@ monitor_init(int debug)
struct passwd *pw;
int p[2];
- memset(&m_state, 0, sizeof m_state);
+ bzero(&m_state, sizeof m_state);
if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, p) != 0)
log_fatal("monitor_init: socketpair() failed");
@@ -571,7 +571,7 @@ monitor_loop(int debug)
}
}
- memset(fds, 0, fdsn);
+ bzero(fds, fdsn);
FD_SET(m_state.s, fds);
n = select(maxfd, fds, NULL, NULL, NULL);
diff --git a/sbin/isakmpd/monitor_fdpass.c b/sbin/isakmpd/monitor_fdpass.c
index 01596539a21..021cc20e7fa 100644
--- a/sbin/isakmpd/monitor_fdpass.c
+++ b/sbin/isakmpd/monitor_fdpass.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: monitor_fdpass.c,v 1.11 2004/10/01 04:08:45 jsg Exp $ */
+/* $OpenBSD: monitor_fdpass.c,v 1.12 2005/02/27 13:12:12 hshoexer Exp $ */
/*
* Copyright 2001 Niels Provos <provos@citi.umich.edu>
@@ -44,7 +44,7 @@ mm_send_fd(int socket, int fd)
struct iovec vec;
ssize_t n;
- memset(&msg, 0, sizeof msg);
+ bzero(&msg, sizeof msg);
msg.msg_control = (caddr_t) tmp;
msg.msg_controllen = CMSG_LEN(sizeof(int));
cmsg = CMSG_FIRSTHDR(&msg);
@@ -80,7 +80,7 @@ mm_receive_fd(int socket)
ssize_t n;
int fd;
- memset(&msg, 0, sizeof msg);
+ bzero(&msg, sizeof msg);
vec.iov_base = &ch;
vec.iov_len = 1;
msg.msg_iov = &vec;
diff --git a/sbin/isakmpd/nat_traversal.c b/sbin/isakmpd/nat_traversal.c
index d76265aedd1..6b33329d114 100644
--- a/sbin/isakmpd/nat_traversal.c
+++ b/sbin/isakmpd/nat_traversal.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nat_traversal.c,v 1.8 2004/11/18 18:15:46 hshoexer Exp $ */
+/* $OpenBSD: nat_traversal.c,v 1.9 2005/02/27 13:12:12 hshoexer Exp $ */
/*
* Copyright (c) 2004 Håkan Olsson. All rights reserved.
@@ -252,7 +252,7 @@ nat_t_generate_nat_d_hash(struct message *msg, struct sockaddr *sa,
}
port = sockaddr_port(sa);
- memset(res, 0, *hashlen);
+ bzero(res, *hashlen);
hash->Init(hash->ctx);
hash->Update(hash->ctx, msg->exchange->cookies,
diff --git a/sbin/isakmpd/pf_key_v2.c b/sbin/isakmpd/pf_key_v2.c
index 5fc702e6505..270646025da 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.152 2005/02/25 03:02:41 cloder Exp $ */
+/* $OpenBSD: pf_key_v2.c,v 1.153 2005/02/27 13:12:12 hshoexer Exp $ */
/* $EOM: pf_key_v2.c,v 1.79 2000/12/12 00:33:19 niklas Exp $ */
/*
@@ -648,7 +648,7 @@ pf_key_v2_get_spi(size_t *sz, u_int8_t proto, struct sockaddr *src,
goto cleanup;
#ifdef KAME
- memset(&ssa2, 0, sizeof ssa2);
+ bzero(&ssa2, sizeof ssa2);
ssa2.sadb_x_sa2_exttype = SADB_X_EXT_SA2;
ssa2.sadb_x_sa2_len = sizeof ssa2 / PF_KEY_V2_CHUNK;
ssa2.sadb_x_sa2_mode = 0;
@@ -878,7 +878,7 @@ pf_key_v2_get_kernel_sa(u_int8_t *spi, size_t spi_sz, u_int8_t proto,
}
/* Extract the data. */
- memset(&ksa, 0, sizeof ksa);
+ bzero(&ksa, sizeof ksa);
ext = pf_key_v2_find_ext(ret, SADB_EXT_SA);
if (!ext)
@@ -1288,7 +1288,7 @@ pf_key_v2_set_spi(struct sa *sa, struct proto *proto, int incoming,
goto cleanup;
#ifdef KAME
- memset(&ssa2, 0, sizeof ssa2);
+ bzero(&ssa2, sizeof ssa2);
ssa2.sadb_x_sa2_exttype = SADB_X_EXT_SA2;
ssa2.sadb_x_sa2_len = sizeof ssa2 / PF_KEY_V2_CHUNK;
#if defined (LINUX_IPSEC)
@@ -1324,7 +1324,7 @@ pf_key_v2_set_spi(struct sa *sa, struct proto *proto, int incoming,
#if defined (USE_NAT_TRAVERSAL) && defined (SADB_X_EXT_UDPENCAP)
if (isakmp_sa->flags & SA_FLAG_NAT_T_ENABLE) {
- memset(&udpencap, 0, sizeof udpencap);
+ bzero(&udpencap, sizeof udpencap);
ssa.sadb_sa_flags |= SADB_X_SAFLAGS_UDPENCAP;
udpencap.sadb_x_udpencap_exttype = SADB_X_EXT_UDPENCAP;
udpencap.sadb_x_udpencap_len =
@@ -2187,7 +2187,7 @@ cleanup:
if (!flow)
goto cleanup;
- memset(&ssa2, 0, sizeof ssa2);
+ bzero(&ssa2, sizeof ssa2);
ssa2.sadb_x_sa2_exttype = SADB_X_EXT_SA2;
ssa2.sadb_x_sa2_len = sizeof ssa2 / PF_KEY_V2_CHUNK;
ssa2.sadb_x_sa2_mode = 0;
@@ -2841,7 +2841,7 @@ pf_key_v2_delete_spi(struct sa *sa, struct proto *proto, int incoming)
goto cleanup;
#ifdef KAME
- memset(&ssa2, 0, sizeof ssa2);
+ bzero(&ssa2, sizeof ssa2);
ssa2.sadb_x_sa2_exttype = SADB_X_EXT_SA2;
ssa2.sadb_x_sa2_len = sizeof ssa2 / PF_KEY_V2_CHUNK;
ssa2.sadb_x_sa2_mode = 0;
@@ -4296,7 +4296,7 @@ pf_key_v2_group_spis(struct sa *sa, struct proto *proto1,
if (pf_key_v2_msg_add(grpspis, (struct sadb_ext *)&sa2, 0) == -1)
goto cleanup;
#else
- memset(&kamesa2, 0, sizeof kamesa2);
+ bzero(&kamesa2, sizeof kamesa2);
kamesa2.sadb_x_sa2_exttype = SADB_X_EXT_SA2;
kamesa2.sadb_x_sa2_len = sizeof kamesa2 / PF_KEY_V2_CHUNK;
kamesa2.sadb_x_sa2_mode = 0;
diff --git a/sbin/isakmpd/policy.c b/sbin/isakmpd/policy.c
index a0b140d9297..27759454b98 100644
--- a/sbin/isakmpd/policy.c
+++ b/sbin/isakmpd/policy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: policy.c,v 1.78 2004/08/08 19:11:06 deraadt Exp $ */
+/* $OpenBSD: policy.c,v 1.79 2005/02/27 13:12:12 hshoexer Exp $ */
/* $EOM: policy.c,v 1.49 2000/10/24 13:33:39 niklas Exp $ */
/*
@@ -198,36 +198,36 @@ policy_callback(char *name)
free(remote_id);
remote_id = 0;
}
- memset(remote_ike_address, 0, sizeof remote_ike_address);
- memset(local_ike_address, 0, sizeof local_ike_address);
- memset(ah_life_kbytes, 0, sizeof ah_life_kbytes);
- memset(ah_life_seconds, 0, sizeof ah_life_seconds);
- memset(esp_life_kbytes, 0, sizeof esp_life_kbytes);
- memset(esp_life_seconds, 0, sizeof esp_life_seconds);
- memset(comp_life_kbytes, 0, sizeof comp_life_kbytes);
- memset(comp_life_seconds, 0, sizeof comp_life_seconds);
- memset(ah_key_length, 0, sizeof ah_key_length);
- memset(ah_key_rounds, 0, sizeof ah_key_rounds);
- memset(esp_key_length, 0, sizeof esp_key_length);
- memset(esp_key_rounds, 0, sizeof esp_key_rounds);
- memset(comp_dict_size, 0, sizeof comp_dict_size);
- memset(comp_private_alg, 0, sizeof comp_private_alg);
- memset(remote_filter_addr_upper, 0,
+ bzero(remote_ike_address, sizeof remote_ike_address);
+ bzero(local_ike_address, sizeof local_ike_address);
+ bzero(ah_life_kbytes, sizeof ah_life_kbytes);
+ bzero(ah_life_seconds, sizeof ah_life_seconds);
+ bzero(esp_life_kbytes, sizeof esp_life_kbytes);
+ bzero(esp_life_seconds, sizeof esp_life_seconds);
+ bzero(comp_life_kbytes, sizeof comp_life_kbytes);
+ bzero(comp_life_seconds, sizeof comp_life_seconds);
+ bzero(ah_key_length, sizeof ah_key_length);
+ bzero(ah_key_rounds, sizeof ah_key_rounds);
+ bzero(esp_key_length, sizeof esp_key_length);
+ bzero(esp_key_rounds, sizeof esp_key_rounds);
+ bzero(comp_dict_size, sizeof comp_dict_size);
+ bzero(comp_private_alg, sizeof comp_private_alg);
+ bzero(remote_filter_addr_upper,
sizeof remote_filter_addr_upper);
- memset(remote_filter_addr_lower, 0,
+ bzero(remote_filter_addr_lower,
sizeof remote_filter_addr_lower);
- memset(local_filter_addr_upper, 0,
+ bzero(local_filter_addr_upper,
sizeof local_filter_addr_upper);
- memset(local_filter_addr_lower, 0,
+ bzero(local_filter_addr_lower,
sizeof local_filter_addr_lower);
- memset(remote_id_addr_upper, 0, sizeof remote_id_addr_upper);
- memset(remote_id_addr_lower, 0, sizeof remote_id_addr_lower);
- memset(ah_group_desc, 0, sizeof ah_group_desc);
- memset(esp_group_desc, 0, sizeof esp_group_desc);
- memset(remote_id_port, 0, sizeof remote_id_port);
- memset(remote_filter_port, 0, sizeof remote_filter_port);
- memset(local_filter_port, 0, sizeof local_filter_port);
- memset(phase1_group, 0, sizeof phase1_group);
+ bzero(remote_id_addr_upper, sizeof remote_id_addr_upper);
+ bzero(remote_id_addr_lower, sizeof remote_id_addr_lower);
+ bzero(ah_group_desc, sizeof ah_group_desc);
+ bzero(esp_group_desc, sizeof esp_group_desc);
+ bzero(remote_id_port, sizeof remote_id_port);
+ bzero(remote_filter_port, sizeof remote_filter_port);
+ bzero(local_filter_port, sizeof local_filter_port);
+ bzero(phase1_group, sizeof phase1_group);
dirty = 1;
return "";
diff --git a/sbin/isakmpd/sa.c b/sbin/isakmpd/sa.c
index d1564709c56..ebc1b2e811e 100644
--- a/sbin/isakmpd/sa.c
+++ b/sbin/isakmpd/sa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sa.c,v 1.89 2005/02/24 16:16:46 markus Exp $ */
+/* $OpenBSD: sa.c,v 1.90 2005/02/27 13:12:12 hshoexer Exp $ */
/* $EOM: sa.c,v 1.112 2000/12/12 00:22:52 niklas Exp $ */
/*
@@ -924,7 +924,7 @@ sa_validate_proto_xf(struct proto *match, struct payload *xf, int phase)
if (xf_id != GET_ISAKMP_TRANSFORM_ID(pa->attrs))
continue;
- memset(avs->checked, 0, sizeof avs->checked);
+ bzero(avs->checked, sizeof avs->checked);
if (attribute_map(pa->attrs + ISAKMP_TRANSFORM_SA_ATTRS_OFF,
pa->len - ISAKMP_TRANSFORM_SA_ATTRS_OFF,
sa_validate_xf_attrs, avs) == 0)
diff --git a/sbin/isakmpd/util.c b/sbin/isakmpd/util.c
index 50a95b5a768..005ae1e8d8c 100644
--- a/sbin/isakmpd/util.c
+++ b/sbin/isakmpd/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.49 2004/12/14 10:17:28 mcbride Exp $ */
+/* $OpenBSD: util.c,v 1.50 2005/02/27 13:12:12 hshoexer Exp $ */
/* $EOM: util.c,v 1.23 2000/11/23 12:22:08 niklas Exp $ */
/*
@@ -261,7 +261,7 @@ text2sockaddr(char *address, char *port, struct sockaddr **sa, sa_family_t af,
pid_t pid;
#endif /* USE_DEFAULT_ROUTE */
- memset(&hints, 0, sizeof hints);
+ bzero(&hints, sizeof hints);
if (!allow_name_lookups)
hints.ai_flags = AI_NUMERICHOST;
hints.ai_family = PF_UNSPEC;
@@ -278,7 +278,7 @@ text2sockaddr(char *address, char *port, struct sockaddr **sa, sa_family_t af,
if (!strcmp(address, "default")) {
fd = socket(PF_ROUTE, SOCK_RAW, af);
- memset(buf, 0, sizeof(buf));
+ bzero(buf, sizeof(buf));
rtm = (struct rt_msghdr *)buf;
rtm->rtm_version = RTM_VERSION;
@@ -555,7 +555,7 @@ util_ntoa(char **buf, int af, u_int8_t *addr)
struct sockaddr *sfrom = (struct sockaddr *) & from;
socklen_t fromlen = sizeof from;
- memset(&from, 0, fromlen);
+ bzero(&from, fromlen);
sfrom->sa_family = af;
#ifndef USE_OLD_SOCKADDR
switch (af) {
diff --git a/sbin/isakmpd/virtual.c b/sbin/isakmpd/virtual.c
index dbf5635dbea..c873a7e0c55 100644
--- a/sbin/isakmpd/virtual.c
+++ b/sbin/isakmpd/virtual.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: virtual.c,v 1.10 2004/12/14 10:17:28 mcbride Exp $ */
+/* $OpenBSD: virtual.c,v 1.11 2005/02/27 13:12:12 hshoexer Exp $ */
/*
* Copyright (c) 2004 Håkan Olsson. All rights reserved.
@@ -310,7 +310,7 @@ virtual_bind_ADDR_ANY(sa_family_t af)
struct transport *t;
struct in6_addr in6addr_any = IN6ADDR_ANY_INIT;
- memset(&dflt_stor, 0, sizeof dflt_stor);
+ bzero(&dflt_stor, sizeof dflt_stor);
switch (af) {
case AF_INET:
d4->sin_family = af;
diff --git a/sbin/isakmpd/x509.c b/sbin/isakmpd/x509.c
index 0edce94ee34..af396bcb490 100644
--- a/sbin/isakmpd/x509.c
+++ b/sbin/isakmpd/x509.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509.c,v 1.95 2004/08/10 19:21:01 deraadt Exp $ */
+/* $OpenBSD: x509.c,v 1.96 2005/02/27 13:12:12 hshoexer Exp $ */
/* $EOM: x509.c,v 1.54 2001/01/16 18:42:16 ho Exp $ */
/*
@@ -1048,7 +1048,7 @@ x509_certreq_decode(u_int8_t *asn, u_int32_t len)
"CA' info");
goto fail;
}
- memset(&naca, 0, sizeof(naca));
+ bzero(&naca, sizeof(naca));
tmp = asn_decompose("aca.RelativeDistinguishedName."
"AttributeValueAssertion", &aca);