Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-src
Path: blob/main/crypto/krb5/src/tests/fuzzing/oss-fuzz.sh
34907 views
1
#!/bin/bash -eu
2
3
# This script plays the role of build.sh in OSS-Fuzz. If only minor
4
# changes are required such as changing the fuzzing targets, a PR in
5
# the OSS-Fuzz repository is not needed and they can be done here.
6
7
# Compile krb5 for oss-fuzz.
8
pushd src/
9
autoreconf
10
./configure CFLAGS="-fcommon $CFLAGS" CXXFLAGS="-fcommon $CXXFLAGS" \
11
--enable-static --disable-shared --enable-ossfuzz
12
make
13
popd
14
15
# Copy fuzz targets and seed corpus to $OUT.
16
pushd src/tests/fuzzing
17
18
fuzzers=("fuzz_aes" "fuzz_asn" "fuzz_attrset" "fuzz_chpw" "fuzz_crypto"
19
"fuzz_des" "fuzz_gss" "fuzz_json" "fuzz_kdc" "fuzz_krad" "fuzz_krb"
20
"fuzz_krb5_ticket" "fuzz_marshal_cred" "fuzz_marshal_princ"
21
"fuzz_ndr" "fuzz_oid" "fuzz_pac" "fuzz_profile" "fuzz_util")
22
23
for fuzzer in "${fuzzers[@]}"; do
24
cp "$fuzzer" "$OUT/$fuzzer"
25
zip -r "${OUT}/${fuzzer}_seed_corpus.zip" "${fuzzer}_seed_corpus"
26
done
27
28
popd
29
30