Remove a redundant point mul from ossl_ec_key_public_check()
authorMatt Caswell <matt@openssl.org>
Wed, 30 Aug 2023 14:48:02 +0000 (15:48 +0100)
committerHugo Landau <hlandau@openssl.org>
Fri, 1 Sep 2023 09:08:20 +0000 (10:08 +0100)
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 <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21902)

crypto/ec/ec_key.c

index e428b45d4a1d437f2b154aaf44c9fe4d4c2319c5..2bf3e601f17f2fdb2effa0e0a692f1ec98b34025 100644 (file)
@@ -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;