add special matching for LibreSSL

Thank you LibreSSL for setting OPENSSL_VERSION_NUMBER to 0x20000000L...
It breaks traditional OpenSSL API matching by OPENSSL_VERSION_NUMBER...
This commit is contained in:
kakwa 2017-04-21 01:59:18 +02:00
parent dca9231b9f
commit 65357fe736
1 changed files with 15 additions and 0 deletions

View File

@ -16,6 +16,20 @@
#if OPENSSL_VERSION_NUMBER < 0x10000000L
#error OpenSSL version too old
#endif
/* LibreSSL is really annoying
* the OPENSSL_VERSION_NUMBER #define in opensslv.h
* is 0x20000000L but the API is that of openssl 1.0.
* That breaks version matching to determine which API
* to use.
* So, special case here for LibreSSL...
* (why didn't you just keep 0x100000L LibreSSL?)
*/
#ifdef LIBRESSL_VERSION_NUMBER
// for now, LibreSSL is 1.0 API only
#define OPENSSL_API_1_0
#else
// for OpenSSL, we must differenciate between 1.0 and 1.1
#if OPENSSL_VERSION_NUMBER < 0x10100000L && \
OPENSSL_VERSION_NUMBER >= 0x10000000L
#define OPENSSL_API_1_0
@ -23,6 +37,7 @@
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
#define OPENSSL_API_1_1
#endif
#endif
/* Name of config entry that defines the OID file. */
#define OID_SECTION "oids"