Fix project OpenSK (#6146)

Code coverage was disabled, making the overall workflow failing.
Also adds all the fuzzing targets the project provides.
This commit is contained in:
Jean-Michel Picod 2021-08-02 11:56:16 +02:00 committed by GitHub
parent 290344bc6a
commit 523c214b5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 14 deletions

View File

@ -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

View File

@ -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