--- /dev/null
+ o Minor features (security, TLS):
+ - When we are running with OpenSSL 3.5.0 or later,
+ support using the ML-KEM768 for post-quantum key agreement.
+ Closes ticket 41041.
+
+ o Minor features (performance TLS):
+ - When running with with OpenSSL 3.0.0 or later,
+ support using X25519 for TLS key agreement.
+ (This should slightly improve performance
+ for TLS session establishment.)
* or a macro. */
#if defined(SSL_CTX_set1_groups_list) || defined(HAVE_SSL_CTX_SET1_GROUPS_LIST)
{
- const char *list;
- list = "P-256:P-224";
- int r = (int) SSL_CTX_set1_groups_list(result->ctx, list);
- if (r == 0)
- goto error;
+ // We'd like to say something like:
+ // "?X25519MLKEM768:P-256:P-224"
+ // to mean that we prefer X25519MLKEM768 if it is present;
+ // but we do insist on the presence of P-256 and P-224.
+ //
+ // Unfortunately, we support back to OpenSSL 3.0, which did not provide
+ // any syntax for saying "don't worry if this group isn't supported."
+ // Instead, we have to make this preference list of preference lists.
+ static const char *group_lists[] = {
+ // We do use the ? syntax here, since every version of OpenSSL
+ // that supports ML-KEM also supports the ? syntax.
+ // We also use the * and / syntaxes:
+ // '*' indicates that the client should send these keyshares.
+ // "/" means that we should consider a set of of groups
+ // as equivalently secure.
+ //
+ // Note that we tell the client to send a P-256 keyshare, since until
+ // this commit, our servers didn't accept X25519.
+ "?*X25519MLKEM768 / ?SecP256r1MLKEM768:?X25519 / *P-256:P-224",
+ "P-256:X25519:P-224",
+ "P-256:P-224",
+ };
+ bool success = false;
+ for (unsigned j = 0; j < ARRAY_LENGTH(group_lists); ++j) {
+ const char *list = group_lists[j];
+ int r = (int) SSL_CTX_set1_groups_list(result->ctx, list);
+ if (r == 1) {
+ log_info(LD_NET, "Set supported groups to %s", list);
+ success = true;
+ break;
+ }
+ log_info(LD_NET, "Group list %s wasn't accepted", list);
+ }
+ if (! success) {
+ log_warn(LD_NET, "No lists of TLS groups were supported. "
+ "Using library defaults");
+ }
}
#else /* !(defined(SSL_CTX_set1_groups_list) || defined(HAVE_SSL_CTX_SE...)) */
if (! is_client) {