Remove group_clear_finish EC_GROUP hooks. These are never called. Group parameters are not secret anyway. This is a remnant of upstream's EC_GROUP_clear_free. Change-Id: I23a4076eae8e4561abddbe74d0ba72641532f229 Reviewed-on: https://boringssl-review.googlesource.com/6823 Reviewed-by: Adam Langley <alangley@gmail.com>
diff --git a/crypto/ec/ec_montgomery.c b/crypto/ec/ec_montgomery.c index 1d4113d..62b0d7f 100644 --- a/crypto/ec/ec_montgomery.c +++ b/crypto/ec/ec_montgomery.c
@@ -91,14 +91,6 @@ ec_GFp_simple_group_finish(group); } -void ec_GFp_mont_group_clear_finish(EC_GROUP *group) { - BN_MONT_CTX_free(group->mont); - group->mont = NULL; - BN_clear_free(group->one); - group->one = NULL; - ec_GFp_simple_group_clear_finish(group); -} - int ec_GFp_mont_group_copy(EC_GROUP *dest, const EC_GROUP *src) { BN_MONT_CTX_free(dest->mont); dest->mont = NULL; @@ -263,7 +255,6 @@ static const EC_METHOD ret = { ec_GFp_mont_group_init, ec_GFp_mont_group_finish, - ec_GFp_mont_group_clear_finish, ec_GFp_mont_group_copy, ec_GFp_mont_group_set_curve, ec_GFp_simple_point_get_affine_coordinates,
diff --git a/crypto/ec/internal.h b/crypto/ec/internal.h index bcc0e37..d1132f5 100644 --- a/crypto/ec/internal.h +++ b/crypto/ec/internal.h
@@ -80,10 +80,9 @@ struct ec_method_st { - /* used by EC_GROUP_new, EC_GROUP_free, EC_GROUP_clear_free, EC_GROUP_copy: */ + /* used by EC_GROUP_new, EC_GROUP_free, EC_GROUP_copy: */ int (*group_init)(EC_GROUP *); void (*group_finish)(EC_GROUP *); - void (*group_clear_finish)(EC_GROUP *); int (*group_copy)(EC_GROUP *, const EC_GROUP *); /* used by EC_GROUP_set_curve_GFp, EC_GROUP_get_curve_GFp, */ @@ -180,7 +179,6 @@ /* method functions in simple.c */ int ec_GFp_simple_group_init(EC_GROUP *); void ec_GFp_simple_group_finish(EC_GROUP *); -void ec_GFp_simple_group_clear_finish(EC_GROUP *); int ec_GFp_simple_group_copy(EC_GROUP *, const EC_GROUP *); int ec_GFp_simple_group_set_curve(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *); @@ -232,7 +230,6 @@ int ec_GFp_mont_group_set_curve(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *); void ec_GFp_mont_group_finish(EC_GROUP *); -void ec_GFp_mont_group_clear_finish(EC_GROUP *); int ec_GFp_mont_group_copy(EC_GROUP *, const EC_GROUP *); int ec_GFp_mont_field_mul(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *);
diff --git a/crypto/ec/p224-64.c b/crypto/ec/p224-64.c index 8e93850..790b1e7 100644 --- a/crypto/ec/p224-64.c +++ b/crypto/ec/p224-64.c
@@ -1288,7 +1288,6 @@ const EC_METHOD *EC_GFp_nistp224_method(void) { static const EC_METHOD ret = {ec_GFp_nistp224_group_init, ec_GFp_simple_group_finish, - ec_GFp_simple_group_clear_finish, ec_GFp_simple_group_copy, ec_GFp_nistp224_group_set_curve, ec_GFp_nistp224_point_get_affine_coordinates,
diff --git a/crypto/ec/p256-64.c b/crypto/ec/p256-64.c index 29e9a20..a5b64f3 100644 --- a/crypto/ec/p256-64.c +++ b/crypto/ec/p256-64.c
@@ -1862,7 +1862,6 @@ static const EC_METHOD ret = { ec_GFp_nistp256_group_init, ec_GFp_simple_group_finish, - ec_GFp_simple_group_clear_finish, ec_GFp_simple_group_copy, ec_GFp_nistp256_group_set_curve, ec_GFp_nistp256_point_get_affine_coordinates, ec_GFp_nistp256_points_mul,
diff --git a/crypto/ec/p256-x86_64.c b/crypto/ec/p256-x86_64.c index 2972483..ca967b3 100644 --- a/crypto/ec/p256-x86_64.c +++ b/crypto/ec/p256-x86_64.c
@@ -567,7 +567,6 @@ static const EC_METHOD ret = { ec_GFp_mont_group_init, ec_GFp_mont_group_finish, - ec_GFp_mont_group_clear_finish, ec_GFp_mont_group_copy, ec_GFp_mont_group_set_curve, ecp_nistz256_get_affine,
diff --git a/crypto/ec/simple.c b/crypto/ec/simple.c index cef0e94..354b1c7 100644 --- a/crypto/ec/simple.c +++ b/crypto/ec/simple.c
@@ -102,12 +102,6 @@ BN_free(&group->b); } -void ec_GFp_simple_group_clear_finish(EC_GROUP *group) { - BN_clear_free(&group->field); - BN_clear_free(&group->a); - BN_clear_free(&group->b); -} - int ec_GFp_simple_group_copy(EC_GROUP *dest, const EC_GROUP *src) { if (!BN_copy(&dest->field, &src->field) || !BN_copy(&dest->a, &src->a) ||