Opened 5 years ago

Closed 5 years ago

#589 closed Bug / Defect (notabug)

Error during 'make' in file 'crypto_openssl.c', 'ssl_verify_openssl.c', etc

Reported by: dogbert2 Owned by:
Priority: major Milestone:
Component: Building / Compiling Version: OpenVPN 2.3.8 (Community Ed)
Severity: Not set (select this one, unless your'e a OpenVPN developer) Keywords: undefined reference errors in ssl_verify_openssl.c
Cc:

Description

I received a pile of errors during 'make', which are listed below:

libtool: link: gcc -I/usr/local/ssl/include/openssl -I/usr/local/ssl/include/openssl -I/usr/local/include/lzo -g -O2 -o openvpn base64.o buffer.o clinat.o crypto.o crypto_openssl.o crypto_polarssl.o dhcp.o error.o event.o fdmisc.o forward.o fragment.o gremlin.o helper.o httpdigest.o lladdr.o init.o interval.o list.o lzo.o manage.o mbuf.o misc.o platform.o console.o mroute.o mss.o mstats.o mtcp.o mtu.o mudp.o multi.o ntlm.o occ.o pkcs11.o pkcs11_openssl.o pkcs11_polarssl.o openvpn.o options.o otime.o packet_id.o perf.o pf.o ping.o plugin.o pool.o proto.o proxy.o ps.o push.o reliable.o route.o schedule.o session_id.o shaper.o sig.o socket.o socks.o ssl.o ssl_openssl.o ssl_polarssl.o ssl_verify.o ssl_verify_openssl.o ssl_verify_polarssl.o status.o tun.o win32.o cryptoapi.o ../../src/compat/.libs/libcompat.a -lnsl -lresolv -llzo2 -L/usr/local/ssl/lib -ldl
crypto_openssl.o: In function `show_available_digests':
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:336: undefined reference to `OBJ_nid2sn'
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:336: undefined reference to `EVP_get_digestbyname'
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:340: undefined reference to `EVP_MD_size'
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:339: undefined reference to `OBJ_nid2sn'
crypto_openssl.o: In function `key_des_num_cblocks':
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:395: undefined reference to `EVP_CIPHER_nid'
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:395: undefined reference to `OBJ_nid2sn'
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:400: undefined reference to `EVP_CIPHER_key_length'
crypto_openssl.o: In function `key_des_check':
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:427: undefined reference to `DES_is_weak_key'
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:432: undefined reference to `DES_check_key_parity'
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:441: undefined reference to `ERR_clear_error'
crypto_openssl.o: In function `key_des_fixup':
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:461: undefined reference to `DES_set_odd_parity'
crypto_openssl.o: In function `cipher_kt_get':
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:480: undefined reference to `EVP_get_cipherbyname'
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:485: undefined reference to `EVP_CIPHER_key_length'
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:486: undefined reference to `EVP_CIPHER_key_length'
crypto_openssl.o: In function `cipher_kt_name':
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:499: undefined reference to `EVP_CIPHER_nid'
crypto_openssl.o: In function `cipher_kt_mode':
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:524: undefined reference to `EVP_CIPHER_flags'
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:524: undefined reference to `EVP_CIPHER_flags'
crypto_openssl.o: In function `cipher_kt_mode_cbc':
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:533: undefined reference to `EVP_CIPHER_flags'
crypto_openssl.o: In function `cipher_kt_mode_ofb_cfb':
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:545: undefined reference to `EVP_CIPHER_flags'
crypto_openssl.o: In function `show_available_ciphers':
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:297: undefined reference to `OBJ_nid2sn'
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:297: undefined reference to `EVP_get_cipherbyname'
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:307: undefined reference to `EVP_CIPHER_flags'
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:313: undefined reference to `EVP_CIPHER_key_length'
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:312: undefined reference to `OBJ_nid2sn'
crypto_openssl.o: In function `cipher_ctx_init':
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:565: undefined reference to `EVP_CIPHER_CTX_init'
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:566: undefined reference to `EVP_CipherInit'
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:572: undefined reference to `EVP_CipherInit'
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:576: undefined reference to `EVP_CIPHER_CTX_key_length'
crypto_openssl.o: In function `cipher_ctx_mode':
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:600: undefined reference to `EVP_CIPHER_CTX_flags'
crypto_openssl.o: In function `cipher_des_encrypt_ecb':
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:637: undefined reference to `DES_set_key_unchecked'
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:638: undefined reference to `DES_ecb_encrypt'
crypto_openssl.o: In function `md_kt_get':
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:653: undefined reference to `EVP_get_digestbyname'
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:656: undefined reference to `EVP_MD_size'
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:657: undefined reference to `EVP_MD_size'
crypto_openssl.o: In function `md_kt_name':
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:669: undefined reference to `EVP_MD_type'
crypto_openssl.o: In function `md_full':
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:690: undefined reference to `EVP_Digest'
crypto_openssl.o: In function `md_ctx_init':
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:700: undefined reference to `EVP_MD_CTX_init'
crypto_openssl.o: In function `md_ctx_size':
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:713: undefined reference to `EVP_MD_CTX_md'
crypto_openssl.o: In function `md_ctx_final':
/usr/local/src/openvpn-2.3.8/src/openvpn/crypto_openssl.c:727: undefined reference to `EVP_DigestFinal'

There are a lot more, but you get the idea. Here is the configure line I used (OpenSSL built and installed in /usr/local/ssl, btw):

./configure LZO_CFLAGS="-I/usr/local/include/lzo" LZO_LIS="--L/usr/local/lib" OPENSSL_SSL_CFLAGS="-I/usr/local/ssl/include/openssl" OPENSSL_SSL_LIBS="-L/usr/local/ssl/lib" OPENSSL_CRYPTO_LIBS="-L/usr/local/ssl/lib" OPENSSL_CRYPTO_CFLAGS="-I/usr/local/ssl/include/openssl"

using GREP for things like BIO_free in /usr/local/ssl/include/openssl returns:

[root@moocow@parksoft openssl]# grep -r -i "BIO_FREE" *
bio.h: * doing a BIO_free_all() to catch the underlying BIO.
bio.h:int BIO_free(BIO *a);
bio.h:void BIO_free_all(BIO *a);
safestack.h:# define sk_BIO_free(st) SKM_sk_free(BIO, (st))

a grep for BIO_Free in /usr/local/ssl/lib returns:

[root@moocow@parksoft lib]# pwd
/usr/local/ssl/lib
[root@moocow@parksoft lib]# grep -r -i "BIO_FREE" *
Binary file libcrypto.a matc

Does anyone have an idea what is going on, I know it all compiled correctly, but it's having an issue linking via libtool.

Change History (1)

comment:1 Changed 5 years ago by Gert Döring

Resolution: notabug
Status: newclosed

Add "-lssl" and "-lcrypto" to your ..._LIBS flags - you've told it where to look for the library (-L/where/to/look) but not *what* to link there - "-lssl" for libssl.a, and "-lcrypto" for libcrypto.a

And please stop opening trac tickets for stuff that really should be asked on the openvpn-users list or in the #openvpn channel - this is not a bug.

Note: See TracTickets for help on using tickets.