From: William Lallemand Date: Tue, 6 Oct 2026 12:22:22 +0000 (+0200) Subject: MINOR: ssl: skip unavailable NIDs in curves2nid lookup X-Git-Tag: v3.5-dev9~187 X-Git-Url: https://git.kaiwu.me/$%7BGITURL%7D$%7Bcid%7D?a=commitdiff_plain;h=4eebdb152bfa84506bc923af0b978dc012008103;p=haproxy.git 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. --- 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++; }