diff --git a/projects/opensk/Dockerfile b/projects/opensk/Dockerfile index d8a9e5b3b..58191f4a8 100644 --- a/projects/opensk/Dockerfile +++ b/projects/opensk/Dockerfile @@ -16,7 +16,7 @@ FROM gcr.io/oss-fuzz-base/base-builder RUN apt-get update && apt-get install -y make autoconf automake libtool curl cmake python llvm-dev libclang-dev clang uuid-runtime -RUN git clone --recurse-submodules https://github.com/google/OpenSK && \ +RUN git clone --depth 1 https://github.com/google/OpenSK && \ cd OpenSK && \ ./setup.sh && \ ./fuzzing_setup.sh diff --git a/projects/opensk/build.sh b/projects/opensk/build.sh index 6ca211b54..4d2520946 100755 --- a/projects/opensk/build.sh +++ b/projects/opensk/build.sh @@ -14,19 +14,27 @@ # limitations under the License. # ################################################################################ -if [ "$SANITIZER" = "coverage" ] -then - exit 0 -fi + +FUZZ_TARGET_OUTPUT_DIR=fuzz/target/x86_64-unknown-linux-gnu/release + +build_and_copy() { + pushd "$1" + cargo +nightly fuzz build --release --debug-assertions + for f in fuzz/fuzz_targets/*.rs + do + cp ${FUZZ_TARGET_OUTPUT_DIR}/$(basename ${f%.*}) $OUT/ + done + popd +} cd OpenSK -cargo fuzz build -# Copy fuzzers to out -cp ./fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_target_process_ctap1 $OUT/ -cp ./fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_target_process_ctap2_client_pin $OUT/ -cp ./fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_target_process_ctap2_get_assertion $OUT/ -cp ./fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_target_process_ctap2_make_credential $OUT/ -cp ./fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_target_process_ctap_command $OUT/ -cp ./fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_target_split_assemble $OUT/ -cp ./fuzz/target/x86_64-unknown-linux-gnu/release/fuzz_target_process_ctap1 $OUT/ +# Main OpenSK fuzzing targets +build_and_copy "." + +# persistent storage library +build_and_copy libraries/persistent_store + +# CBOR crate +build_and_copy libraries/cbor +