cURL / Mailing Lists / curl-library / Single Mail

curl-library

Correct package in vtls/openssl.c

From: Gisle Vanem <gvanem_at_yahoo.no>
Date: Tue, 8 Mar 2016 12:54:52 +0100

As mentioned previously, I've managed to build libcurl with
BoringSSL okay (using MSVC-2015 + TDM-gcc). It seems the folks at
Google has done a very good job with this OpenSSL fork.

But I have some beefs with this combo.
'curl -V' says:
  curl 7.47.2-DEV (i386-pc-win32) libcurl/7.47.2-DEV BoringSSL (no version info)

And if I do 'curl --sslv2 ..', it says:
  curl: (4) OpenSSL was built without SSLv2 support

IMHO, it should state 'OpenSSL', 'BoringSSL' or 'LibreSSL' here.

I'm not sure adapting 'Curl_ossl_version()' for BoringSSL is
so easy. But the 2nd issue could be patched like:

--- a/openssl.c 2016-02-17 12:17:13
+++ b/openssl.c 2016-03-08 12:41:24
@@ -121,6 +121,14 @@
 #define OPENSSL_load_builtin_modules(x)
 #endif

+#if defined(LIBRESSL_VERSION_NUMBER)
+ #define OSSL_PACKAGE "LibreSSL"
+#elif defined(OPENSSL_IS_BORINGSSL)
+ #define OSSL_PACKAGE "BoringSSL"
+#else
+ #define OSSL_PACKAGE "OpenSSL"
+#endif
+

@@ -1643,7 +1655,7 @@
     break;
   case CURL_SSLVERSION_SSLv2:
 #ifdef OPENSSL_NO_SSL2
- failf(data, "OpenSSL was built without SSLv2 support");
+ failf(data, OSSL_PACKAGE " was built without SSLv2 support");
     return CURLE_NOT_BUILT_IN;

-- 
--gv
-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:  https://curl.haxx.se/mail/etiquette.html
Received on 2016-03-08