2020-09-18 05:49:48 -04:00
|
|
|
ALL=test-base64 test-md4 test-milenage \
|
2014-05-19 16:22:49 -04:00
|
|
|
test-rsa-sig-ver \
|
2012-08-07 06:30:13 -04:00
|
|
|
test-sha1 \
|
2020-04-05 12:38:41 -04:00
|
|
|
test-sha256 test-aes test-asn1 test-x509v3 test-list test-rc4
|
2009-12-05 13:43:07 -05:00
|
|
|
|
2020-09-18 05:49:48 -04:00
|
|
|
include ../src/build.rules
|
2009-12-05 13:43:07 -05:00
|
|
|
|
2019-02-24 11:52:54 -05: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 14:07:24 -05:00
|
|
|
ifdef TEST_FUZZ
|
|
|
|
CFLAGS += -DCONFIG_NO_RANDOM_POOL
|
|
|
|
CFLAGS += -DTEST_FUZZ
|
|
|
|
endif
|
|
|
|
|
2019-02-10 10:02:49 -05:00
|
|
|
CFLAGS += -DCONFIG_IEEE80211R_AP
|
|
|
|
CFLAGS += -DCONFIG_IEEE80211R
|
|
|
|
CFLAGS += -DCONFIG_TDLS
|
|
|
|
|
2009-12-05 13:43:07 -05:00
|
|
|
CFLAGS += -I../src
|
2009-12-05 14:14:08 -05:00
|
|
|
CFLAGS += -I../src/utils
|
2009-12-05 13:43:07 -05:00
|
|
|
|
2009-12-06 10:18:28 -05:00
|
|
|
SLIBS = ../src/utils/libutils.a
|
|
|
|
|
|
|
|
DLIBS = ../src/crypto/libcrypto.a \
|
2019-02-10 10:02:49 -05: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 09:45:36 -05:00
|
|
|
../src/tls/libtls.a
|
2009-12-05 13:43:07 -05:00
|
|
|
|
2020-10-11 03:58:58 -04: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 10:18:28 -05:00
|
|
|
LIBS = $(SLIBS) $(DLIBS)
|
|
|
|
LLIBS = -Wl,--start-group $(DLIBS) -Wl,--end-group $(SLIBS)
|
|
|
|
|
2014-01-03 10:41:16 -05:00
|
|
|
# glibc < 2.17 needs -lrt for clock_gettime()
|
|
|
|
LLIBS += -lrt
|
|
|
|
|
2020-09-18 05:49:58 -04:00
|
|
|
test-aes: $(call BUILDOBJ,test-aes.o) $(LIBS)
|
2012-09-08 17:25:54 -04:00
|
|
|
$(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
|
2009-12-05 15:25:32 -05:00
|
|
|
|
2020-09-18 05:49:58 -04:00
|
|
|
test-asn1: $(call BUILDOBJ,test-asn1.o) $(LIBS)
|
2014-01-03 10:41:16 -05:00
|
|
|
$(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
|
2009-12-06 09:45:36 -05:00
|
|
|
|
2020-09-18 05:49:58 -04:00
|
|
|
test-base64: $(call BUILDOBJ,test-base64.o) $(LIBS)
|
2014-01-03 10:41:16 -05:00
|
|
|
$(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
|
2009-12-05 13:43:07 -05:00
|
|
|
|
2020-09-18 05:49:58 -04:00
|
|
|
test-eapol: $(call BUILDOBJ,test-eapol.o) $(LIBS)
|
2019-02-10 10:02:49 -05:00
|
|
|
$(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
|
|
|
|
|
2020-09-18 05:49:58 -04:00
|
|
|
test-https: $(call BUILDOBJ,test-https.o) $(LIBS)
|
2019-02-09 10:05:36 -05:00
|
|
|
$(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
|
|
|
|
|
2020-09-18 05:49:58 -04:00
|
|
|
test-https_server: $(call BUILDOBJ,test-https_server.o) $(LIBS)
|
2011-11-13 03:49:27 -05:00
|
|
|
$(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
|
|
|
|
|
2020-09-18 05:49:58 -04:00
|
|
|
test-list: $(call BUILDOBJ,test-list.o) $(LIBS)
|
2014-01-03 10:41:16 -05:00
|
|
|
$(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
|
2009-12-19 06:43:25 -05:00
|
|
|
|
2020-09-18 05:49:58 -04:00
|
|
|
test-md4: $(call BUILDOBJ,test-md4.o) $(LIBS)
|
2014-01-03 10:41:16 -05:00
|
|
|
$(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
|
2009-12-05 14:14:08 -05:00
|
|
|
|
2020-09-18 05:49:58 -04:00
|
|
|
test-milenage: $(call BUILDOBJ,test-milenage.o) $(LIBS)
|
2014-01-03 10:41:16 -05:00
|
|
|
$(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
|
2009-12-05 14:14:08 -05:00
|
|
|
|
2020-09-18 05:49:58 -04:00
|
|
|
test-rc4: $(call BUILDOBJ,test-rc4.o) $(LIBS)
|
2014-01-03 10:41:16 -05:00
|
|
|
$(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
|
2011-11-24 13:54:20 -05:00
|
|
|
|
2020-09-18 05:49:58 -04:00
|
|
|
test-rsa-sig-ver: $(call BUILDOBJ,test-rsa-sig-ver.o) $(LIBS)
|
2014-05-19 16:22:49 -04:00
|
|
|
$(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
|
|
|
|
|
2020-09-18 05:49:58 -04:00
|
|
|
test-sha1: $(call BUILDOBJ,test-sha1.o) $(LIBS)
|
2014-01-03 10:41:16 -05:00
|
|
|
$(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
|
2009-12-05 15:25:32 -05:00
|
|
|
|
2020-09-18 05:49:58 -04:00
|
|
|
test-sha256: $(call BUILDOBJ,test-sha256.o) $(LIBS)
|
2014-01-03 10:41:16 -05:00
|
|
|
$(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
|
2009-12-05 15:25:32 -05:00
|
|
|
|
2020-09-18 05:49:58 -04:00
|
|
|
test-tls: $(call BUILDOBJ,test-tls.o) $(LIBS)
|
2019-02-09 14:07:24 -05:00
|
|
|
$(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
|
|
|
|
|
2020-09-18 05:49:58 -04:00
|
|
|
test-x509v3: $(call BUILDOBJ,test-x509v3.o) $(LIBS)
|
2009-12-06 11:10:52 -05:00
|
|
|
$(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
|
|
|
|
|
2009-12-05 14:14:08 -05:00
|
|
|
|
2020-09-18 05:49:48 -04:00
|
|
|
run-tests: $(ALL)
|
2009-12-05 15:25:32 -05:00
|
|
|
./test-aes
|
2009-12-19 06:43:25 -05:00
|
|
|
./test-list
|
2009-12-05 15:11:50 -05:00
|
|
|
./test-md4
|
2009-12-05 14:14:08 -05:00
|
|
|
./test-milenage
|
2014-05-19 16:22:49 -04:00
|
|
|
./test-rsa-sig-ver
|
2009-12-05 15:25:32 -05:00
|
|
|
./test-sha1
|
|
|
|
./test-sha256
|
|
|
|
@echo
|
|
|
|
@echo All tests completed successfully.
|
2009-12-05 14:14:08 -05:00
|
|
|
|
2020-09-18 05:49:51 -04:00
|
|
|
clean: common-clean
|
2020-09-18 05:49:58 -04:00
|
|
|
rm -f *~
|
2019-02-10 10:02:49 -05:00
|
|
|
rm -f test-eapol
|
2012-01-01 12:09:18 -05:00
|
|
|
rm -f test-https
|
2019-02-09 14:07:24 -05:00
|
|
|
rm -f test-tls
|
2009-12-06 11:10:52 -05:00
|
|
|
rm -f test_x509v3_nist.out.*
|
|
|
|
rm -f test_x509v3_nist2.out.*
|