-/* $OpenBSD: pfkey.c,v 1.57 2017/03/27 10:29:02 reyk Exp $ */
+/* $OpenBSD: pfkey.c,v 1.58 2017/04/18 02:29:56 deraadt Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
log_debug("%s: last_used %llu", __func__, *last_used);
done:
- explicit_bzero(data, n);
- free(data);
+ freezero(data, n);
return (ret);
}
log_debug("%s: spi 0x%08x", __func__, *spip);
done:
- explicit_bzero(data, n);
- free(data);
+ freezero(data, n);
return (ret);
}
-/* $OpenBSD: pfkey.c,v 1.58 2017/02/28 16:46:27 bluhm Exp $ */
+/* $OpenBSD: pfkey.c,v 1.59 2017/04/18 02:29:56 deraadt Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
* Copyright (c) 2003, 2004 Markus Friedl <markus@openbsd.org>
err(1, "pfkey_reply: malloc");
if (read(sd, data, len) != len) {
warn("PF_KEY short read");
- explicit_bzero(data, len);
- free(data);
+ freezero(data, len);
return -1;
}
if (datap) {
if (lenp)
*lenp = len;
} else {
- explicit_bzero(data, len);
- free(data);
+ freezero(data, len);
}
if (datap == NULL && hdr.sadb_msg_errno != 0) {
errno = hdr.sadb_msg_errno;
pfkey_monitor_sa(msg, opts);
if (opts & IPSECCTL_OPT_VERBOSE)
pfkey_print_raw(data, len);
- explicit_bzero(data, len);
- free(data);
+ freezero(data, len);
}
close(fd);
return 0;
-/* $OpenBSD: pfkey.c,v 1.48 2017/03/02 19:54:22 renato Exp $ */
+/* $OpenBSD: pfkey.c,v 1.49 2017/04/18 02:29:56 deraadt Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
len = hdr.sadb_msg_len * PFKEY2_CHUNK;
if (read(sd, data, len) != len) {
log_warn("pfkey read");
- explicit_bzero(data, len);
- free(data);
+ freezero(data, len);
return (-1);
}
if (hdr.sadb_msg_type == SADB_GETSPI) {
if (spi == NULL) {
- explicit_bzero(data, len);
- free(data);
+ freezero(data, len);
return (0);
}
}
}
}
- explicit_bzero(data, len);
- free(data);
+ freezero(data, len);
return (0);
}
-/* $OpenBSD: pfkey.c,v 1.10 2016/05/23 19:11:42 renato Exp $ */
+/* $OpenBSD: pfkey.c,v 1.11 2017/04/18 02:29:56 deraadt Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
len = hdr.sadb_msg_len * PFKEY2_CHUNK;
if (read(sd, data, len) != len) {
log_warn("pfkey read");
- explicit_bzero(data, len);
- free(data);
+ freezero(data, len);
return (-1);
}
if (hdr.sadb_msg_type == SADB_GETSPI) {
if (spip == NULL) {
- explicit_bzero(data, len);
- free(data);
+ freezero(data, len);
return (0);
}
}
}
}
- explicit_bzero(data, len);
- free(data);
+ freezero(data, len);
return (0);
}
-/* $OpenBSD: pfkey.c,v 1.27 2016/08/27 04:21:08 guenther Exp $ */
+/* $OpenBSD: pfkey.c,v 1.28 2017/04/18 02:29:56 deraadt Exp $ */
/*
* Copyright (c) 2005 HÃ¥kan Olsson. All rights reserved.
m->sadb_msg_len * CHUNK, p->name);
}
}
- explicit_bzero(sadb, sadbsz);
- free(sadb);
+ freezero(sadb, sadbsz);
}
/* Parse SPD data */
}
}
/* Cleanup. */
- explicit_bzero(spd, spdsz);
- free(spd);
+ freezero(spd, spdsz);
}
net_ctl_send_endsnap(p);