1
1
mirror of https://github.com/henrydcase/pqc.git synced 2024-11-22 23:48:58 +00:00

add address sanitizer

This commit is contained in:
Matthias J. Kannwischer 2019-01-22 17:22:18 +01:00
parent 6e043fbdfb
commit 6fcb3618c4
2 changed files with 30 additions and 3 deletions

View File

@ -33,6 +33,18 @@ run-functest: bin/functest_$(subst /,_,$(SCHEME))
run-valgrind: bin/functest_$(subst /,_,$(SCHEME)) run-valgrind: bin/functest_$(subst /,_,$(SCHEME))
valgrind --leak-check=full --error-exitcode=1 $< valgrind --leak-check=full --error-exitcode=1 $<
bin/sanitizer_$(subst /,_,$(SCHEME)): test/$(dir $(SCHEME))functest.c $(wildcard $(SCHEME)/clean/*.c) $(wildcard $(SCHEME)/clean/*.h) | require_scheme
mkdir -p bin
$(CC) $(CFLAGS) -fsanitize=address \
-iquote "./common/" \
-iquote "$(SCHEME)/clean/" \
-o bin/sanitizer_$(subst /,_,$(SCHEME)) \
common/*.c \
$(SCHEME)/clean/*.c \
$<
.PHONY: sanitizer
sanitizer: bin/sanitizer_$(subst /,_,$(SCHEME))
bin/testvectors_$(subst /,_,$(SCHEME)): test/$(dir $(SCHEME))testvectors.c $(wildcard $(SCHEME)/clean/*.c) $(wildcard $(SCHEME)/clean/*.h) | require_scheme bin/testvectors_$(subst /,_,$(SCHEME)): test/$(dir $(SCHEME))testvectors.c $(wildcard $(SCHEME)/clean/*.c) $(wildcard $(SCHEME)/clean/*.h) | require_scheme
mkdir -p bin mkdir -p bin
@ -101,6 +113,7 @@ help:
@echo "make run-functest-all Run all functests" @echo "make run-functest-all Run all functests"
@echo "make run-testvectors SCHEME=scheme Run testvector checks for SCHEME" @echo "make run-testvectors SCHEME=scheme Run testvector checks for SCHEME"
@echo "make run-testvectors-all Run all testvector checks" @echo "make run-testvectors-all Run all testvector checks"
@echo "make run-sanitizer-all Run address sanitizer for all schemes"
@echo "make run-symbol-namespace SCHEME=scheme Run symbol namespace checks for SCHEME" @echo "make run-symbol-namespace SCHEME=scheme Run symbol namespace checks for SCHEME"
@echo "make run-symbol-namespace-all Run all symbol namespace checks" @echo "make run-symbol-namespace-all Run all symbol namespace checks"
@echo "make run-valgrind SCHEME=scheme Run valgrind checks for SCHEME" @echo "make run-valgrind SCHEME=scheme Run valgrind checks for SCHEME"
@ -119,6 +132,12 @@ functest-all:
$(MAKE) functest SCHEME=$$scheme || exit 1; \ $(MAKE) functest SCHEME=$$scheme || exit 1; \
done done
.PHONY: sanitizer-all
sanitizer-all:
@for scheme in $(ALL_SCHEMES); do \
$(MAKE) sanitizer SCHEME=$$scheme || exit 1; \
done
.PHONY: run-valgrind-all .PHONY: run-valgrind-all
run-valgrind-all: run-valgrind-all:
@for scheme in $(ALL_SCHEMES); do \ @for scheme in $(ALL_SCHEMES); do \
@ -153,8 +172,16 @@ run-functest-all: functest-all
done done
@echo Tests completed @echo Tests completed
.PHONY: run-sanitizer-all
run-sanitizer-all: sanitizer-all
@for sanitizer in bin/sanitizer_* ; do \
echo ./$$sanitizer ; \
./$$sanitizer || exit 1 ;\
done
@echo Tests completed
.PHONY: test-all .PHONY: test-all
test-all: run-functest-all run-valgrind-all run-testvectors-all run-symbol-namespace-all test-all: run-functest-all run-valgrind-all run-sanitizer-all run-testvectors-all run-symbol-namespace-all
.PHONY: tidy-all .PHONY: tidy-all
tidy-all: tidy-all:

View File

@ -33,8 +33,8 @@ _The checking of items on this list is still being developed. Checked items shou
* [x] Consistent test vectors across runs * [x] Consistent test vectors across runs
* [ ] Consistent test vectors on big-endian and little-endian machines * [ ] Consistent test vectors on big-endian and little-endian machines
* [ ] Consistent test vectors on 32-bit and 64-bit machines * [ ] Consistent test vectors on 32-bit and 64-bit machines
* [ ] No errors/warnings reported by valgrind * [X] No errors/warnings reported by valgrind
* [ ] No errors/warnings reported by address sanitizer * [X] No errors/warnings reported by address sanitizer
* [ ] Only dependencies: * [ ] Only dependencies:
* [x] `fips202.c` * [x] `fips202.c`
* [x] `sha2.c` * [x] `sha2.c`