diff options
| author | jsing <> | 2023-03-08 05:45:31 +0000 |
|---|---|---|
| committer | jsing <> | 2023-03-08 05:45:31 +0000 |
| commit | 948c28a26f1877b33103e7640006ebcd45dd4375 (patch) | |
| tree | 96a3d2dbc6ef11df6851b53d3d2e1c46dd7f2328 /src/lib/libcrypto/ec/ec_mult.c | |
| parent | 442f7bc80303382d3992bb55ef733a468c1662f2 (diff) | |
| download | openbsd-948c28a26f1877b33103e7640006ebcd45dd4375.tar.gz openbsd-948c28a26f1877b33103e7640006ebcd45dd4375.tar.bz2 openbsd-948c28a26f1877b33103e7640006ebcd45dd4375.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.c | 6 |
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); |
