1 // This file is Copyright its original authors, visible in version control
4 // This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE
5 // or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
7 // You may not use this file except in accordance with one or both of these
10 #![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
13 compile_error!("Fuzz targets need cfg=fuzzing");
15 extern crate dnssec_prover;
16 use dnssec_prover::query::fuzz_proof_builder;
18 #[cfg(feature = "afl")]
19 #[macro_use] extern crate afl;
20 #[cfg(feature = "afl")]
23 fuzz_proof_builder(data);
27 #[cfg(feature = "honggfuzz")]
28 #[macro_use] extern crate honggfuzz;
29 #[cfg(feature = "honggfuzz")]
33 fuzz_proof_builder(data);
38 #[cfg(feature = "libfuzzer_fuzz")]
39 #[macro_use] extern crate libfuzzer_sys;
40 #[cfg(feature = "libfuzzer_fuzz")]
41 fuzz_target!(|data: &[u8]| {
42 fuzz_proof_builder(data);
45 #[cfg(feature = "stdin_fuzz")]
49 let mut data = Vec::with_capacity(8192);
50 std::io::stdin().read_to_end(&mut data).unwrap();
51 fuzz_proof_builder(&data);
59 if let Ok(tests) = fs::read_dir("test_cases/parse_response") {
61 let mut data: Vec<u8> = Vec::new();
62 let path = test.unwrap().path();
63 fs::File::open(&path).unwrap().read_to_end(&mut data).unwrap();
65 fuzz_proof_builder(&data);