summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ec_mult.c
diff options
context:
space:
mode:
authorjsing <>2023-03-08 05:45:31 +0000
committerjsing <>2023-03-08 05:45:31 +0000
commitf59a5e932baaa204327818534b8c93267c20bed0 (patch)
tree96a3d2dbc6ef11df6851b53d3d2e1c46dd7f2328 /src/lib/libcrypto/ec/ec_mult.c
parent49f24f2af100d1cc94534c31f0db0ac8072ee4ac (diff)
downloadopenbsd-f59a5e932baaa204327818534b8c93267c20bed0.tar.gz
openbsd-f59a5e932baaa204327818534b8c93267c20bed0.tar.bz2
openbsd-f59a5e932baaa204327818534b8c93267c20bed0.zip
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@
Diffstat (limited to 'src/lib/libcrypto/ec/ec_mult.c')
-rw-r--r--src/lib/libcrypto/ec/ec_mult.c6
1 files changed, 3 insertions, 3 deletions
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 @@
1/* $OpenBSD: ec_mult.c,v 1.27 2022/11/26 16:08:52 tb Exp $ */ 1/* $OpenBSD: ec_mult.c,v 1.28 2023/03/08 05:45:31 jsing Exp $ */
2/* 2/*
3 * Originally written by Bodo Moeller and Nils Larsch for the OpenSSL project. 3 * Originally written by Bodo Moeller and Nils Larsch for the OpenSSL project.
4 */ 4 */
@@ -172,7 +172,7 @@ ec_pre_comp_clear_free(void *pre_)
172 EC_POINT **p; 172 EC_POINT **p;
173 173
174 for (p = pre->points; *p != NULL; p++) { 174 for (p = pre->points; *p != NULL; p++) {
175 EC_POINT_clear_free(*p); 175 EC_POINT_free(*p);
176 explicit_bzero(p, sizeof *p); 176 explicit_bzero(p, sizeof *p);
177 } 177 }
178 free(pre->points); 178 free(pre->points);
@@ -694,7 +694,7 @@ ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *scalar,
694 } 694 }
695 if (val != NULL) { 695 if (val != NULL) {
696 for (v = val; *v != NULL; v++) 696 for (v = val; *v != NULL; v++)
697 EC_POINT_clear_free(*v); 697 EC_POINT_free(*v);
698 free(val); 698 free(val);
699 } 699 }
700 free(val_sub); 700 free(val_sub);