diff options
| author | deraadt <> | 2017-05-02 03:59:45 +0000 |
|---|---|---|
| committer | deraadt <> | 2017-05-02 03:59:45 +0000 |
| commit | 5904cc0e04409fde39a97e6580535da34eeb4291 (patch) | |
| tree | bb9d050c5c2984047e6475e087694d6764f24157 /src/lib/libcrypto/evp/p_open.c | |
| parent | b3449a25972849293bca9a6fc6581f37f6e0faf6 (diff) | |
| download | openbsd-5904cc0e04409fde39a97e6580535da34eeb4291.tar.gz openbsd-5904cc0e04409fde39a97e6580535da34eeb4291.tar.bz2 openbsd-5904cc0e04409fde39a97e6580535da34eeb4291.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/p_open.c')
| -rw-r--r-- | src/lib/libcrypto/evp/p_open.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/libcrypto/evp/p_open.c b/src/lib/libcrypto/evp/p_open.c index 1eb238dfde..57a46706b9 100644 --- a/src/lib/libcrypto/evp/p_open.c +++ b/src/lib/libcrypto/evp/p_open.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: p_open.c,v 1.18 2017/01/29 17:49:23 beck Exp $ */ | 1 | /* $OpenBSD: p_open.c,v 1.19 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 | * |
| @@ -109,9 +109,7 @@ EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, | |||
| 109 | ret = 1; | 109 | ret = 1; |
| 110 | 110 | ||
| 111 | err: | 111 | err: |
| 112 | if (key != NULL) | 112 | freezero(key, size); |
| 113 | explicit_bzero(key, size); | ||
| 114 | free(key); | ||
| 115 | return (ret); | 113 | return (ret); |
| 116 | } | 114 | } |
| 117 | 115 | ||
