Commit Graph

5 Commits

Author SHA1 Message Date
Stefan Berger
e56316617c tests: fuzz: Store initialized permall state blob
We have to store the permall state blob once it has been initialized since
otherwise some fields are not having proper values in the internal state.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-07-22 22:23:16 -04:00
Stefan Berger
a6c9836af5 tests: fuzz: Have state suspended and resumed after every fuzz step
Have the TPM 2's state suspended and resumed at every step to
ensure that we can marshal and unmarshal it.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-07-22 17:37:00 -04:00
Stefan Berger
70ebecdf6a tests: fuzz: Register callbacks to avoid creating NVChip file
Register callbacks so that we don't create the NVChip file.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-07-22 17:37:00 -04:00
Stefan Berger
a59db1faea tests: fuzz: Call die() when an error from an API call was returned
Call die() causing as assert() to be triggered if an API call
returned an unexpected failure result.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-07-22 17:37:00 -04:00
Marc-André Lureau
b214dabfc8 fuzz: better oss-fuzz integration
There were a few issues with the oss-fuzz integration from commit
8373f09854 ("build-sys: add oss-fuzz
support").

When building on OSS-Fuzz, the projects should use the provided CFLAGS
and CXXFLAGS and don't append any extra sanitization / fuzzing flags.

$LIB_FUZZING_ENGINE is defined to set the library to link to, and it
is a c++ library, so we should build fuzzer with c++...

Now --enable-fuzzer is only used for -fsanitize=fuzzer.

Add a tests/fuzz-main.c as fallback, to run the corpus on other builds.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2019-04-01 11:22:03 -04:00