Fix the check of EC_GROUP_check_named_curve
authorPeiwei Hu <jlu.hpw@foxmail.com>
Tue, 15 Nov 2022 04:22:24 +0000 (12:22 +0800)
committerTomas Mraz <tomas@openssl.org>
Wed, 16 Nov 2022 15:43:25 +0000 (16:43 +0100)
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19678)

providers/implementations/keymgmt/ec_kmgmt.c

index ec5c954856208b5527f6bc20669e473737ee7b65..fe2465a64b0f3f371ae56f40f05aeb282d64f2e6 100644 (file)
@@ -946,7 +946,7 @@ int ec_validate(const void *keydata, int selection, int checktype)
 
         if ((flags & EC_FLAG_CHECK_NAMED_GROUP) != 0)
             ok = ok && EC_GROUP_check_named_curve(EC_KEY_get0_group(eck),
-                           (flags & EC_FLAG_CHECK_NAMED_GROUP_NIST) != 0, ctx);
+                           (flags & EC_FLAG_CHECK_NAMED_GROUP_NIST) != 0, ctx) > 0;
         else
             ok = ok && EC_GROUP_check(EC_KEY_get0_group(eck), ctx);
     }