[prev in list] [next in list] [prev in thread] [next in thread] 

List:       stunnel-users
Subject:    Re: can't make stunnel-3.4a
From:       "Mark D. Baushke" <mark.baushke () solipsa ! com>
Date:       1999-12-03 5:58:18
[Download RAW message or body]

Hi Vadim,

> Date: Fri, 03 Dec 1999 10:11:24 +0800
> From: Vadim Stanovov <vvs@blpk.ru>
> 
> Hi,
> 
> I've got this error while make stunnel-3.4a from ports on FreeBSD
> 3.3-RELEASE (ports was cvsup -ed 991201): 
> 
...
> ssl.c
> ssl.c: In function `context_init':
> ssl.c:205: too few arguments to function `PEM_read_bio_DHparams'
... 
> What does it mean and how can I overcome it ?
> Thanks for advices.
> -- 
> Vadim Stanovov

I ran into the same problem with OpenSSL 0.9.4 as you are hitting with
FreeBSD 3.3-RELEASE. There is an API change for PEM_read_bio_DHparams()
that has occured.

I'll include the patch I used to fix the problem.

	-- Mark

Delivery-Date: Wed Nov 17 16:38:36 1999
Return-Path: <mark.baushke>
Received: from mozart.solipsa.com (localhost [127.0.0.1])
	by mozart.solipsa.com (8.9.3/8.9.3) with ESMTP id QAA10765;
	Wed, 17 Nov 1999 16:38:36 -0800
Message-Id: <199911180038.QAA10765@mozart.solipsa.com>
To: stunnel-users@mike.daewoo.com.pl
From: "Mark D. Baushke" <mark.baushke@solipsa.com>
Reply-To: "Mark D. Baushke" <mark.baushke@solipsa.com>
Subject: patch to stunnel-3.4a for OpenSSL 0.9.4
Date: Wed, 17 Nov 1999 16:38:36 -0800
Sender: mdb@solipsa.com

The following is a patch to sunnel-3.4a to support OpenSSL 0.9.4.

Per the FAQ, here is the information you requested when reporting
problems with stunnel-3.4a

1. Building stunnel-3.4a on Sparc Solaris2.6 system using rsaref2.0 and
   OpenSSL version 0.9.4  has a problem with the number of arguments
   to the PEM_read_bio_DHparams function.

        gcc -g -O2 -Wall -I/usr/local/ssl/include -Dlibdir=\"/usr/local/lib\" \
            -c ssl.c -o ssl.o
        ssl.c: In function `context_init':
        ssl.c:205: too few arguments to function `PEM_read_bio_DHparams'
        make: *** [ssl.o] Error 1

2. sudo ./stunnel -f -d 7 -r 80 -p /tmp/test.pem
LOG3[7246:1]: Could not load DH parameters from /tmp/test.pem
LOG4[7246:1]: Diffie-Hellman initialization failed
LOG5[7246:1]: stunnel 3.4a on sparc-sun-solaris2.6 PTHREAD+LIBWRAP
LOG3[7246:1]: /var/run/stunnel.80.pid: No such file or directory (2)
LOG3[7246:1]: bind: Address already in use (125)

The above information is not really that useful as port 7 is already
bound by the echo service in inetd.conf and I suspect that it is okay
for the Diffie-Hellman initialization to fail with an RSA-based PEM
certificate.

3. uname -a
   SunOS mdb05 5.6 Generic_105181-16 sun4u sparc SUNW,Ultra-60
4. Linux libc version is not applicable
5. gcc -v
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.95.1/specs
gcc version 2.95.1 19990816 (release)
6. openssl version
OpenSSL 0.9.4 09 Aug 1999

The following patch borrows the idea of the SSL_LIBRARY_VERSION macro
used by apache 1.3.9.

Index: ssl.c
--- ssl.c~	1999/07/13 06:23:44
+++ ssl.c	1999/11/17 23:51:54
@@ -79,6 +79,15 @@
 #include <err.h>
 #endif
 
+/*
+ * Determine SSL library version number
+ */
+#ifdef OPENSSL_VERSION_NUMBER
+#define SSL_LIBRARY_VERSION OPENSSL_VERSION_NUMBER
+#else
+#define SSL_LIBRARY_VERSION 0x0000
+#endif
+
 #ifdef USE_WIN32
 
 #define Win32_Winsock
@@ -202,7 +211,12 @@
                 strerror(errno));
             goto dh_failed;
         }
-        if(!(dh=PEM_read_bio_DHparams(bio, NULL, NULL))) {
+#if SSL_LIBRARY_VERSION < 0x00904000
+	dh = PEM_read_bio_DHparams(bio, NULL, NULL);
+#else
+	dh = PEM_read_bio_DHparams(bio, NULL, NULL, NULL);
+#endif
+        if(!dh) {
             log(LOG_ERR, "Could not load DH parameters from %s",
                 options.certfile);
             goto dh_failed;

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic