From 68c3d09c2c1b88eafcf8b82af24f77756fd1d77f Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Mon, 21 May 2018 17:55:11 +0100 Subject: Fix bug #76174 (openssl extension fails to build with LibreSSL 2.7) --- ext/openssl/php_openssl.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'ext/openssl/php_openssl.h') diff --git a/ext/openssl/php_openssl.h b/ext/openssl/php_openssl.h index f13225d049..a03581c983 100644 --- a/ext/openssl/php_openssl.h +++ b/ext/openssl/php_openssl.h @@ -29,6 +29,25 @@ extern zend_module_entry openssl_module_entry; #include "php_version.h" #define PHP_OPENSSL_VERSION PHP_VERSION +#include +#if defined(LIBRESSL_VERSION_NUMBER) +/* LibreSSL version check */ +#if LIBRESSL_VERSION_NUMBER < 0x20700000L +#define PHP_OPENSSL_API_VERSION 0x10001 +#else +#define PHP_OPENSSL_API_VERSION 0x10100 +#endif +#else +/* OpenSSL version check */ +#if OPENSSL_VERSION_NUMBER < 0x10002000L +#define PHP_OPENSSL_API_VERSION 0x10001 +#elif OPENSSL_VERSION_NUMBER < 0x10100000L +#define PHP_OPENSSL_API_VERSION 0x10002 +#else +#define PHP_OPENSSL_API_VERSION 0x10100 +#endif +#endif + #define OPENSSL_RAW_DATA 1 #define OPENSSL_ZERO_PADDING 2 #define OPENSSL_DONT_ZERO_PAD_KEY 4 -- cgit v1.2.1