From deda38367d8ce90b2095bc1133c07067de640f76 Mon Sep 17 00:00:00 2001 From: tb Date: Fri, 11 Oct 2024 18:35:39 +0000 Subject: [PATCH] Fix a long-standing bug in ec_asn1_group2pkparameters() Only check for the OPENSSL_EC_NAMED_CURVE being set to treat the curve parameters as named curve parameters. ok jsing --- lib/libcrypto/ec/ec_asn1.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libcrypto/ec/ec_asn1.c b/lib/libcrypto/ec/ec_asn1.c index c27257bdbbd..3cc91fe4c1f 100644 --- a/lib/libcrypto/ec/ec_asn1.c +++ b/lib/libcrypto/ec/ec_asn1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_asn1.c,v 1.65 2024/10/11 18:34:20 tb Exp $ */ +/* $OpenBSD: ec_asn1.c,v 1.66 2024/10/11 18:35:39 tb Exp $ */ /* * Written by Nils Larsch for the OpenSSL project. */ @@ -803,7 +803,7 @@ ec_asn1_group2pkparameters(const EC_GROUP *group) goto err; } - if (EC_GROUP_get_asn1_flag(group) != 0) { + if ((EC_GROUP_get_asn1_flag(group) & OPENSSL_EC_NAMED_CURVE) != 0) { if ((nid = EC_GROUP_get_curve_name(group)) == NID_undef) goto err; if ((aobj = OBJ_nid2obj(nid)) == NULL) -- 2.20.1