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/evp/bio_enc.c | |
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/evp/bio_enc.c')
-rw-r--r-- | src/lib/libcrypto/evp/bio_enc.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/libcrypto/evp/bio_enc.c b/src/lib/libcrypto/evp/bio_enc.c index 1920c6d180..7c7cf9a8b3 100644 --- a/src/lib/libcrypto/evp/bio_enc.c +++ b/src/lib/libcrypto/evp/bio_enc.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bio_enc.c,v 1.19 2015/09/10 15:56:25 jsing Exp $ */ | 1 | /* $OpenBSD: bio_enc.c,v 1.20 2017/05/02 03:59:44 deraadt Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -135,8 +135,7 @@ enc_free(BIO *a) | |||
135 | return (0); | 135 | return (0); |
136 | b = (BIO_ENC_CTX *)a->ptr; | 136 | b = (BIO_ENC_CTX *)a->ptr; |
137 | EVP_CIPHER_CTX_cleanup(&(b->cipher)); | 137 | EVP_CIPHER_CTX_cleanup(&(b->cipher)); |
138 | explicit_bzero(a->ptr, sizeof(BIO_ENC_CTX)); | 138 | freezero(a->ptr, sizeof(BIO_ENC_CTX)); |
139 | free(a->ptr); | ||
140 | a->ptr = NULL; | 139 | a->ptr = NULL; |
141 | a->init = 0; | 140 | a->init = 0; |
142 | a->flags = 0; | 141 | a->flags = 0; |