]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
openssl: switch to modern init for LibreSSL 2.7.0+
authorViktor Szakats <commit@vsz.me>
Mon, 7 Aug 2023 16:32:46 +0000 (16:32 +0000)
committerViktor Szakats <commit@vsz.me>
Mon, 7 Aug 2023 23:55:58 +0000 (23:55 +0000)
LibreSSL 2.7.0 (2018-03-21) introduced automatic initialization,
`OPENSSL_init_ssl()` function and deprecated the old, manual init
method, as seen in OpenSSL 1.1.0. Switch to the modern method when
available.

Ref: https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-2.7.0-relnotes.txt

Reviewed-by: Daniel Stenberg
Closes #11611

lib/vtls/openssl.c

index 36d841f35edf929480ef3c74781a1a24f9f84859..2a7369fa54528ad7b68f619a2aefdb14924e9f95 100644 (file)
@@ -1691,7 +1691,7 @@ static int x509_name_oneline(X509_NAME *a, char *buf, size_t size)
 static int ossl_init(void)
 {
 #if (OPENSSL_VERSION_NUMBER >= 0x10100000L) &&  \
-  !defined(LIBRESSL_VERSION_NUMBER)
+  (!defined(LIBRESSL_VERSION_NUMBER) || LIBRESSL_VERSION_NUMBER >= 0x2070000fL)
   const uint64_t flags =
 #ifdef OPENSSL_INIT_ENGINE_ALL_BUILTIN
     /* not present in BoringSSL */