3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-25 09:39:25 +01:00

build: Create ELL_UNIT_TEST_DATA define for certificate directory

This commit is contained in:
Marcel Holtmann 2019-04-03 19:16:29 +02:00
parent 6ecc3a20b8
commit ea074ffe67
2 changed files with 20 additions and 16 deletions

View File

@ -327,7 +327,6 @@ ell_pem_files = cert-ca-key.pem cert-client-key.pem cert-client-key-pkcs8.pem \
if MAINTAINER_MODE
noinst_PROGRAMS += $(unit_tests)
noinst_DATA = ell/unit/test_data
endif
unit_test_eap_sim_SOURCES = unit/test-eap-sim.c \
@ -398,6 +397,7 @@ unit_test_eapol_SOURCES = unit/test-eapol.c \
src/eap-tls-common.h src/eap-tls-common.c \
src/mschaputil.h src/mschaputil.c
unit_test_eapol_LDADD = $(ell_ldadd)
unit_test_eapol_DEPENDENCIES = ell/unit/test_data
unit_test_ssid_to_utf8_SOURCES = src/util.h src/util.c \
unit/test-ssid-to-utf8.c
@ -458,7 +458,8 @@ EXTRA_DIST = src/genbuiltin src/iwd.service.in src/net.connman.iwd.service \
wired/ead.service.in wired/net.connman.ead.service \
doc/main.conf $(manual_pages:.1=.txt)
AM_CFLAGS = $(ell_cflags) -fvisibility=hidden
AM_CFLAGS = $(ell_cflags) -fvisibility=hidden \
-DELL_UNIT_TEST_DATA=\"$(abs_builddir)/ell/unit/\"
CLEANFILES = src/iwd.service wired/ead.service
@ -490,10 +491,10 @@ ell/ell.h: Makefile
done
ell/unit/test_data: Makefile
$(AM_V_at)$(MKDIR_P) ell/unit
$(AM_V_at)$(MKDIR_P) $(abs_builddir)/ell/unit
$(AM_V_GEN)for f in $(ell_pem_files) ; do \
if [ ! -f $$f ] ; then \
$(LN_S) -t ell/unit -f $(abs_srcdir)/../ell/unit/$$f ; \
$(LN_S) -t $(abs_builddir)/ell/unit -f $(abs_srcdir)/../ell/unit/$$f ; \
fi \
done > $@
@ -507,6 +508,9 @@ SED_PROCESS = $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
%.1: %.txt
$(AM_V_GEN)$(A2X) --doctype manpage --format manpage $(srcdir)/$<
clean-local:
-rm -rf $(abs_builddir)/ell/unit/*.pem $(abs_builddir)/ell/unit/test_data
maintainer-clean-local:
-rm -rf build-aux ell

View File

@ -2947,9 +2947,9 @@ static void eapol_sm_test_tls(struct eapol_8021x_tls_test_state *s,
s->tx_buf_len = 0;
s->tx_buf_offset = 0;
assert(l_tls_set_auth_data(s->tls, "ell/unit/cert-server.pem",
"ell/unit/cert-server-key-pkcs8.pem", NULL));
assert(l_tls_set_cacert(s->tls, "ell/unit/cert-ca.pem"));
assert(l_tls_set_auth_data(s->tls, ELL_UNIT_TEST_DATA "cert-server.pem",
ELL_UNIT_TEST_DATA "cert-server-key-pkcs8.pem", NULL));
assert(l_tls_set_cacert(s->tls, ELL_UNIT_TEST_DATA "cert-ca.pem"));
assert(l_tls_start(s->tls));
start = 1;
@ -3113,9 +3113,9 @@ static void eapol_sm_test_eap_tls(const void *data)
static const char *eapol_8021x_config = "[Security]\n"
"EAP-Method=TLS\n"
"EAP-Identity=abc@example.com\n"
"EAP-TLS-CACert=ell/unit/cert-ca.pem\n"
"EAP-TLS-ClientCert=ell/unit/cert-client.pem\n"
"EAP-TLS-ClientKey=ell/unit/cert-client-key-pkcs8.pem";
"EAP-TLS-CACert=" ELL_UNIT_TEST_DATA "cert-ca.pem\n"
"EAP-TLS-ClientCert=" ELL_UNIT_TEST_DATA "cert-client.pem\n"
"EAP-TLS-ClientKey=" ELL_UNIT_TEST_DATA "cert-client-key-pkcs8.pem";
struct eapol_8021x_tls_test_state s;
s.app_data_cb = eapol_sm_test_tls_new_data;
@ -3189,9 +3189,9 @@ static void eapol_sm_test_eap_ttls_md5(const void *data)
static const char *eapol_8021x_config = "[Security]\n"
"EAP-Method=TTLS\n"
"EAP-Identity=abc@example.com\n"
"EAP-TTLS-CACert=ell/unit/cert-ca.pem\n"
"EAP-TTLS-ClientCert=ell/unit/cert-client.pem\n"
"EAP-TTLS-ClientKey=ell/unit/cert-client-key-pkcs8.pem\n"
"EAP-TTLS-CACert=" ELL_UNIT_TEST_DATA "cert-ca.pem\n"
"EAP-TTLS-ClientCert=" ELL_UNIT_TEST_DATA "cert-client.pem\n"
"EAP-TTLS-ClientKey=" ELL_UNIT_TEST_DATA "cert-client-key-pkcs8.pem\n"
"EAP-TTLS-Phase2-Method=MD5\n"
"EAP-TTLS-Phase2-Identity=abc@example.com\n"
"EAP-TTLS-Phase2-Password=testpasswd";
@ -3258,9 +3258,9 @@ static void eapol_sm_test_eap_nak(const void *data)
static const char *eapol_8021x_config = "[Security]\n"
"EAP-Method=TLS\n"
"EAP-Identity=abc@example.com\n"
"EAP-TLS-CACert=ell/unit/cert-ca.pem\n"
"EAP-TLS-ClientCert=ell/unit/cert-client.pem\n"
"EAP-TLS-ClientKey=ell/unit/cert-client-key-pkcs8.pem";
"EAP-TLS-CACert=" ELL_UNIT_TEST_DATA "cert-ca.pem\n"
"EAP-TLS-ClientCert=" ELL_UNIT_TEST_DATA "cert-client.pem\n"
"EAP-TLS-ClientKey=" ELL_UNIT_TEST_DATA "cert-client-key-pkcs8.pem";
static const unsigned char ap_wpa_ie[] = {
0xdd, 0x16, 0x00, 0x50, 0xf2, 0x01, 0x01, 0x00,
0x00, 0x50, 0xf2, 0x02, 0x01, 0x00, 0x00, 0x50,