From 5df1bc189e955cbf37f7a7b4cd006703e7ec7a74 Mon Sep 17 00:00:00 2001 From: kakwa Date: Fri, 21 Apr 2017 01:59:18 +0200 Subject: [PATCH] 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... --- inc/rfc3161.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/inc/rfc3161.h b/inc/rfc3161.h index bcb7810..0f88494 100644 --- a/inc/rfc3161.h +++ b/inc/rfc3161.h @@ -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"