From e66ace5866e5cf640f90e9158ea3245cf5c846e4 Mon Sep 17 00:00:00 2001 From: tb <> Date: Wed, 1 Jan 2025 10:01:31 +0000 Subject: Garbage collect .group_finish() There is only one caller, EC_GROUP_free(), so inline the relevant free calls there and dispose of a few layers of indirection. ok jsing --- src/lib/libcrypto/ec/ecp_methods.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'src/lib/libcrypto/ec/ecp_methods.c') diff --git a/src/lib/libcrypto/ec/ecp_methods.c b/src/lib/libcrypto/ec/ecp_methods.c index 333922d351..af19addab4 100644 --- a/src/lib/libcrypto/ec/ecp_methods.c +++ b/src/lib/libcrypto/ec/ecp_methods.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ecp_methods.c,v 1.16 2025/01/01 09:57:02 tb Exp $ */ +/* $OpenBSD: ecp_methods.c,v 1.17 2025/01/01 10:01:31 tb Exp $ */ /* Includes code written by Lenka Fibikova * for the OpenSSL project. * Includes code written by Bodo Moeller for the OpenSSL project. @@ -84,14 +84,6 @@ * representation (i.e. 'encoding' means multiplying by some factor R). */ -static void -ec_group_finish(EC_GROUP *group) -{ - BN_free(&group->p); - BN_free(&group->a); - BN_free(&group->b); -} - static int ec_group_copy(EC_GROUP *dest, const EC_GROUP *src) { @@ -1526,13 +1518,6 @@ ec_mont_group_clear(EC_GROUP *group) group->mont_one = NULL; } -static void -ec_mont_group_finish(EC_GROUP *group) -{ - ec_mont_group_clear(group); - ec_group_finish(group); -} - static int ec_mont_group_copy(EC_GROUP *dest, const EC_GROUP *src) { @@ -1661,7 +1646,6 @@ ec_mont_field_set_to_one(const EC_GROUP *group, BIGNUM *r, BN_CTX *ctx) static const EC_METHOD ec_GFp_simple_method = { .field_type = NID_X9_62_prime_field, - .group_finish = ec_group_finish, .group_copy = ec_group_copy, .group_set_curve = ec_group_set_curve, .group_get_curve = ec_group_get_curve, @@ -1697,7 +1681,6 @@ LCRYPTO_ALIAS(EC_GFp_simple_method); static const EC_METHOD ec_GFp_mont_method = { .field_type = NID_X9_62_prime_field, - .group_finish = ec_mont_group_finish, .group_copy = ec_mont_group_copy, .group_set_curve = ec_mont_group_set_curve, .group_get_curve = ec_group_get_curve, -- cgit v1.2.3-55-g6feb