diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index d9e4216..9b1a37a 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -10,17 +10,24 @@ cargo-fuzz = true [dependencies] libfuzzer-sys = { version = "0.3"} -arrayref = "0.3.6" -libtock_drivers = { path = "../third_party/libtock-drivers" } -crypto = { path = "../libraries/crypto", features = ['std'] } -cbor = { path = "../libraries/cbor", features = ['std'] } -ctap2 = { path = "..", features = ['std', 'ram_storage'] } -lang_items = { path = "../third_party/lang-items", features = ['std'] } +fuzz_helper = { path = "fuzz_helper" } # Prevent this from interfering with workspaces [workspace] members = ["."] +[[bin]] +name = "fuzz_target_process_ctap1" +path = "fuzz_targets/fuzz_target_process_ctap1.rs" +test = false +doc = false + +[[bin]] +name = "fuzz_target_process_ctap2_make_credential" +path = "fuzz_targets/fuzz_target_process_ctap2_make_credential.rs" +test = false +doc = false + [[bin]] name = "fuzz_target_split_assemble" path = "fuzz_targets/fuzz_target_split_assemble.rs" diff --git a/fuzz/fuzz_targets/fuzz_target_process_ctap1.rs b/fuzz/fuzz_targets/fuzz_target_process_ctap1.rs new file mode 100644 index 0000000..63a27ea --- /dev/null +++ b/fuzz/fuzz_targets/fuzz_target_process_ctap1.rs @@ -0,0 +1,9 @@ +#![no_main] + +use fuzz_helper::{process_input, InputType}; +use libfuzzer_sys::fuzz_target; + +// Fuzz inputs as CTAP1 U2F raw message. +fuzz_target!(|data: &[u8]| { + process_input(data, InputType::Ctap1); +}); diff --git a/fuzz/fuzz_targets/fuzz_target_process_ctap2_make_credential.rs b/fuzz/fuzz_targets/fuzz_target_process_ctap2_make_credential.rs new file mode 100644 index 0000000..ae96924 --- /dev/null +++ b/fuzz/fuzz_targets/fuzz_target_process_ctap2_make_credential.rs @@ -0,0 +1,9 @@ +#![no_main] + +use fuzz_helper::{process_input, InputType}; +use libfuzzer_sys::fuzz_target; + +// Fuzz inputs as CTAP2 make credential command parameters encoded in cbor. +fuzz_target!(|data: &[u8]| { + process_input(data, InputType::CborMakeCredentialParameter); +});