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
|
|
|
|
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
|
|
|
|
|
2009-12-05 20:39:41 +01:00
|
|
|
../src/utils/libutils.a:
|
|
|
|
$(MAKE) -C ../src/utils
|
2009-12-05 20:14:08 +01:00
|
|
|
|
2019-02-10 16:02:49 +01:00
|
|
|
../src/common/libcommon.a:
|
|
|
|
$(MAKE) -C ../src/common
|
|
|
|
|
2009-12-05 21:03:46 +01:00
|
|
|
../src/crypto/libcrypto.a:
|
|
|
|
$(MAKE) -C ../src/crypto
|
|
|
|
|
2009-12-06 15:45:36 +01:00
|
|
|
../src/tls/libtls.a:
|
|
|
|
$(MAKE) -C ../src/tls
|
|
|
|
|
2019-02-10 16:02:49 +01:00
|
|
|
../src/ap/libap.a:
|
|
|
|
$(MAKE) -C ../src/ap
|
|
|
|
|
|
|
|
../src/radius/libradius.a:
|
|
|
|
$(MAKE) -C ../src/radius
|
|
|
|
|
|
|
|
../src/l2_packet/libl2_packet.a:
|
|
|
|
$(MAKE) -C ../src/l2_packet
|
|
|
|
|
|
|
|
../src/wps/libwps.a:
|
|
|
|
$(MAKE) -C ../src/wps
|
|
|
|
|
|
|
|
../src/eap_peer/libeap_peer.a:
|
|
|
|
$(MAKE) -C ../src/eap_peer
|
|
|
|
|
|
|
|
../src/eap_server/libeap_server.a:
|
|
|
|
$(MAKE) -C ../src/eap_server
|
|
|
|
|
|
|
|
../src/eap_common/libeap_common.a:
|
|
|
|
$(MAKE) -C ../src/eap_common
|
|
|
|
|
|
|
|
../src/eapol_auth/libeapol_auth.a:
|
|
|
|
$(MAKE) -C ../src/eapol_auth
|
|
|
|
|
|
|
|
../src/eapol_supp/libeapol_supp.a:
|
|
|
|
$(MAKE) -C ../src/eapol_supp
|
|
|
|
|
|
|
|
../src/rsn_supp/librsn_supp.a:
|
|
|
|
$(MAKE) -C ../src/rsn_supp
|
|
|
|
|
2009-12-05 19:43:07 +01:00
|
|
|
|
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-eapol: $(call BUILDOBJ,test-eapol.o) $(LIBS)
|
2019-02-10 16:02:49 +01:00
|
|
|
$(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
|
|
|
|
|
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-json: $(call BUILDOBJ,test-json.o) $(LIBS)
|
2019-02-09 20:38:56 +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 *~
|
2019-02-10 16:02:49 +01:00
|
|
|
rm -f test-eapol
|
2012-01-01 18:09:18 +01:00
|
|
|
rm -f test-https
|
2019-02-09 20:38:56 +01:00
|
|
|
rm -f test-json
|
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.*
|