summaryrefslogtreecommitdiffstats
path: root/lib/libcrypto/ecdsa/ecs_vrf.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2017-05-02 03:59:44 +0000
committerderaadt <deraadt@openbsd.org>2017-05-02 03:59:44 +0000
commit7de8a6843ca16b4f1c9d2a7eab4c71e8af96a4e6 (patch)
tree3ea360fbba39840d58df496af1ccadf16612454f /lib/libcrypto/ecdsa/ecs_vrf.c
parentMatching vmd(8) part of previous diff (first part of vmctl send/receive). (diff)
downloadwireguard-openbsd-7de8a6843ca16b4f1c9d2a7eab4c71e8af96a4e6.tar.xz
wireguard-openbsd-7de8a6843ca16b4f1c9d2a7eab4c71e8af96a4e6.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 'lib/libcrypto/ecdsa/ecs_vrf.c')
-rw-r--r--lib/libcrypto/ecdsa/ecs_vrf.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/libcrypto/ecdsa/ecs_vrf.c b/lib/libcrypto/ecdsa/ecs_vrf.c
index a4b627ace65..270af94c0da 100644
--- a/lib/libcrypto/ecdsa/ecs_vrf.c
+++ b/lib/libcrypto/ecdsa/ecs_vrf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ecs_vrf.c,v 1.5 2015/02/08 13:35:07 jsing Exp $ */
+/* $OpenBSD: ecs_vrf.c,v 1.6 2017/05/02 03:59:44 deraadt Exp $ */
/*
* Written by Nils Larsch for the OpenSSL project
*/
@@ -107,10 +107,7 @@ ECDSA_verify(int type, const unsigned char *dgst, int dgst_len,
ret = ECDSA_do_verify(dgst, dgst_len, s, eckey);
err:
- if (derlen > 0) {
- explicit_bzero(der, derlen);
- free(der);
- }
+ freezero(der, derlen);
ECDSA_SIG_free(s);
return (ret);
}