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/libcrypto/ecdh | |
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/libcrypto/ecdh')
-rw-r--r-- | src/lib/libcrypto/ecdh/ech_lib.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/libcrypto/ecdh/ech_lib.c b/src/lib/libcrypto/ecdh/ech_lib.c index 06e6a1ee22..2846a88612 100644 --- a/src/lib/libcrypto/ecdh/ech_lib.c +++ b/src/lib/libcrypto/ecdh/ech_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ech_lib.c,v 1.12 2017/01/29 17:49:23 beck Exp $ */ | 1 | /* $OpenBSD: ech_lib.c,v 1.13 2017/05/02 03:59:44 deraadt Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. | 3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. |
4 | * | 4 | * |
@@ -182,9 +182,7 @@ ecdh_data_free(void *data) | |||
182 | 182 | ||
183 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_ECDH, r, &r->ex_data); | 183 | CRYPTO_free_ex_data(CRYPTO_EX_INDEX_ECDH, r, &r->ex_data); |
184 | 184 | ||
185 | explicit_bzero((void *)r, sizeof(ECDH_DATA)); | 185 | freezero(r, sizeof(ECDH_DATA)); |
186 | |||
187 | free(r); | ||
188 | } | 186 | } |
189 | 187 | ||
190 | ECDH_DATA * | 188 | ECDH_DATA * |