]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fix mbedtls unit tests
authorSteffan Karger <steffan.karger@fox-it.com>
Wed, 10 Oct 2018 06:44:43 +0000 (08:44 +0200)
committerGert Doering <gert@greenie.muc.de>
Thu, 11 Oct 2018 14:50:45 +0000 (16:50 +0200)
Commit 674b166 ("Fix build warnings related to get_random()") broke the
unit tests for mbedtls, because <mbedtls/cipher.h> was now included via
platform.c -> crypto.h -> crypto_backend.h, but the crypto cflags were
not included for that unit tests.

Since we got rid of --disable-crypto, we can now fix this by simply always
including the CRYPTO_CFLAGS in the TEST_CFLAGS (and the CRYPTO_LIBS in the
TEST_LDFLAGS). This should not only fix this occurrence, but also prevent
similar problems in the future.

Signed-off-by: Steffan Karger <steffan.karger@fox-it.com>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <1539153883-15789-1-git-send-email-steffan.karger@fox-it.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg17687.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
configure.ac
tests/unit_tests/openvpn/Makefile.am

index 399cdf4eae517565c6af0d6e624d4cbd4736ed27..1e6891b1cbe9c6cb336236acf0ade8385884ed00 100644 (file)
@@ -1360,8 +1360,8 @@ AC_SUBST([VENDOR_SRC_ROOT])
 AC_SUBST([VENDOR_BUILD_ROOT])
 AC_SUBST([VENDOR_DIST_ROOT])
 
-TEST_LDFLAGS="-lcmocka -L\$(abs_top_builddir)/vendor/dist/lib -Wl,-rpath,\$(abs_top_builddir)/vendor/dist/lib"
-TEST_CFLAGS="-I\$(top_srcdir)/include -I\$(abs_top_builddir)/vendor/dist/include"
+TEST_LDFLAGS="${OPTIONAL_CRYPTO_LIBS} ${OPTIONAL_PKCS11_LIBS} -lcmocka -L\$(abs_top_builddir)/vendor/dist/lib -Wl,-rpath,\$(abs_top_builddir)/vendor/dist/lib"
+TEST_CFLAGS="${OPTIONAL_CRYPTO_CFLAGS} ${OPTIONAL_PKCS11_CFLAGS} -I\$(top_srcdir)/include -I\$(abs_top_builddir)/vendor/dist/include"
 
 AC_SUBST([TEST_LDFLAGS])
 AC_SUBST([TEST_CFLAGS])
index 0f7f86b9a437354a458b7a5f2f34eecd5308a51a..22a458a44438cc6ad4ed387822279c411a720972 100644 (file)
@@ -14,10 +14,8 @@ openvpn_includedir = $(top_srcdir)/include
 openvpn_srcdir = $(top_srcdir)/src/openvpn
 compat_srcdir = $(top_srcdir)/src/compat
 
-argv_testdriver_CFLAGS  = @TEST_CFLAGS@ -I$(openvpn_srcdir) -I$(compat_srcdir) \
-       $(OPTIONAL_CRYPTO_CFLAGS)
-argv_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(openvpn_srcdir) -Wl,--wrap=parse_line \
-       $(OPTIONAL_CRYPTO_LIBS)
+argv_testdriver_CFLAGS  = @TEST_CFLAGS@ -I$(openvpn_srcdir) -I$(compat_srcdir)
+argv_testdriver_LDFLAGS = @TEST_LDFLAGS@ -L$(openvpn_srcdir) -Wl,--wrap=parse_line
 argv_testdriver_SOURCES = test_argv.c mock_msg.c \
        mock_get_random.c \
        $(openvpn_srcdir)/platform.c \
@@ -31,10 +29,8 @@ buffer_testdriver_SOURCES = test_buffer.c mock_msg.c \
        $(openvpn_srcdir)/platform.c
 
 crypto_testdriver_CFLAGS  = @TEST_CFLAGS@ \
-       -I$(openvpn_includedir) -I$(compat_srcdir) -I$(openvpn_srcdir) \
-       $(OPTIONAL_CRYPTO_CFLAGS)
-crypto_testdriver_LDFLAGS = @TEST_LDFLAGS@ \
-       $(OPTIONAL_CRYPTO_LIBS)
+       -I$(openvpn_includedir) -I$(compat_srcdir) -I$(openvpn_srcdir)
+crypto_testdriver_LDFLAGS = @TEST_LDFLAGS@
 crypto_testdriver_SOURCES = test_crypto.c mock_msg.c \
        $(openvpn_srcdir)/buffer.c \
        $(openvpn_srcdir)/crypto.c \
@@ -45,10 +41,8 @@ crypto_testdriver_SOURCES = test_crypto.c mock_msg.c \
        $(openvpn_srcdir)/platform.c
 
 packet_id_testdriver_CFLAGS  = @TEST_CFLAGS@ \
-       -I$(openvpn_includedir) -I$(compat_srcdir) -I$(openvpn_srcdir) \
-       $(OPTIONAL_CRYPTO_CFLAGS)
-packet_id_testdriver_LDFLAGS = @TEST_LDFLAGS@ \
-       $(OPTIONAL_CRYPTO_LIBS)
+       -I$(openvpn_includedir) -I$(compat_srcdir) -I$(openvpn_srcdir)
+packet_id_testdriver_LDFLAGS = @TEST_LDFLAGS@
 packet_id_testdriver_SOURCES = test_packet_id.c mock_msg.c \
        mock_get_random.c \
        $(openvpn_srcdir)/buffer.c \
@@ -57,10 +51,8 @@ packet_id_testdriver_SOURCES = test_packet_id.c mock_msg.c \
        $(openvpn_srcdir)/platform.c
 
 tls_crypt_testdriver_CFLAGS  = @TEST_CFLAGS@ \
-       -I$(openvpn_includedir) -I$(compat_srcdir) -I$(openvpn_srcdir) \
-       $(OPTIONAL_CRYPTO_CFLAGS)
-tls_crypt_testdriver_LDFLAGS = @TEST_LDFLAGS@ \
-       $(OPTIONAL_CRYPTO_LIBS)
+       -I$(openvpn_includedir) -I$(compat_srcdir) -I$(openvpn_srcdir)
+tls_crypt_testdriver_LDFLAGS = @TEST_LDFLAGS@
 tls_crypt_testdriver_SOURCES = test_tls_crypt.c mock_msg.c \
        $(openvpn_srcdir)/base64.c \
        $(openvpn_srcdir)/buffer.c \