3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 04:32:37 +01:00

build: generate tls config for unit tests

To test embedded certs we need a settings file containing the same
PEMs that we generate during build time. In the same fashion generate
tls-settings.8021x file using the previously generated PEMs.
This commit is contained in:
James Prestwood 2019-10-07 11:11:57 -07:00 committed by Denis Kenzior
parent bea1d22a5c
commit be55eb0b5e

View File

@ -441,7 +441,8 @@ unit_test_eapol_DEPENDENCIES = $(ell_dependencies) \
unit/cert-server.pem \
unit/cert-server-key-pkcs8.pem \
unit/cert-client.pem \
unit/cert-client-key-pkcs8.pem
unit/cert-client-key-pkcs8.pem \
unit/tls-settings.8021x
unit_test_util_SOURCES = src/util.h src/util.c \
unit/test-util.c
@ -576,6 +577,21 @@ unit/cert-client.pem: unit/cert-client.csr unit/cert-ca.pem unit/gencerts.cnf
-CAserial $(builddir)/unit/cert-ca.srl \
-CAcreateserial -sha256 -days 10000 -out $@ $($(AM_V_P)_redirect_openssl)
unit/tls-settings.8021x: unit/cert-ca.pem unit/cert-client.pem unit/cert-client-key-pkcs8.pem
$(AM_V_GEN) \
$(file >$@,[Security]) \
$(file >>$@,EAP-Method=TLS) \
$(file >>$@,EAP-Identity=abc@example.com) \
$(file >>$@,EAP-TLS-CACert=embed:ca_cert) \
$(file >>$@,EAP-TLS-ClientCert=embed:client_cert) \
$(file >>$@,EAP-TLS-ClientKey=embed:client_key) \
$(file >>$@,[@pem@ca_cert]) \
$(shell cat unit/cert-ca.pem >> $@) \
$(file >>$@,[@pem@client_cert]) \
$(shell cat unit/cert-client.pem >> $@) \
$(file >>$@,[@pem@client_key]) \
$(shell cat unit/cert-client-key-pkcs8.pem >> $@)
BUILT_SOURCES = $(ell_built_sources) src/builtin.h
ell/internal: Makefile
@ -627,7 +643,7 @@ endif
endif
clean-local:
-rm -f unit/cert-*.pem unit/cert-*.csr unit/cert-*.srl
-rm -f unit/cert-*.pem unit/cert-*.csr unit/cert-*.srl unit/*-settings.8021x
maintainer-clean-local:
-rm -rf build-aux ell