summaryrefslogtreecommitdiff
path: root/src/lib/libtls/tls_config.c
diff options
context:
space:
mode:
authorderaadt <>2017-05-02 03:59:45 +0000
committerderaadt <>2017-05-02 03:59:45 +0000
commit5904cc0e04409fde39a97e6580535da34eeb4291 (patch)
treebb9d050c5c2984047e6475e087694d6764f24157 /src/lib/libtls/tls_config.c
parentb3449a25972849293bca9a6fc6581f37f6e0faf6 (diff)
downloadopenbsd-5904cc0e04409fde39a97e6580535da34eeb4291.tar.gz
openbsd-5904cc0e04409fde39a97e6580535da34eeb4291.tar.bz2
openbsd-5904cc0e04409fde39a97e6580535da34eeb4291.zip
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 '')
-rw-r--r--src/lib/libtls/tls_config.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/libtls/tls_config.c b/src/lib/libtls/tls_config.c
index 65063117e2..3945da75ac 100644
--- a/src/lib/libtls/tls_config.c
+++ b/src/lib/libtls/tls_config.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls_config.c,v 1.38 2017/04/30 02:10:22 jsing Exp $ */ 1/* $OpenBSD: tls_config.c,v 1.39 2017/05/02 03:59:45 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -188,9 +188,7 @@ tls_config_load_file(struct tls_error *error, const char *filetype,
188 fail: 188 fail:
189 if (fd != -1) 189 if (fd != -1)
190 close(fd); 190 close(fd);
191 if (*buf != NULL) 191 freezero(*buf, *len);
192 explicit_bzero(*buf, *len);
193 free(*buf);
194 *buf = NULL; 192 *buf = NULL;
195 *len = 0; 193 *len = 0;
196 194