diff -ruNH stunnel-4.06_orig/configure.ac stunnel-4.06/configure.ac --- stunnel-4.06_orig/configure.ac 2004-12-26 00:30:48.000000000 +0100 +++ stunnel-4.06/configure.ac 2004-12-29 10:12:11.955692166 +0100 @@ -81,6 +81,10 @@ AC_SUBST(ssldir) AC_DEFINE_UNQUOTED(ssldir, "$ssldir") +AC_CHECK_HEADER([$ssldir/include/openssl/engine.h], + [AC_DEFINE([HAVE_OSSL_ENGINE_H])], + [AC_MSG_WARN([Sorry, can't find openssl engine header])]) + AC_ARG_WITH(egd-socket, [ --with-egd-socket=FILE Entropy Gathering Daemon socket pathname], [EGD_SOCKET="$withval"] diff -ruNH stunnel-4.06_orig/src/common.h stunnel-4.06/src/common.h --- stunnel-4.06_orig/src/common.h 2004-12-26 00:09:13.000000000 +0100 +++ stunnel-4.06/src/common.h 2004-12-29 10:20:01.132014565 +0100 @@ -255,7 +255,7 @@ #include #include /* for CRYPTO_* and SSLeay_version */ #include -#if SSLEAY_VERSION_NUMBER >= 0x00907000L +#if (SSLEAY_VERSION_NUMBER >= 0x00907000L) && defined(HAVE_OSSL_ENGINE_H) #include #endif #else diff -ruNH stunnel-4.06_orig/src/options.c stunnel-4.06/src/options.c --- stunnel-4.06_orig/src/options.c 2004-12-25 23:46:32.000000000 +0100 +++ stunnel-4.06/src/options.c 2004-12-29 10:20:43.816950202 +0100 @@ -306,6 +306,7 @@ } #endif /* OpenSSL 0.9.5a */ +#if (SSLEAY_VERSION_NUMBER >= 0x00907000L) && defined(HAVE_OSSL_ENGINE_H) /* engine */ switch(cmd) { case CMD_INIT: @@ -323,6 +324,7 @@ "engine"); break; } +#endif /* foreground */ #ifndef USE_WIN32 diff -ruNH stunnel-4.06_orig/src/prototypes.h stunnel-4.06/src/prototypes.h --- stunnel-4.06_orig/src/prototypes.h 2004-12-25 22:24:09.000000000 +0100 +++ stunnel-4.06/src/prototypes.h 2004-12-29 10:20:58.635539222 +0100 @@ -114,7 +114,10 @@ typedef struct { /* some data for SSL initialization in ssl.c */ COMP_TYPE compression; /* compression type */ + +#if (SSLEAY_VERSION_NUMBER >= 0x00907000L) && defined(HAVE_OSSL_ENGINE_H) char *engine; /* hardware SSL engine */ +#endif char *ca_dir; /* directory for hashed certs */ char *ca_file; /* file containing bunches of certs */ char *crl_dir; /* directory for hashed CRLs */ diff -ruNH stunnel-4.06_orig/src/ssl.c stunnel-4.06/src/ssl.c --- stunnel-4.06_orig/src/ssl.c 2004-12-25 23:47:46.000000000 +0100 +++ stunnel-4.06/src/ssl.c 2004-12-29 10:19:24.727480965 +0100 @@ -46,7 +46,10 @@ /* Global SSL initalization */ static void init_compression(void); + +#if (SSLEAY_VERSION_NUMBER >= 0x00907000L) && defined(HAVE_OSSL_ENGINE_H) static void init_engine(void); +#endif static int init_prng(void); static int prng_seeded(int); static int add_rand_file(char *); @@ -74,7 +77,7 @@ void ssl_init(void) { /* init SSL */ SSLeay_add_ssl_algorithms(); SSL_load_error_strings(); -#if SSLEAY_VERSION_NUMBER >= 0x00907000L +#if (SSLEAY_VERSION_NUMBER >= 0x00907000L) && defined(HAVE_OSSL_ENGINE_H) if(options.engine) init_engine(); #endif @@ -112,7 +115,7 @@ s_log(LOG_INFO, "Compression enabled"); } -#if SSLEAY_VERSION_NUMBER >= 0x00907000L +#if (SSLEAY_VERSION_NUMBER >= 0x00907000L) && defined(HAVE_OSSL_ENGINE_H) static void init_engine(void) { ENGINE *e;