summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ecdsa/ecs_vrf.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/ecdsa/ecs_vrf.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/ecdsa/ecs_vrf.c')
-rw-r--r--src/lib/libcrypto/ecdsa/ecs_vrf.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/lib/libcrypto/ecdsa/ecs_vrf.c b/src/lib/libcrypto/ecdsa/ecs_vrf.c
index a4b627ace6..270af94c0d 100644
--- a/src/lib/libcrypto/ecdsa/ecs_vrf.c
+++ b/src/lib/libcrypto/ecdsa/ecs_vrf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ecs_vrf.c,v 1.5 2015/02/08 13:35:07 jsing Exp $ */ 1/* $OpenBSD: ecs_vrf.c,v 1.6 2017/05/02 03:59:44 deraadt Exp $ */
2/* 2/*
3 * Written by Nils Larsch for the OpenSSL project 3 * Written by Nils Larsch for the OpenSSL project
4 */ 4 */
@@ -107,10 +107,7 @@ ECDSA_verify(int type, const unsigned char *dgst, int dgst_len,
107 ret = ECDSA_do_verify(dgst, dgst_len, s, eckey); 107 ret = ECDSA_do_verify(dgst, dgst_len, s, eckey);
108 108
109err: 109err:
110 if (derlen > 0) { 110 freezero(der, derlen);
111 explicit_bzero(der, derlen);
112 free(der);
113 }
114 ECDSA_SIG_free(s); 111 ECDSA_SIG_free(s);
115 return (ret); 112 return (ret);
116} 113}