summaryrefslogtreecommitdiff
path: root/lib/libtls/tls_config.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2017-05-02 03:59:46 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2017-05-02 03:59:46 +0000
commitcc4b23eafa00f2d02bd6a5aeb37a603e5616a1b5 (patch)
tree0c263850a80e2d5ef373e8dffa7717aaaa1e4a4a /lib/libtls/tls_config.c
parentcc386e2f2850053dd843b8a7630c3162a953abc8 (diff)
use freezero() instead of memset/explicit_bzero + free. Substantially
reduces conditional logic (-218, +82). MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH cache alignment calculation bn/bn_exp.c wasn'tt quite right. Two other tricky bits with ASN1_STRING_FLAG_NDEF and BN_FLG_STATIC_DATA where the condition cannot be collapsed completely. Passes regress. ok beck
Diffstat (limited to 'lib/libtls/tls_config.c')
-rw-r--r--lib/libtls/tls_config.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/libtls/tls_config.c b/lib/libtls/tls_config.c
index 65063117e2b..3945da75acd 100644
--- a/lib/libtls/tls_config.c
+++ b/lib/libtls/tls_config.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tls_config.c,v 1.38 2017/04/30 02:10:22 jsing Exp $ */
+/* $OpenBSD: tls_config.c,v 1.39 2017/05/02 03:59:45 deraadt Exp $ */
/*
* Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
*
@@ -188,9 +188,7 @@ tls_config_load_file(struct tls_error *error, const char *filetype,
fail:
if (fd != -1)
close(fd);
- if (*buf != NULL)
- explicit_bzero(*buf, *len);
- free(*buf);
+ freezero(*buf, *len);
*buf = NULL;
*len = 0;