From 4eebdb152bfa84506bc923af0b978dc012008103 Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Tue, 6 Oct 2026 14:22:22 +0200 Subject: [PATCH] MINOR: ssl: skip unavailable NIDs in curves2nid lookup Curve table entries with NIDs undefined by the SSL library remain at -1 after initialization. Skip these entries during name lookup so an unavailable mapping does not hide a later valid mapping for the same name. This allows the table to contain both OpenSSL and AWS-LC NID spellings without conditional compilation. --- src/ssl_utils.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ssl_utils.c b/src/ssl_utils.c index 58c3e82fb..a5d5fde46 100644 --- a/src/ssl_utils.c +++ b/src/ssl_utils.c @@ -1124,9 +1124,10 @@ int curves2nid(const char *curve) struct curve *curves = curves_list; while (curves->curve_id) { - if ((curves->ansi && strcmp(curve, curves->ansi) == 0) || - (curves->iana && strcmp(curve, curves->iana) == 0) || - (curves->nist && strcmp(curve, curves->nist) == 0)) + if (curves->nid != -1 && + ((curves->ansi && strcmp(curve, curves->ansi) == 0) || + (curves->iana && strcmp(curve, curves->iana) == 0) || + (curves->nist && strcmp(curve, curves->nist) == 0))) return curves->nid; curves++; } -- 2.47.3