summaryrefslogtreecommitdiff
path: root/ext/openssl/php_openssl.h
diff options
context:
space:
mode:
authorJakub Zelenka <bukka@php.net>2018-05-22 13:40:23 +0100
committerJakub Zelenka <bukka@php.net>2018-05-22 13:40:23 +0100
commita231860b026baf8a2dfd34852c0cc196e7c7ebfb (patch)
tree477aab9d5619d879a9563904afd501f7be3e186c /ext/openssl/php_openssl.h
parent1c8c06a403c0216cdbcf6a90b5ae8ba87639ff6c (diff)
parent68c3d09c2c1b88eafcf8b82af24f77756fd1d77f (diff)
downloadphp-git-a231860b026baf8a2dfd34852c0cc196e7c7ebfb.tar.gz
Merge branch 'PHP-7.1' into PHP-7.2
Diffstat (limited to 'ext/openssl/php_openssl.h')
-rw-r--r--ext/openssl/php_openssl.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/ext/openssl/php_openssl.h b/ext/openssl/php_openssl.h
index b69c9d195a..e357550c1a 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 <openssl/opensslv.h>
+#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