From 2b561cb0e87f2ee535e8c64907883cd275ad3fec Mon Sep 17 00:00:00 2001 From: deraadt <> Date: Tue, 2 May 2017 03:59:45 +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 --- src/lib/libcrypto/modes/gcm128.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/lib/libcrypto/modes/gcm128.c') diff --git a/src/lib/libcrypto/modes/gcm128.c b/src/lib/libcrypto/modes/gcm128.c index 95ee755f83..c080d9c16a 100644 --- a/src/lib/libcrypto/modes/gcm128.c +++ b/src/lib/libcrypto/modes/gcm128.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gcm128.c,v 1.15 2016/11/04 17:30:30 miod Exp $ */ +/* $OpenBSD: gcm128.c,v 1.16 2017/05/02 03:59:44 deraadt Exp $ */ /* ==================================================================== * Copyright (c) 2010 The OpenSSL Project. All rights reserved. * @@ -1538,8 +1538,5 @@ GCM128_CONTEXT *CRYPTO_gcm128_new(void *key, block128_f block) void CRYPTO_gcm128_release(GCM128_CONTEXT *ctx) { - if (ctx) { - explicit_bzero(ctx,sizeof(*ctx)); - free(ctx); - } + freezero(ctx, sizeof(*ctx)); } -- cgit v1.2.3-55-g6feb