2020-09-18 11:49:48 +02:00
|
|
|
ALL=test-base64 test-md4 test-milenage \
|
2014-05-19 22:22:49 +02:00
|
|
|
test-rsa-sig-ver \
|
2012-08-07 12:30:13 +02:00
|
|
|
test-sha1 \
|
2020-10-12 20:37:25 +02:00
|
|
|
test-https test-https_server \
|
2023-11-28 02:50:07 +01:00
|
|
|
test-sha256 test-aes test-x509v3 test-list test-rc4 \
|
|
|
|
test-bss
|
2009-12-05 19:43:07 +01:00
|
|
|
|
2020-09-18 11:49:48 +02:00
|
|
|
include ../src/build.rules
|
2009-12-05 19:43:07 +01:00
|
|
|
|
2019-02-24 17:52:54 +01:00
|
|
|
ifdef LIBFUZZER
|
|
|
|
CC=clang
|
|
|
|
CFLAGS = -MMD -O2 -Wall -g
|
|
|
|
CFLAGS += -fsanitize=fuzzer,address,signed-integer-overflow,unsigned-integer-overflow
|
|
|
|
CFLAGS += -DTEST_LIBFUZZER
|
|
|
|
LDFLAGS += -fsanitize=fuzzer,address,signed-integer-overflow,unsigned-integer-overflow
|
|
|
|
TEST_FUZZ=y
|
|
|
|
endif
|
|
|
|
|
2019-02-09 20:07:24 +01:00
|
|
|
ifdef TEST_FUZZ
|
|
|
|
CFLAGS += -DCONFIG_NO_RANDOM_POOL
|
|
|
|
CFLAGS += -DTEST_FUZZ
|
|
|
|
endif
|
|
|
|
|
2019-02-10 16:02:49 +01:00
|
|
|
CFLAGS += -DCONFIG_IEEE80211R_AP
|
|
|
|
CFLAGS += -DCONFIG_IEEE80211R
|
|
|
|
CFLAGS += -DCONFIG_TDLS
|
|
|
|
|
2009-12-05 19:43:07 +01:00
|
|
|
CFLAGS += -I../src
|
2009-12-05 20:14:08 +01:00
|
|
|
CFLAGS += -I../src/utils
|
2009-12-05 19:43:07 +01:00
|
|
|
|
2009-12-06 16:18:28 +01:00
|
|
|
SLIBS = ../src/utils/libutils.a
|
|
|
|
|
|
|
|
DLIBS = ../src/crypto/libcrypto.a \
|
2009-12-06 15:45:36 +01:00
|
|
|
../src/tls/libtls.a
|
2009-12-05 19:43:07 +01:00
|
|
|
|
2020-10-11 09:58:58 +02:00
|
|
|
_OBJS_VAR := LLIBS
|
|
|
|
include ../src/objs.mk
|
|
|
|
_OBJS_VAR := SLIBS
|
|
|
|
include ../src/objs.mk
|
|
|
|
_OBJS_VAR := DLIBS
|
|
|
|
include ../src/objs.mk
|
|
|
|
|
2009-12-06 16:18:28 +01:00
|
|
|
LIBS = $(SLIBS) $(DLIBS)
|
|
|
|
LLIBS = -Wl,--start-group $(DLIBS) -Wl,--end-group $(SLIBS)
|
|
|
|
|
2014-01-03 16:41:16 +01:00
|
|
|
# glibc < 2.17 needs -lrt for clock_gettime()
|
|
|
|
LLIBS += -lrt
|
|
|
|
|
2020-09-18 11:49:58 +02:00
|
|
|
test-aes: $(call BUILDOBJ,test-aes.o) $(LIBS)
|
2012-09-08 23:25:54 +02:00
|
|
|
$(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
|
2009-12-05 21:25:32 +01:00
|
|
|
|
2020-09-18 11:49:58 +02:00
|
|
|
test-base64: $(call BUILDOBJ,test-base64.o) $(LIBS)
|
2014-01-03 16:41:16 +01:00
|
|
|
$(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
|
2009-12-05 19:43:07 +01:00
|
|
|
|
2020-09-18 11:49:58 +02:00
|
|
|
test-https: $(call BUILDOBJ,test-https.o) $(LIBS)
|
2019-02-09 16:05:36 +01:00
|
|
|
$(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
|
|
|
|
|
2020-09-18 11:49:58 +02:00
|
|
|
test-https_server: $(call BUILDOBJ,test-https_server.o) $(LIBS)
|
2011-11-13 09:49:27 +01:00
|
|
|
$(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
|
|
|
|
|
2020-09-18 11:49:58 +02:00
|
|
|
test-list: $(call BUILDOBJ,test-list.o) $(LIBS)
|
2014-01-03 16:41:16 +01:00
|
|
|
$(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
|
2009-12-19 12:43:25 +01:00
|
|
|
|
2020-09-18 11:49:58 +02:00
|
|
|
test-md4: $(call BUILDOBJ,test-md4.o) $(LIBS)
|
2014-01-03 16:41:16 +01:00
|
|
|
$(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
|
2009-12-05 20:14:08 +01:00
|
|
|
|
2020-09-18 11:49:58 +02:00
|
|
|
test-milenage: $(call BUILDOBJ,test-milenage.o) $(LIBS)
|
2014-01-03 16:41:16 +01:00
|
|
|
$(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
|
2009-12-05 20:14:08 +01:00
|
|
|
|
2020-09-18 11:49:58 +02:00
|
|
|
test-rc4: $(call BUILDOBJ,test-rc4.o) $(LIBS)
|
2014-01-03 16:41:16 +01:00
|
|
|
$(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
|
2011-11-24 19:54:20 +01:00
|
|
|
|
2020-09-18 11:49:58 +02:00
|
|
|
test-rsa-sig-ver: $(call BUILDOBJ,test-rsa-sig-ver.o) $(LIBS)
|
2014-05-19 22:22:49 +02:00
|
|
|
$(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
|
|
|
|
|
2020-09-18 11:49:58 +02:00
|
|
|
test-sha1: $(call BUILDOBJ,test-sha1.o) $(LIBS)
|
2014-01-03 16:41:16 +01:00
|
|
|
$(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
|
2009-12-05 21:25:32 +01:00
|
|
|
|
2020-09-18 11:49:58 +02:00
|
|
|
test-sha256: $(call BUILDOBJ,test-sha256.o) $(LIBS)
|
2014-01-03 16:41:16 +01:00
|
|
|
$(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
|
2009-12-05 21:25:32 +01:00
|
|
|
|
2020-09-18 11:49:58 +02:00
|
|
|
test-x509v3: $(call BUILDOBJ,test-x509v3.o) $(LIBS)
|
2009-12-06 17:10:52 +01:00
|
|
|
$(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
|
|
|
|
|
2009-12-05 20:14:08 +01:00
|
|
|
|
2023-11-28 02:50:07 +01:00
|
|
|
# We could cut this down more by enabling fewer options (above)
|
|
|
|
ELIBS += $(SRC)/crypto/libcrypto.a
|
|
|
|
ELIBS += $(SRC)/tls/libtls.a
|
|
|
|
|
|
|
|
WPAS_SRC=../wpa_supplicant
|
|
|
|
SRC=../src
|
|
|
|
WPA_LIBS = $(SRC)/common/libcommon.a
|
|
|
|
|
|
|
|
CFLAGS += -I$(SRC) -I$(SRC)/utils -I$(WPAS_SRC)
|
|
|
|
|
|
|
|
CFLAGS += -DCONFIG_DRIVER_NONE
|
|
|
|
CFLAGS += -DIEEE8021X_EAPOL
|
|
|
|
|
|
|
|
WPA_OBJS = $(WPAS_SRC)/bssid_ignore.o
|
|
|
|
WPA_OBJS += $(WPAS_SRC)/bss.o
|
|
|
|
WPA_OBJS += $(WPAS_SRC)/config.o
|
|
|
|
WPA_OBJS += $(WPAS_SRC)/config_file.o
|
|
|
|
WPA_OBJS += $(WPAS_SRC)/eap_register.o
|
|
|
|
WPA_OBJS += $(WPAS_SRC)/events.o
|
|
|
|
WPA_OBJS += $(WPAS_SRC)/notify.o
|
|
|
|
WPA_OBJS += $(WPAS_SRC)/offchannel.o
|
|
|
|
WPA_OBJS += $(WPAS_SRC)/op_classes.o
|
|
|
|
WPA_OBJS += $(WPAS_SRC)/robust_av.o
|
|
|
|
WPA_OBJS += $(WPAS_SRC)/rrm.o
|
|
|
|
WPA_OBJS += $(WPAS_SRC)/scan.o
|
|
|
|
WPA_OBJS += $(WPAS_SRC)/wmm_ac.o
|
|
|
|
WPA_OBJS += $(WPAS_SRC)/wpa_supplicant.o
|
|
|
|
WPA_OBJS += $(WPAS_SRC)/wpas_glue.o
|
|
|
|
WPA_OBJS += $(SRC)/rsn_supp/wpa.o
|
|
|
|
WPA_OBJS += $(SRC)/rsn_supp/wpa_ft.o
|
|
|
|
WPA_OBJS += $(SRC)/rsn_supp/wpa_ie.o
|
|
|
|
WPA_OBJS += $(SRC)/rsn_supp/tdls.o
|
|
|
|
WPA_OBJS += $(SRC)/rsn_supp/preauth.o
|
|
|
|
WPA_OBJS += $(SRC)/rsn_supp/pmksa_cache.o
|
|
|
|
WPA_OBJS += $(SRC)/eapol_supp/eapol_supp_sm.o
|
|
|
|
WPA_OBJS += $(SRC)/eap_common/eap_common.o
|
|
|
|
WPA_OBJS += $(SRC)/eap_peer/eap.o
|
|
|
|
WPA_OBJS += $(SRC)/eap_peer/eap_methods.o
|
|
|
|
WPA_OBJS += $(SRC)/drivers/driver_common.o
|
|
|
|
WPA_OBJS += $(SRC)/drivers/driver_none.o
|
|
|
|
WPA_OBJS += $(SRC)/drivers/drivers.o
|
|
|
|
WPA_OBJS += $(SRC)/l2_packet/l2_packet_none.o
|
|
|
|
|
|
|
|
_OBJS_VAR := WPA_OBJS
|
|
|
|
include ../src/objs.mk
|
|
|
|
|
|
|
|
_OBJS_VAR := WPA_LIBS
|
|
|
|
include ../src/objs.mk
|
|
|
|
|
|
|
|
_OBJS_VAR := ELIBS
|
|
|
|
include ../src/objs.mk
|
|
|
|
|
|
|
|
LIBS=$(SLIBS) $(DLIBS) $(WPA_LIBS) $(ELIBS)
|
|
|
|
|
|
|
|
test-bss: $(call BUILDOBJ,test-bss.o) $(WPA_OBJS) $(LIBS)
|
|
|
|
$(LDO) $(LDFLAGS) -o $@ $< $(LLIBS) $(WPA_CFLAGS) $(WPA_OBJS) $(LIBS)
|
|
|
|
|
2020-09-18 11:49:48 +02:00
|
|
|
run-tests: $(ALL)
|
2009-12-05 21:25:32 +01:00
|
|
|
./test-aes
|
2009-12-19 12:43:25 +01:00
|
|
|
./test-list
|
2009-12-05 21:11:50 +01:00
|
|
|
./test-md4
|
2009-12-05 20:14:08 +01:00
|
|
|
./test-milenage
|
2014-05-19 22:22:49 +02:00
|
|
|
./test-rsa-sig-ver
|
2009-12-05 21:25:32 +01:00
|
|
|
./test-sha1
|
|
|
|
./test-sha256
|
2023-11-28 02:50:07 +01:00
|
|
|
./test-bss
|
2009-12-05 21:25:32 +01:00
|
|
|
@echo
|
|
|
|
@echo All tests completed successfully.
|
2009-12-05 20:14:08 +01:00
|
|
|
|
2020-09-18 11:49:51 +02:00
|
|
|
clean: common-clean
|
2020-09-18 11:49:58 +02:00
|
|
|
rm -f *~
|
2009-12-06 17:10:52 +01:00
|
|
|
rm -f test_x509v3_nist.out.*
|
|
|
|
rm -f test_x509v3_nist2.out.*
|