-/* $OpenBSD: server.c,v 1.108 2017/03/25 17:25:34 claudio Exp $ */
+/* $OpenBSD: server.c,v 1.109 2017/04/17 21:58:27 deraadt Exp $ */
/*
* Copyright (c) 2006 - 2015 Reyk Floeter <reyk@openbsd.org>
/* We're now done with the public/private key... */
tls_config_clear_keys(srv->srv_tls_config);
- explicit_bzero(srv->srv_conf.tls_cert, srv->srv_conf.tls_cert_len);
- explicit_bzero(srv->srv_conf.tls_key, srv->srv_conf.tls_key_len);
- free(srv->srv_conf.tls_cert);
- free(srv->srv_conf.tls_key);
+ freezero(srv->srv_conf.tls_cert, srv->srv_conf.tls_cert_len);
+ freezero(srv->srv_conf.tls_key, srv->srv_conf.tls_key_len);
srv->srv_conf.tls_cert = NULL;
srv->srv_conf.tls_key = NULL;
srv->srv_conf.tls_cert_len = 0;
free(srv_conf->tls_key_file);
free(srv_conf->tls_ocsp_staple_file);
free(srv_conf->tls_ocsp_staple);
-
- if (srv_conf->tls_cert != NULL) {
- explicit_bzero(srv_conf->tls_cert, srv_conf->tls_cert_len);
- free(srv_conf->tls_cert);
- }
-
- if (srv_conf->tls_key != NULL) {
- explicit_bzero(srv_conf->tls_key, srv_conf->tls_key_len);
- free(srv_conf->tls_key);
- }
+ freezero(srv_conf->tls_cert, srv_conf->tls_cert_len);
+ freezero(srv_conf->tls_key, srv_conf->tls_key_len);
}
void