summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2023-05-01 08:16:17 +0000
committertb <>2023-05-01 08:16:17 +0000
commit844279c13cc0f8333ee7efb8ce265ce0b19a4412 (patch)
treefe2db9412967591ca2dc064b62378f2451c50ca7
parent046fa12348b58b59e5a886594f95e80c4398f4cd (diff)
downloadopenbsd-844279c13cc0f8333ee7efb8ce265ce0b19a4412.tar.gz
openbsd-844279c13cc0f8333ee7efb8ce265ce0b19a4412.tar.bz2
openbsd-844279c13cc0f8333ee7efb8ce265ce0b19a4412.zip
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
-rw-r--r--src/lib/libcrypto/ec/ec_curve.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/lib/libcrypto/ec/ec_curve.c b/src/lib/libcrypto/ec/ec_curve.c
index a55b90a11b..61d6c01048 100644
--- a/src/lib/libcrypto/ec/ec_curve.c
+++ b/src/lib/libcrypto/ec/ec_curve.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_curve.c,v 1.30 2023/05/01 07:58:34 tb Exp $ */ 1/* $OpenBSD: ec_curve.c,v 1.31 2023/05/01 08:16:17 tb Exp $ */
2/* 2/*
3 * Written by Nils Larsch for the OpenSSL project. 3 * Written by Nils Larsch for the OpenSSL project.
4 */ 4 */
@@ -1819,7 +1819,6 @@ static const struct {
1819typedef struct _ec_list_element_st { 1819typedef struct _ec_list_element_st {
1820 int nid; 1820 int nid;
1821 const EC_CURVE_DATA *data; 1821 const EC_CURVE_DATA *data;
1822 const EC_METHOD *(*meth) (void);
1823 const char *comment; 1822 const char *comment;
1824} ec_list_element; 1823} ec_list_element;
1825 1824
@@ -2117,7 +2116,6 @@ ec_group_new_from_data(const ec_list_element curve)
2117 BIGNUM *p = NULL, *a = NULL, *b = NULL, *x = NULL, *y = NULL, *order = NULL; 2116 BIGNUM *p = NULL, *a = NULL, *b = NULL, *x = NULL, *y = NULL, *order = NULL;
2118 int ok = 0; 2117 int ok = 0;
2119 int seed_len, param_len; 2118 int seed_len, param_len;
2120 const EC_METHOD *meth;
2121 const EC_CURVE_DATA *data; 2119 const EC_CURVE_DATA *data;
2122 const unsigned char *params; 2120 const unsigned char *params;
2123 2121
@@ -2137,14 +2135,7 @@ ec_group_new_from_data(const ec_list_element curve)
2137 ECerror(ERR_R_BN_LIB); 2135 ECerror(ERR_R_BN_LIB);
2138 goto err; 2136 goto err;
2139 } 2137 }
2140 if (curve.meth != 0) { 2138 if (data->field_type == NID_X9_62_prime_field) {
2141 meth = curve.meth();
2142 if (((group = EC_GROUP_new(meth)) == NULL) ||
2143 (!(group->meth->group_set_curve(group, p, a, b, ctx)))) {
2144 ECerror(ERR_R_EC_LIB);
2145 goto err;
2146 }
2147 } else if (data->field_type == NID_X9_62_prime_field) {
2148 if ((group = EC_GROUP_new_curve_GFp(p, a, b, ctx)) == NULL) { 2139 if ((group = EC_GROUP_new_curve_GFp(p, a, b, ctx)) == NULL) {
2149 ECerror(ERR_R_EC_LIB); 2140 ECerror(ERR_R_EC_LIB);
2150 goto err; 2141 goto err;