summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp/e_chacha20poly1305.c
diff options
context:
space:
mode:
authorderaadt <>2017-05-02 03:59:45 +0000
committerderaadt <>2017-05-02 03:59:45 +0000
commit2b561cb0e87f2ee535e8c64907883cd275ad3fec (patch)
treebb9d050c5c2984047e6475e087694d6764f24157 /src/lib/libcrypto/evp/e_chacha20poly1305.c
parent024e2580a5280d4df3724dab76ce52e14fe2060c (diff)
downloadopenbsd-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/e_chacha20poly1305.c')
-rw-r--r--src/lib/libcrypto/evp/e_chacha20poly1305.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/libcrypto/evp/e_chacha20poly1305.c b/src/lib/libcrypto/evp/e_chacha20poly1305.c
index e135f9a104..051d5548b5 100644
--- a/src/lib/libcrypto/evp/e_chacha20poly1305.c
+++ b/src/lib/libcrypto/evp/e_chacha20poly1305.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_chacha20poly1305.c,v 1.15 2017/01/29 17:49:23 beck Exp $ */ 1/* $OpenBSD: e_chacha20poly1305.c,v 1.16 2017/05/02 03:59:44 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2015 Reyk Floter <reyk@openbsd.org> 4 * Copyright (c) 2015 Reyk Floter <reyk@openbsd.org>
@@ -83,8 +83,7 @@ aead_chacha20_poly1305_cleanup(EVP_AEAD_CTX *ctx)
83{ 83{
84 struct aead_chacha20_poly1305_ctx *c20_ctx = ctx->aead_state; 84 struct aead_chacha20_poly1305_ctx *c20_ctx = ctx->aead_state;
85 85
86 explicit_bzero(c20_ctx->key, sizeof(c20_ctx->key)); 86 freezero(c20_ctx, sizeof(c20_ctx));
87 free(c20_ctx);
88} 87}
89 88
90static void 89static void