]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: ssl: use standard names for X25519 and X448 groups
authorWilliam Lallemand <wlallemand@irq6.net>
Tue, 6 Oct 2026 11:51:45 +0000 (13:51 +0200)
committerWilliam Lallemand <wlallemand@irq6.net>
Tue, 6 Oct 2026 13:39:56 +0000 (15:39 +0200)
The curve table uses ecdh_x25519 and ecdh_x448, which are OpenSSL TLS1.3
draft11 name labels rather than the released group names registered at
IANA. As a result, SSL traces print those labels and curves2nid() cannot
resolve x25519 or x448 even when the corresponding NID is available.

Use x25519 and x448 as the primary names. Keep the old ecdh_* strings
as aliases at the end of the table so existing name-to-NID lookups
continue to work. The aliases must follow the standard names because
curveid2str() returns the first entry matching a group identifier.

curveid2str() is only used in the traces so there's no fonctionnal
changes.

This should be backported to 3.3 and 3.4, which contain the curve table
introduced by d799a1b3b (MINOR: ssl: Add curve id to curve name table
and mapping functions).

src/ssl_utils.c

index e48486906b9a967b8be3784f2be2aac9b91d5587..db623f220861b980e7ce5f07c3b7a0299f25642f 100644 (file)
@@ -1050,8 +1050,8 @@ static struct curve {
        V( 26,     NID_brainpoolP256r1,                      "brainpoolP256r1",       NULL       ),
        V( 27,     NID_brainpoolP384r1,                      "brainpoolP384r1",       NULL       ),
        V( 28,     NID_brainpoolP512r1,                      "brainpoolP512r1",       NULL       ),
-       V( 29,     NID_X25519,                               "ecdh_x25519",           NULL       ),
-       V( 30,     NID_X448,                                 "ecdh_x448",             NULL       ),
+       V( 29,     NID_X25519,                               "x25519",                NULL       ),
+       V( 30,     NID_X448,                                 "x448",                  NULL       ),
        V( 31,     NID_brainpoolP256r1tls13,                 "brainpoolP256r1tls13",  NULL       ),
        V( 32,     NID_brainpoolP384r1tls13,                 "brainpoolP384r1tls13",  NULL       ),
        V( 33,     NID_brainpoolP512r1tls13,                 "brainpoolP512r1tls13",  NULL       ),
@@ -1076,6 +1076,12 @@ static struct curve {
        V( 25498,  -1,                                       "SecP256r1Kyber768Draft00",        NULL ),
        V( 0xFF01, -1,                                       "arbitrary_explicit_prime_curves", NULL ),
        V( 0xFF02, -1,                                       "arbitrary_explicit_char2_curves", NULL ),
+       /* Keep the old OpenSSL trace labels as aliases for name-to-NID lookup.
+        * These must follow the standard names above, since curveid2str()
+        * returns the first entry matching the TLS group identifier.
+        */
+       V( 29,     NID_X25519,                               "ecdh_x25519",           NULL       ),
+       V( 30,     NID_X448,                                 "ecdh_x448",             NULL       ),
        { 0, 0, NULL, NULL, NULL }
 };