diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2017-05-02 03:59:46 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2017-05-02 03:59:46 +0000 |
commit | cc4b23eafa00f2d02bd6a5aeb37a603e5616a1b5 (patch) | |
tree | 0c263850a80e2d5ef373e8dffa7717aaaa1e4a4a /lib/libcrypto/pkcs12 | |
parent | cc386e2f2850053dd843b8a7630c3162a953abc8 (diff) |
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 'lib/libcrypto/pkcs12')
-rw-r--r-- | lib/libcrypto/pkcs12/p12_key.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/libcrypto/pkcs12/p12_key.c b/lib/libcrypto/pkcs12/p12_key.c index fd710771a54..d419a9d8359 100644 --- a/lib/libcrypto/pkcs12/p12_key.c +++ b/lib/libcrypto/pkcs12/p12_key.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p12_key.c,v 1.25 2017/01/29 17:49:23 beck Exp $ */ +/* $OpenBSD: p12_key.c,v 1.26 2017/05/02 03:59:45 deraadt Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -88,10 +88,7 @@ PKCS12_key_gen_asc(const char *pass, int passlen, unsigned char *salt, id, iter, n, out, md_type); if (ret <= 0) return 0; - if (unipass) { - explicit_bzero(unipass, uniplen); - free(unipass); - } + freezero(unipass, uniplen); return ret; } |