From: Matt Caswell Date: Wed, 30 Aug 2023 14:48:02 +0000 (+0100) Subject: Remove a redundant point mul from ossl_ec_key_public_check() X-Git-Tag: openssl-3.2.0-alpha1~101 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3961991593f788b3efb2a27563d358c7c58f854c;p=thirdparty%2Fopenssl.git Remove a redundant point mul from ossl_ec_key_public_check() This code was added in error and is entirely redundant. It is also an expensive operation (e.g. see #21833). Fixes #21834 Reviewed-by: Tomas Mraz Reviewed-by: Paul Dale Reviewed-by: Shane Lontis Reviewed-by: Hugo Landau (Merged from https://github.com/openssl/openssl/pull/21902) --- diff --git a/crypto/ec/ec_key.c b/crypto/ec/ec_key.c index e428b45d4a1..2bf3e601f17 100644 --- a/crypto/ec/ec_key.c +++ b/crypto/ec/ec_key.c @@ -581,11 +581,6 @@ int ossl_ec_key_public_check(const EC_KEY *eckey, BN_CTX *ctx) ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB); goto err; } - /* Perform a second check on the public key */ - if (!EC_POINT_mul(eckey->group, point, NULL, eckey->pub_key, order, ctx)) { - ERR_raise(ERR_LIB_EC, ERR_R_EC_LIB); - goto err; - } if (!EC_POINT_is_at_infinity(eckey->group, point)) { ERR_raise(ERR_LIB_EC, EC_R_WRONG_ORDER); goto err;