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-04-05 18:38:41 +02:00
|
|
|
test-sha256 test-aes test-asn1 test-x509v3 test-list test-rc4
|
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 \
|
2019-02-10 16:02:49 +01:00
|
|
|
../src/common/libcommon.a \
|
|
|
|
../src/ap/libap.a \
|
|
|
|
../src/eapol_auth/libeapol_auth.a \
|
|
|
|
../src/eapol_supp/libeapol_supp.a \
|
|
|
|
../src/eap_peer/libeap_peer.a \
|
|
|
|
../src/eap_server/libeap_server.a \
|
|
|
|
../src/eap_common/libeap_common.a \
|
|
|
|
../src/radius/libradius.a \
|
|
|
|
../src/l2_packet/libl2_packet.a \
|
|
|
|
../src/wps/libwps.a \
|
|
|
|
../src/rsn_supp/librsn_supp.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-asn1: $(call BUILDOBJ,test-asn1.o) $(LIBS)
|
2014-01-03 16:41:16 +01:00
|
|
|
$(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
|
2009-12-06 15:45:36 +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-tls: $(call BUILDOBJ,test-tls.o) $(LIBS)
|
2019-02-09 20:07:24 +01:00
|
|
|
$(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
|
|
|
|
|
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
|
|
|
|
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
|
|
|
|
@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 *~
|
2012-01-01 18:09:18 +01:00
|
|
|
rm -f test-https
|
2019-02-09 20:07:24 +01:00
|
|
|
rm -f test-tls
|
2009-12-06 17:10:52 +01:00
|
|
|
rm -f test_x509v3_nist.out.*
|
|
|
|
rm -f test_x509v3_nist2.out.*
|