From 183ebcd147bfd493e4856f28b1ff4c9c6dbd0730 Mon Sep 17 00:00:00 2001 From: tb <> Date: Wed, 1 Jan 2025 09:57:02 +0000 Subject: Garbage collect .group_init() For both in-tree methods these are just complicated ways of zeroing part of the group object. The group is allocated with calloc(), so it's all entirely pointless. ok jsing --- src/lib/libcrypto/ec/ec_lib.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'src/lib/libcrypto/ec/ec_lib.c') diff --git a/src/lib/libcrypto/ec/ec_lib.c b/src/lib/libcrypto/ec/ec_lib.c index 6644c4dfc7..aeb627dfba 100644 --- a/src/lib/libcrypto/ec/ec_lib.c +++ b/src/lib/libcrypto/ec/ec_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_lib.c,v 1.91 2024/12/12 10:02:00 tb Exp $ */ +/* $OpenBSD: ec_lib.c,v 1.92 2025/01/01 09:57:02 tb Exp $ */ /* * Originally written by Bodo Moeller for the OpenSSL project. */ @@ -84,10 +84,6 @@ EC_GROUP_new(const EC_METHOD *meth) ECerror(EC_R_SLOT_FULL); goto err; } - if (meth->group_init == NULL) { - ECerror(ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); - goto err; - } if ((group = calloc(1, sizeof(*group))) == NULL) { ECerror(ERR_R_MALLOC_FAILURE); goto err; @@ -95,15 +91,9 @@ EC_GROUP_new(const EC_METHOD *meth) group->meth = meth; - BN_init(&group->order); - BN_init(&group->cofactor); - group->asn1_flag = OPENSSL_EC_NAMED_CURVE; group->asn1_form = POINT_CONVERSION_UNCOMPRESSED; - if (!meth->group_init(group)) - goto err; - return group; err: -- cgit v1.2.3-55-g6feb