[stunnel-users] engine-patch

Alexander Lazic al-stunnel at none.at
Wed Dec 29 12:17:43 CET 2004


Hi,

we have a the following openssl:

---
OpenSSL 0.9.7d 17 Mar 2004
built on: Wed Nov  3 13:28:35 CET 2004
platform: solaris-sparcv9-gcc
options:  bn(64,32) md2(int) rc4(ptr,char) des(idx,cisc,16,long) idea(int) blowfish(ptr) 
compiler: gcc -DOPENSSL_SYSNAME_ULTRASPARC -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DOPENSSL_NO_KRB5 -DOPENSSL_NO_ENGINE -m32 -mcpu=ultrasparc -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W -DMD5_ASM
---

We don't have the engine enabled therefore the current stunnel don't
compile :-(

I have attached the patch for the current (4.06) stunnel version.

BTW: I need the 'X-Forwarded-For' header, in where is the right position
     to add it in the 4.06 version. I think in 'src/client.c => transfer()'
     but i'am not sure, where there ;-)

Thanx for help ;-)

al ;-)
-------------- next part --------------
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 <openssl/err.h>
 #include <openssl/crypto.h> /* for CRYPTO_* and SSLeay_version */
 #include <openssl/rand.h>
-#if SSLEAY_VERSION_NUMBER >= 0x00907000L
+#if (SSLEAY_VERSION_NUMBER >= 0x00907000L) && defined(HAVE_OSSL_ENGINE_H)
 #include <openssl/engine.h>
 #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;
 


More information about the stunnel-users mailing list