]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
openssl: enable CURLOPT_SSL_EC_CURVES with BoringSSL
authorlwthiker <lwt@lwthiker.com>
Mon, 28 Feb 2022 09:05:34 +0000 (11:05 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 8 Mar 2022 08:11:19 +0000 (09:11 +0100)
The CURLOPT_SSL_EC_CURVES option (used by the '--curves' flag) in
libcurl was ignored when compiling with BoringSSL because
HAVE_SSL_CTX_SET_EC_CURVES was explicitly disabled if BoringSSL was
detected.  However, this feature is supported in BoringSSL since
5fd1807d. This commit enables it, and also reduces the required minimal
OpenSSL version to 1.0.2 as per OpenSSL's official documentation.

Fixes #8553
Closes #8556

lib/vtls/openssl.c

index 616a510b0a9c03bcd9678fe8742698c2eaf5cba8..0b79fc50a9c5c0ddd57380b81080c05e564ba361 100644 (file)
      !defined(OPENSSL_IS_BORINGSSL))
 #define HAVE_SSL_CTX_SET_CIPHERSUITES
 #define HAVE_SSL_CTX_SET_POST_HANDSHAKE_AUTH
-/* SET_EC_CURVES is available under the same preconditions: see
- * https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_groups.html
+#endif
+
+/*
+ * Whether SSL_CTX_set1_curves_list is available.
+ * OpenSSL: supported since 1.0.2, see
+ *   https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set1_groups.html
+ * BoringSSL: supported since 5fd1807d95f7 (committed 2016-09-30)
+ * LibreSSL: not tested.
  */
+#if ((OPENSSL_VERSION_NUMBER >= 0x10002000L) && \
+     !defined(LIBRESSL_VERSION_NUMBER)) || \
+    defined(OPENSSL_IS_BORINGSSL)
 #define HAVE_SSL_CTX_SET_EC_CURVES
 #endif