Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ext/openssl/openssl.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,13 @@
* @cvalue PKCS7_NOCRL
*/
const PKCS7_NOCRL = UNKNOWN;
#ifndef OPENSSL_NO_RMD160
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking for presence of RMD-160 is a bit strange in this context. Did you mean #ifndef PKCS7_NO_DUAL_CONTENT?

/**
* @var int
* @cvalue PKCS7_NO_DUAL_CONTENT
*/
const PKCS7_NO_DUAL_CONTENT = UNKNOWN;

#endif
/**
* @var int
* @cvalue CMS_DETACHED
Expand Down
4 changes: 3 additions & 1 deletion ext/openssl/openssl_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions ext/openssl/openssl_backend_v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ void php_openssl_backend_shutdown(void)
/* prevent accessing locking callback from unloaded extension */
CRYPTO_set_locking_callback(NULL);

#ifdef HAVE_ENGINE_CLEANUP
/* Free engine list initialized by OPENSSL_config */
ENGINE_cleanup();
#endif

/* free allocated error strings */
ERR_free_strings();
Expand Down
15 changes: 15 additions & 0 deletions ext/standard/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,21 @@ AS_VAR_IF([php_cv_func_getifaddrs], [yes],
[AC_DEFINE([HAVE_GETIFADDRS], [1],
[Define to 1 if you have the 'getifaddrs' function.])])

dnl Check whether ENGINE_cleanup() exists in the OpenSSL/LibreSSL we build against
AC_CHECK_HEADERS([openssl/engine.h])

AC_CHECK_FUNCS([ENGINE_cleanup], [], [
AC_MSG_CHECKING([for ENGINE_cleanup in libcrypto])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <openssl/engine.h>]],
[[ENGINE_cleanup();]]
)],
[AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_ENGINE_CLEANUP], [1], [Define if ENGINE_cleanup is available])],
[AC_MSG_RESULT([no])]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will end up defining HAVE_ENGINE_CLEANUP for LibreSSL since it's still available. It's almost certainly the combination with OPENSSL_NO_ENGINE that's problematic: #20920 (comment)

)
])

dnl
dnl Setup extension sources
dnl
Expand Down
7 changes: 7 additions & 0 deletions ext/standard/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ ARG_WITH("config-file-scan-dir", "Dir to check for additional php ini files", ""
AC_DEFINE("PHP_CONFIG_FILE_SCAN_DIR", PHP_CONFIG_FILE_SCAN_DIR);
AC_DEFINE("PHP_USE_PHP_CRYPT_R", 1, "Define to 1 if PHP uses its own crypt_r, and to 0 if using the external crypt library.");

/* Check whether ENGINE_cleanup() exists in the OpenSSL */
if (CHECK_HEADER_ADD_INCLUDE("openssl/engine.h", "CFLAGS")) {
if (CHECK_FUNC_IN_HEADER("openssl/engine.h", "ENGINE_cleanup", null, "CFLAGS")) {
AC_DEFINE("HAVE_ENGINE_CLEANUP", 1, "Define to 1 if ENGINE_cleanup is available.");
}
}

CHECK_HEADER_ADD_INCLUDE("timelib_config.h", "CFLAGS_STANDARD", "ext/date/lib");

ADD_FLAG("LIBS_STANDARD", "iphlpapi.lib");
Expand Down
Loading