diff options
Diffstat (limited to '.travis/fuzz-linux-asan')
-rw-r--r-- | .travis/fuzz-linux-asan | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/.travis/fuzz-linux-asan b/.travis/fuzz-linux-asan new file mode 100644 index 0000000..0a0aebb --- /dev/null +++ b/.travis/fuzz-linux-asan | |||
@@ -0,0 +1,58 @@ | |||
1 | #!/bin/sh -eux | ||
2 | |||
3 | ${CC} --version | ||
4 | |||
5 | FAKEROOT=/fakeroot | ||
6 | sudo mkdir ${FAKEROOT} | ||
7 | sudo chmod 755 ${FAKEROOT} | ||
8 | |||
9 | # Build and install libcbor. | ||
10 | git clone git://github.com/pjk/libcbor | ||
11 | cd libcbor | ||
12 | patch -p0 < ../fuzz/README | ||
13 | mkdir build | ||
14 | cd build | ||
15 | cmake -DCMAKE_C_FLAGS_DEBUG="-g2 -fno-omit-frame-pointer" \ | ||
16 | -DCMAKE_C_COMPILER=clang -DCMAKE_BUILD_TYPE=Debug \ | ||
17 | -DCMAKE_INSTALL_PREFIX=${FAKEROOT} -DSANITIZE=ON \ | ||
18 | -DCMAKE_INSTALL_LIBDIR=lib .. | ||
19 | make | ||
20 | sudo make install | ||
21 | cd ../.. | ||
22 | |||
23 | # Build and install OpenSSL 1.1.1b. | ||
24 | git clone git://github.com/openssl/openssl | ||
25 | cd openssl | ||
26 | git checkout OpenSSL_1_1_1b | ||
27 | ./Configure linux-x86_64-clang enable-asan --prefix=${FAKEROOT} \ | ||
28 | --openssldir=${FAKEROOT}/openssl | ||
29 | make clean | ||
30 | make | ||
31 | sudo make install_sw | ||
32 | cd .. | ||
33 | |||
34 | # Build libfido2. | ||
35 | mkdir build | ||
36 | cd build | ||
37 | export PKG_CONFIG_PATH=/fakeroot/lib/pkgconfig | ||
38 | cmake -DFUZZ=1 -DLIBFUZZER=1 -DASAN=1 -DUBSAN=1 -DCMAKE_C_COMPILER=clang \ | ||
39 | -DCRYPTO_INCLUDE_DIRS=${FAKEROOT}/include \ | ||
40 | -DCRYPTO_LIBRARY_DIRS=${FAKEROOT}/lib \ | ||
41 | -DCBOR_INCLUDE_DIRS=${FAKEROOT}/include \ | ||
42 | -DCBOR_LIBRARY_DIRS=${FAKEROOT}/lib \ | ||
43 | -DCMAKE_BUILD_TYPE=Debug .. | ||
44 | make | ||
45 | |||
46 | # Fuzz with ASAN. | ||
47 | mkdir corpus | ||
48 | tar -C corpus -zxf ../fuzz/corpus.tgz | ||
49 | fuzz/fuzz_cred -use_value_profile=1 -reload=30 -print_pcs=1 \ | ||
50 | -print_funcs=30 -timeout=10 -max_len=17408 -runs=1 corpus/fuzz_cred | ||
51 | fuzz/fuzz_assert -use_value_profile=1 -reload=30 -print_pcs=1 \ | ||
52 | -print_funcs=30 -timeout=10 -max_len=17408 -runs=1 corpus/fuzz_assert | ||
53 | fuzz/fuzz_credman -use_value_profile=1 -reload=30 -print_pcs=1 \ | ||
54 | -print_funcs=30 -timeout=10 -max_len=17408 -runs=1 corpus/fuzz_credman | ||
55 | fuzz/fuzz_mgmt -use_value_profile=1 -reload=30 -print_pcs=1 \ | ||
56 | -print_funcs=30 -timeout=10 -max_len=17408 -runs=1 corpus/fuzz_mgmt | ||
57 | fuzz/fuzz_bio -use_value_profile=1 -reload=30 -print_pcs=1 \ | ||
58 | -print_funcs=30 -timeout=10 -max_len=17408 -runs=1 corpus/fuzz_bio | ||