fi
if test "x$ap_ssltk_type" = "x"; then
AC_MSG_CHECKING(for OpenSSL version)
+ dnl First check for manditory headers
AC_CHECK_HEADERS([openssl/opensslv.h openssl/ssl.h], [ap_ssltk_type="openssl"], [])
if test "$ap_ssltk_type" = "openssl"; then
dnl so it's OpenSSL - test for a good version
echo "WARNING: OpenSSL version may contain security vulnerabilities!"
echo " Ensure the latest security patches have been applied!"
])
+ dnl Look for additional, possibly missing headers
+ AC_CHECK_HEADERS(openssl/engine.h)
else
AC_MSG_RESULT([no OpenSSL headers found])
fi
AC_CHECK_LIB(crypto, SSLeay_version, [], [liberrors="yes"])
AC_CHECK_LIB(ssl, SSL_CTX_new, [], [liberrors="yes"])
AC_CHECK_FUNCS(ENGINE_init)
+ AC_CHECK_FUNCS(ENGINE_load_builtin_engines)
else
AC_CHECK_LIB(sslc, SSLC_library_version, [], [liberrors="yes"])
AC_CHECK_LIB(sslc, SSL_CTX_new, [], [liberrors="yes"])
return NULL;
}
-#ifdef HAVE_ENGINE_INIT
+#if defined(HAVE_OPENSSL_ENGINE_H) && defined(HAVE_ENGINE_INIT)
const char *ssl_cmd_SSLCryptoDevice(cmd_parms *cmd,
void *dcfg,
const char *arg)
SSLModConfigRec *mc = myModConfig(cmd->server);
const char *err;
ENGINE *e;
-#if SSL_LIBRARY_VERSION >= 0x00907000
+#ifdef HAVE_ENGINE_LOAD_BUILTIN_ENGINES
static int loaded_engines = FALSE;
/* early loading to make sure the engines are already
/*
* SSL external crypto device ("engine") support
*/
-#ifdef HAVE_ENGINE_INIT
+#if defined(HAVE_OPENSSL_ENGINE_H) && defined(HAVE_ENGINE_INIT)
ssl_init_Engine(base_server, p);
#endif
* Support for external a Crypto Device ("engine"), usually
* a hardware accellerator card for crypto operations.
*/
-#ifdef HAVE_ENGINE_INIT
+#if defined(HAVE_OPENSSL_ENGINE_H) && defined(HAVE_ENGINE_INIT)
void ssl_init_Engine(server_rec *s, apr_pool_t *p)
{
SSLModConfigRec *mc = myModConfig(s);
#include <openssl/evp.h>
#include <openssl/rand.h>
#include <openssl/x509v3.h>
-#ifdef HAVE_ENGINE_INIT
+/* Avoid tripping over an engine build installed globally and detected
+ * when the user points at an explicit non-engine flavor of OpenSSL
+ */
+#if defined(HAVE_OPENSSL_ENGINE_H) && defined(HAVE_ENGINE_INIT)
#include <openssl/engine.h>
#endif