diff options
author | deraadt <> | 2017-05-02 03:59:45 +0000 |
---|---|---|
committer | deraadt <> | 2017-05-02 03:59:45 +0000 |
commit | 2b561cb0e87f2ee535e8c64907883cd275ad3fec (patch) | |
tree | bb9d050c5c2984047e6475e087694d6764f24157 /src/lib/libtls | |
parent | 024e2580a5280d4df3724dab76ce52e14fe2060c (diff) | |
download | openbsd-2b561cb0e87f2ee535e8c64907883cd275ad3fec.tar.gz openbsd-2b561cb0e87f2ee535e8c64907883cd275ad3fec.tar.bz2 openbsd-2b561cb0e87f2ee535e8c64907883cd275ad3fec.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 'src/lib/libtls')
-rw-r--r-- | src/lib/libtls/tls_config.c | 6 |
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 | ||