| # Copyright 2018 The Chromium Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//testing/libfuzzer/fuzzer_test.gni") |
| import("//third_party/protobuf/proto_library.gni") |
| |
| # To download the corpus for local fuzzing use: |
| # gsutil -m rsync \ |
| # gs://clusterfuzz-corpus/libfuzzer/zucchini_disassembler_win32_fuzzer \ |
| # components/zucchini/fuzzing/testdata/disassembler_win32_fuzzer |
| fuzzer_test("zucchini_disassembler_win32_fuzzer") { |
| sources = [ |
| "disassembler_win32_fuzzer.cc", |
| ] |
| deps = [ |
| "//base", |
| "//components/zucchini:zucchini_lib", |
| ] |
| } |
| |
| fuzzer_test("zucchini_patch_fuzzer") { |
| sources = [ |
| "patch_fuzzer.cc", |
| ] |
| deps = [ |
| "//base", |
| "//components/zucchini:zucchini_lib", |
| ] |
| seed_corpus = "testdata/patch_fuzzer" |
| } |
| |
| proto_library("zucchini_file_pair_proto") { |
| sources = [ |
| "file_pair.proto", |
| ] |
| } |
| |
| # Ensure protoc is available. |
| # Disabled on Windows due to crbug/844826. |
| if (current_toolchain == host_toolchain && !is_win) { |
| # Raw Apply Fuzzer: |
| action("zucchini_raw_apply_seed") { |
| script = "generate_fuzzer_data.py" |
| |
| args = [ |
| "--raw", |
| "old_eventlog_provider.dll", # <old_file> |
| "new_eventlog_provider.dll", # <new_file> |
| "eventlog_provider.patch", # <patch_file> (temporary) |
| |
| # <output_dir> |
| rebase_path("$target_gen_dir/testdata/raw_apply_fuzzer", root_build_dir), |
| ] |
| |
| # Files depended upon. |
| sources = [ |
| "create_seed_file_pair.py", |
| "testdata/new_eventlog_provider.dll", |
| "testdata/old_eventlog_provider.dll", |
| ] |
| |
| # Outputs: necessary for validation. |
| outputs = [ |
| "$target_gen_dir/testdata/raw_apply_fuzzer/seed_proto.bin", |
| ] |
| deps = [ |
| "//components/zucchini:zucchini", |
| "//third_party/protobuf:protoc", |
| ] |
| } |
| |
| fuzzer_test("zucchini_raw_apply_fuzzer") { |
| sources = [ |
| "raw_gen_fuzzer.cc", |
| ] |
| deps = [ |
| ":zucchini_file_pair_proto", |
| "//base", |
| "//components/zucchini:zucchini_lib", |
| "//third_party/libprotobuf-mutator", |
| ] |
| seed_corpus = "$target_gen_dir/testdata/raw_apply_fuzzer" |
| seed_corpus_deps = [ ":zucchini_raw_apply_seed" ] |
| } |
| |
| # Raw Gen Fuzzer: |
| fuzzer_test("zucchini_raw_gen_fuzzer") { |
| sources = [ |
| "raw_gen_fuzzer.cc", |
| ] |
| deps = [ |
| ":zucchini_file_pair_proto", |
| "//base", |
| "//components/zucchini:zucchini_lib", |
| "//third_party/libprotobuf-mutator", |
| ] |
| seed_corpus = "testdata/raw_gen_fuzzer" |
| } |
| } |