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_local.h | |
| 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_local.h')
| -rw-r--r-- | src/lib/libcrypto/ec/ec_local.h | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/lib/libcrypto/ec/ec_local.h b/src/lib/libcrypto/ec/ec_local.h index d4cb777c83..d26ec47a24 100644 --- a/src/lib/libcrypto/ec/ec_local.h +++ b/src/lib/libcrypto/ec/ec_local.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ec_local.h,v 1.10 2023/03/08 04:50:27 jsing Exp $ */ | 1 | /* $OpenBSD: ec_local.h,v 1.11 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 | */ |
| @@ -91,7 +91,6 @@ struct ec_method_st { | |||
| 91 | 91 | ||
| 92 | int (*group_init)(EC_GROUP *); | 92 | int (*group_init)(EC_GROUP *); |
| 93 | void (*group_finish)(EC_GROUP *); | 93 | void (*group_finish)(EC_GROUP *); |
| 94 | void (*group_clear_finish)(EC_GROUP *); | ||
| 95 | int (*group_copy)(EC_GROUP *, const EC_GROUP *); | 94 | int (*group_copy)(EC_GROUP *, const EC_GROUP *); |
| 96 | 95 | ||
| 97 | int (*group_set_curve)(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, | 96 | int (*group_set_curve)(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, |
| @@ -105,7 +104,6 @@ struct ec_method_st { | |||
| 105 | 104 | ||
| 106 | int (*point_init)(EC_POINT *); | 105 | int (*point_init)(EC_POINT *); |
| 107 | void (*point_finish)(EC_POINT *); | 106 | void (*point_finish)(EC_POINT *); |
| 108 | void (*point_clear_finish)(EC_POINT *); | ||
| 109 | int (*point_copy)(EC_POINT *, const EC_POINT *); | 107 | int (*point_copy)(EC_POINT *, const EC_POINT *); |
| 110 | 108 | ||
| 111 | int (*point_set_to_infinity)(const EC_GROUP *, EC_POINT *); | 109 | int (*point_set_to_infinity)(const EC_GROUP *, EC_POINT *); |
| @@ -317,7 +315,6 @@ int ec_wNAF_have_precompute_mult(const EC_GROUP *group); | |||
| 317 | /* method functions in ecp_smpl.c */ | 315 | /* method functions in ecp_smpl.c */ |
| 318 | int ec_GFp_simple_group_init(EC_GROUP *); | 316 | int ec_GFp_simple_group_init(EC_GROUP *); |
| 319 | void ec_GFp_simple_group_finish(EC_GROUP *); | 317 | void ec_GFp_simple_group_finish(EC_GROUP *); |
| 320 | void ec_GFp_simple_group_clear_finish(EC_GROUP *); | ||
| 321 | int ec_GFp_simple_group_copy(EC_GROUP *, const EC_GROUP *); | 318 | int ec_GFp_simple_group_copy(EC_GROUP *, const EC_GROUP *); |
| 322 | int ec_GFp_simple_group_set_curve(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *); | 319 | int ec_GFp_simple_group_set_curve(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *); |
| 323 | int ec_GFp_simple_group_get_curve(const EC_GROUP *, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *); | 320 | int ec_GFp_simple_group_get_curve(const EC_GROUP *, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *); |
| @@ -325,7 +322,6 @@ int ec_GFp_simple_group_get_degree(const EC_GROUP *); | |||
| 325 | int ec_GFp_simple_group_check_discriminant(const EC_GROUP *, BN_CTX *); | 322 | int ec_GFp_simple_group_check_discriminant(const EC_GROUP *, BN_CTX *); |
| 326 | int ec_GFp_simple_point_init(EC_POINT *); | 323 | int ec_GFp_simple_point_init(EC_POINT *); |
| 327 | void ec_GFp_simple_point_finish(EC_POINT *); | 324 | void ec_GFp_simple_point_finish(EC_POINT *); |
| 328 | void ec_GFp_simple_point_clear_finish(EC_POINT *); | ||
| 329 | int ec_GFp_simple_point_copy(EC_POINT *, const EC_POINT *); | 325 | int ec_GFp_simple_point_copy(EC_POINT *, const EC_POINT *); |
| 330 | int ec_GFp_simple_point_set_to_infinity(const EC_GROUP *, EC_POINT *); | 326 | int ec_GFp_simple_point_set_to_infinity(const EC_GROUP *, EC_POINT *); |
| 331 | int ec_GFp_simple_set_Jprojective_coordinates(const EC_GROUP *, EC_POINT *, | 327 | int ec_GFp_simple_set_Jprojective_coordinates(const EC_GROUP *, EC_POINT *, |
