From f59a5e932baaa204327818534b8c93267c20bed0 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Wed, 8 Mar 2023 05:45:31 +0000 Subject: Always clear EC groups and points on free. Rather than sometimes clearing, turn the free functions into ones that always clear (as we've done elsewhere). Turn the EC_GROUP_clear_free() and EC_POINT_clear_free() functions into wrappers that call the *_free() version. Do similar for the EC_METHOD implementations, removing the group_clear_finish() and point_clear_finish() hooks in the process. ok tb@ --- src/lib/libcrypto/ec/ec_mult.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lib/libcrypto/ec/ec_mult.c') diff --git a/src/lib/libcrypto/ec/ec_mult.c b/src/lib/libcrypto/ec/ec_mult.c index 4b50184ff6..c792725661 100644 --- a/src/lib/libcrypto/ec/ec_mult.c +++ b/src/lib/libcrypto/ec/ec_mult.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_mult.c,v 1.27 2022/11/26 16:08:52 tb Exp $ */ +/* $OpenBSD: ec_mult.c,v 1.28 2023/03/08 05:45:31 jsing Exp $ */ /* * Originally written by Bodo Moeller and Nils Larsch for the OpenSSL project. */ @@ -172,7 +172,7 @@ ec_pre_comp_clear_free(void *pre_) EC_POINT **p; for (p = pre->points; *p != NULL; p++) { - EC_POINT_clear_free(*p); + EC_POINT_free(*p); explicit_bzero(p, sizeof *p); } free(pre->points); @@ -694,7 +694,7 @@ ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar, } if (val != NULL) { for (v = val; *v != NULL; v++) - EC_POINT_clear_free(*v); + EC_POINT_free(*v); free(val); } free(val_sub); -- cgit v1.2.3-55-g6feb