From cc4b23eafa00f2d02bd6a5aeb37a603e5616a1b5 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Tue, 2 May 2017 03:59:46 +0000 Subject: 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 --- lib/libcrypto/ec/ec_mult.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/libcrypto/ec/ec_mult.c') diff --git a/lib/libcrypto/ec/ec_mult.c b/lib/libcrypto/ec/ec_mult.c index e44104d21c3..a565263bb65 100644 --- a/lib/libcrypto/ec/ec_mult.c +++ b/lib/libcrypto/ec/ec_mult.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_mult.c,v 1.20 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: ec_mult.c,v 1.21 2017/05/02 03:59:44 deraadt Exp $ */ /* * Originally written by Bodo Moeller and Nils Larsch for the OpenSSL project. */ @@ -177,8 +177,7 @@ ec_pre_comp_clear_free(void *pre_) } free(pre->points); } - explicit_bzero(pre, sizeof *pre); - free(pre); + freezero(pre, sizeof *pre); } -- cgit v1.2.3