Topic: wolfSSL 2.02 header errors

compiling ssmtp on Debian 5 (gcc 4.3.2) usin the wolfSSL headers gererates the following errors:

ssmtp-2.64# make

gcc -DSTDC_HEADERS=1 -DHAVE_LIMITS_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYSLOG_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIBNSL=1 -DRETSIGTYPE=void -DHAVE_VPRINTF=1 -DHAVE_GETHOSTNAME=1 -DHAVE_SOCKET=1 -DHAVE_STRDUP=1 -DHAVE_STRSTR=1 -DREWRITE_DOMAIN=1 -DHAVE_SSL=1  -DSSMTPCONFDIR=\"usr/etc/ssmtp\" -DCONFIGURATION_FILE=\"usr/etc/ssmtp/ssmtp.conf\" -DREVALIASES_FILE=\"usr/etc/ssmtp/revaliases\"  -g -O2 -Wall   -c -o ssmtp.o ssmtp.c
In file included from ssmtp.c:29:
/usr/include/cyassl/openssl/crypto.h:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'const'
/usr/include/cyassl/openssl/crypto.h:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'unsigned'

make: *** [ssmtp.o] Error 1

Using the openssl headers, it compiles fine, but of course cant link to wolfSSL as follows:

gcc -o ssmtp ssmtp.o arpadate.o base64.o xgethostname.o -lnsl  -lcyassl -DSTDC_HEADERS=1 -DHAVE_LIMITS_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYSLOG_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIBNSL=1 -DRETSIGTYPE=void -DHAVE_VPRINTF=1 -DHAVE_GETHOSTNAME=1 -DHAVE_SOCKET=1 -DHAVE_STRDUP=1 -DHAVE_STRSTR=1 -DREWRITE_DOMAIN=1 -DHAVE_SSL=1  -DSSMTPCONFDIR=\"usr/etc/ssmtp\" -DCONFIGURATION_FILE=\"usr/etc/ssmtp/ssmtp.conf\" -DREVALIASES_FILE=\"usr/etc/ssmtp/revaliases\"  -g -O2 -Wall
ssmtp.o: In function `fd_getc':
/opt/SRC/misc/ssmtp-2.64/ssmtp.c:1291: undefined reference to `SSL_read'
ssmtp.o: In function `smtp_open':
/opt/SRC/misc/ssmtp-2.64/ssmtp.c:1127: undefined reference to `SSL_load_error_strings'
/opt/SRC/misc/ssmtp-2.64/ssmtp.c:1128: undefined reference to `SSL_library_init'
/opt/SRC/misc/ssmtp-2.64/ssmtp.c:1129: undefined reference to `SSLv23_client_method'
/opt/SRC/misc/ssmtp-2.64/ssmtp.c:1130: undefined reference to `SSL_CTX_new'
/opt/SRC/misc/ssmtp-2.64/ssmtp.c:1137: undefined reference to `SSL_CTX_use_certificate_chain_file'
/opt/SRC/misc/ssmtp-2.64/ssmtp.c:1142: undefined reference to `SSL_CTX_use_PrivateKey_file'
/opt/SRC/misc/ssmtp-2.64/ssmtp.c:1147: undefined reference to `SSL_CTX_check_private_key'
/opt/SRC/misc/ssmtp-2.64/ssmtp.c:1253: undefined reference to `SSL_new'
/opt/SRC/misc/ssmtp-2.64/ssmtp.c:1258: undefined reference to `SSL_set_fd'
/opt/SRC/misc/ssmtp-2.64/ssmtp.c:1260: undefined reference to `SSL_connect'
/opt/SRC/misc/ssmtp-2.64/ssmtp.c:1267: undefined reference to `SSL_get_current_cipher'
/opt/SRC/misc/ssmtp-2.64/ssmtp.c:1267: undefined reference to `SSL_CIPHER_get_name'
/opt/SRC/misc/ssmtp-2.64/ssmtp.c:1271: undefined reference to `SSL_get_peer_certificate'
/opt/SRC/misc/ssmtp-2.64/ssmtp.c:1275: undefined reference to `X509_free'
ssmtp.o: In function `fd_puts':
/opt/SRC/misc/ssmtp-2.64/ssmtp.c:1358: undefined reference to `SSL_write'
collect2: ld returned 1 exit status
make: *** [ssmtp] Error 1


Is there a fix for the headers or a workaround to wrap the function names when linking?

Thanks much!  smile

Share

Re: wolfSSL 2.02 header errors

Hi jammers,

How did you configure the wolfSSL library?  Are you using version 2.0.2 of wolfSSL?

Regards,
Chris

3 (edited by jammers 2012-01-15 14:07:14)

Re: wolfSSL 2.02 header errors

wolfssl 2.0.2 built --without-zlib --enable-opensslExtra --prefix=/usr

All wolfssl 2.0.2 headers and libs are installed on the host system.

Gcc is finding the cayssl headers just fine, but there are syntax errors in cyassl/crypto.h
or somthing else is missing...

/usr/include/cyassl/openssl/crypto.h:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'const'
/usr/include/cyassl/openssl/crypto.h:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'unsigned'

P.S.
Where is the modified stunnel and light-httpd sources referenced in the forum?
I can't see those downloads anywhere on this site.

Share

Re: wolfSSL 2.02 header errors

Hi jammers,

We just pushed a patch to our GitHub repository which should solve several of the problems you are encountering.  You can find the patch here (https://github.com/cyassl/cyassl/commit … ef42bd1667).  This patch adds an include for <cyassl/ctaocrypt/settings.h> in wolfSSL's crypto.h file.  It also implements SSL_get_cipher() which is needed by ssmtp.

In addition to using the new patch, you'll need to swith "-lssl -lcrypto" for "-lcyassl" in configure.in.

Where is the modified stunnel and light-httpd sources referenced in the forum?
I can't see those downloads anywhere on this site.

You can find instructions to build lighttpd 1.4.23 with wolfSSL in the wolfSSL README file included in the download.  I believe the last time we looked at stunnel compatibility was with stunnel 4.31 and wolfSSL 1.4.0.  Is this something you will be needing?

Regards,
Chris