[vbox-dev] [PATCH] Fix compilation with LibreSSL <2.7.0

Stefan Strogin stefan.strogin at gmail.com
Tue Feb 12 04:44:17 GMT 2019


On 12/02/2019 04:35, valdis.kletnieks at vt.edu wrote:
> Having said that, if the build is using OpenSSL, under what case would LibreSSL version
> be defined at all? And if both *were* included, wouldn't the build die of other issues?
> 
> Maybe it's enough to say
> 
> #if (openssl >= openssl_vers) || (LibreSSL >= Libre_version)  
> 
> ?
> 

No, unfortunately.
If OpenSSL is installed, then LIBRESSL_VERSION_NUMBER won't be defined, of course.
But in LibreSSL OPENSSL_VERSION_NUMBER is defined 0x20000000L and never changes.
So "OPENSSL_VERSION_NUMBER >= openssl_vers" will always be "true" on systems with LibreSSL.

Another way to say it is
#if (OPENSSL_VERSION_NUMBER >= 0x10100000L) && !(defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L)

--
Stefan



More information about the vbox-dev mailing list