Added more fuzz targets

This commit is contained in:
mingxguo27
2020-09-25 19:05:07 +00:00
parent 3a42ab15ae
commit e8e52ff58a
3 changed files with 31 additions and 6 deletions

View File

@@ -10,17 +10,24 @@ cargo-fuzz = true
[dependencies] [dependencies]
libfuzzer-sys = { version = "0.3"} libfuzzer-sys = { version = "0.3"}
arrayref = "0.3.6" fuzz_helper = { path = "fuzz_helper" }
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'] }
# Prevent this from interfering with workspaces # Prevent this from interfering with workspaces
[workspace] [workspace]
members = ["."] 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]] [[bin]]
name = "fuzz_target_split_assemble" name = "fuzz_target_split_assemble"
path = "fuzz_targets/fuzz_target_split_assemble.rs" path = "fuzz_targets/fuzz_target_split_assemble.rs"

View File

@@ -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);
});

View File

@@ -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);
});