From a02a81fb1c39f8148e1e7dab24c574f9f5497f09 Mon Sep 17 00:00:00 2001 From: tb Date: Mon, 1 May 2023 08:16:17 +0000 Subject: [PATCH] Drop some dead code No member of the curve_list[] table has a method set. Thus, curve.meth is always NULL and we never take the EC_GROUP_new(meth) code path. ok jsing --- lib/libcrypto/ec/ec_curve.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/lib/libcrypto/ec/ec_curve.c b/lib/libcrypto/ec/ec_curve.c index a55b90a11bc..61d6c01048c 100644 --- a/lib/libcrypto/ec/ec_curve.c +++ b/lib/libcrypto/ec/ec_curve.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_curve.c,v 1.30 2023/05/01 07:58:34 tb Exp $ */ +/* $OpenBSD: ec_curve.c,v 1.31 2023/05/01 08:16:17 tb Exp $ */ /* * Written by Nils Larsch for the OpenSSL project. */ @@ -1819,7 +1819,6 @@ static const struct { typedef struct _ec_list_element_st { int nid; const EC_CURVE_DATA *data; - const EC_METHOD *(*meth) (void); const char *comment; } ec_list_element; @@ -2117,7 +2116,6 @@ ec_group_new_from_data(const ec_list_element curve) BIGNUM *p = NULL, *a = NULL, *b = NULL, *x = NULL, *y = NULL, *order = NULL; int ok = 0; int seed_len, param_len; - const EC_METHOD *meth; const EC_CURVE_DATA *data; const unsigned char *params; @@ -2137,14 +2135,7 @@ ec_group_new_from_data(const ec_list_element curve) ECerror(ERR_R_BN_LIB); goto err; } - if (curve.meth != 0) { - meth = curve.meth(); - if (((group = EC_GROUP_new(meth)) == NULL) || - (!(group->meth->group_set_curve(group, p, a, b, ctx)))) { - ECerror(ERR_R_EC_LIB); - goto err; - } - } else if (data->field_type == NID_X9_62_prime_field) { + if (data->field_type == NID_X9_62_prime_field) { if ((group = EC_GROUP_new_curve_GFp(p, a, b, ctx)) == NULL) { ECerror(ERR_R_EC_LIB); goto err; -- 2.20.1