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/ecp_mont.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/ecp_mont.c')
| -rw-r--r-- | src/lib/libcrypto/ec/ecp_mont.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/lib/libcrypto/ec/ecp_mont.c b/src/lib/libcrypto/ec/ecp_mont.c index d0d497b011..8b85bf32fa 100644 --- a/src/lib/libcrypto/ec/ecp_mont.c +++ b/src/lib/libcrypto/ec/ecp_mont.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ecp_mont.c,v 1.26 2023/03/08 04:50:27 jsing Exp $ */ | 1 | /* $OpenBSD: ecp_mont.c,v 1.27 2023/03/08 05:45:31 jsing Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Originally written by Bodo Moeller for the OpenSSL project. | 3 | * Originally written by Bodo Moeller for the OpenSSL project. |
| 4 | */ | 4 | */ |
| @@ -93,13 +93,6 @@ ec_GFp_mont_group_finish(EC_GROUP *group) | |||
| 93 | ec_GFp_simple_group_finish(group); | 93 | ec_GFp_simple_group_finish(group); |
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | static void | ||
| 97 | ec_GFp_mont_group_clear_finish(EC_GROUP *group) | ||
| 98 | { | ||
| 99 | ec_GFp_mont_group_clear(group); | ||
| 100 | ec_GFp_simple_group_clear_finish(group); | ||
| 101 | } | ||
| 102 | |||
| 103 | static int | 96 | static int |
| 104 | ec_GFp_mont_group_copy(EC_GROUP *dest, const EC_GROUP *src) | 97 | ec_GFp_mont_group_copy(EC_GROUP *dest, const EC_GROUP *src) |
| 105 | { | 98 | { |
| @@ -236,7 +229,6 @@ static const EC_METHOD ec_GFp_mont_method = { | |||
| 236 | .field_type = NID_X9_62_prime_field, | 229 | .field_type = NID_X9_62_prime_field, |
| 237 | .group_init = ec_GFp_mont_group_init, | 230 | .group_init = ec_GFp_mont_group_init, |
| 238 | .group_finish = ec_GFp_mont_group_finish, | 231 | .group_finish = ec_GFp_mont_group_finish, |
| 239 | .group_clear_finish = ec_GFp_mont_group_clear_finish, | ||
| 240 | .group_copy = ec_GFp_mont_group_copy, | 232 | .group_copy = ec_GFp_mont_group_copy, |
| 241 | .group_set_curve = ec_GFp_mont_group_set_curve, | 233 | .group_set_curve = ec_GFp_mont_group_set_curve, |
| 242 | .group_get_curve = ec_GFp_simple_group_get_curve, | 234 | .group_get_curve = ec_GFp_simple_group_get_curve, |
| @@ -245,7 +237,6 @@ static const EC_METHOD ec_GFp_mont_method = { | |||
| 245 | .group_check_discriminant = ec_GFp_simple_group_check_discriminant, | 237 | .group_check_discriminant = ec_GFp_simple_group_check_discriminant, |
| 246 | .point_init = ec_GFp_simple_point_init, | 238 | .point_init = ec_GFp_simple_point_init, |
| 247 | .point_finish = ec_GFp_simple_point_finish, | 239 | .point_finish = ec_GFp_simple_point_finish, |
| 248 | .point_clear_finish = ec_GFp_simple_point_clear_finish, | ||
| 249 | .point_copy = ec_GFp_simple_point_copy, | 240 | .point_copy = ec_GFp_simple_point_copy, |
| 250 | .point_set_to_infinity = ec_GFp_simple_point_set_to_infinity, | 241 | .point_set_to_infinity = ec_GFp_simple_point_set_to_infinity, |
| 251 | .point_set_Jprojective_coordinates = | 242 | .point_set_Jprojective_coordinates = |
