File: oss-fuzz.sh

package info (click to toggle)
libtpms 0.10.2-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 13,208 kB
  • sloc: ansic: 120,341; makefile: 829; sh: 336; cpp: 125
file content (27 lines) | stat: -rwxr-xr-x 632 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash

set -ex

export CC=${CC:-clang}
export CXX=${CXX:-clang++}
export WORK=${WORK:-$(pwd)}
export OUT=${OUT:-$(pwd)/out}
CFLAGS="${CFLAGS} -fno-sanitize=bounds"  # due to casts to Crypt_Int*

mkdir -p $OUT

build=$WORK/build
rm -rf $build
mkdir -p $build

export LIBTPMS=$(pwd)
autoreconf -vfi

cd $build
$LIBTPMS/configure --disable-shared --enable-static --with-openssl --with-tpm2
make -j$(nproc) && make -C tests fuzz

zip -jqr $OUT/fuzz_seed_corpus.zip "$LIBTPMS/tests/corpus-execute-command"

find $build -type f -executable -name "fuzz*" -exec mv {} $OUT \;
find $build -type f -name "*.options" -exec mv {} $OUT \;