Resolved PR comments and added more fuzz targets.

This commit is contained in:
mingxguo27
2020-09-29 16:30:41 +00:00
parent 8231c89207
commit f79a659e69
8 changed files with 110 additions and 29 deletions

View File

@@ -1,9 +1,11 @@
#![no_main]
use fuzz_helper::{process_input, InputType};
use fuzz_helper::{process_ctap_specific_type, InputType};
use libfuzzer_sys::fuzz_target;
// Fuzz inputs as CTAP1 U2F raw message.
// Fuzz inputs as CTAP1 U2F raw messages.
// For a more generic fuzz target including all CTAP commands, you can use
// fuzz_target_process_ctap_command.
fuzz_target!(|data: &[u8]| {
process_input(data, InputType::Ctap1);
process_ctap_specific_type(data, InputType::Ctap1);
});

View File

@@ -0,0 +1,11 @@
#![no_main]
use fuzz_helper::{process_ctap_specific_type, InputType};
use libfuzzer_sys::fuzz_target;
// Fuzz inputs as CTAP2 client pin command parameters encoded in cbor.
// For a more generic fuzz target including all CTAP commands, you can use
// fuzz_target_process_ctap_command.
fuzz_target!(|data: &[u8]| {
process_ctap_specific_type(data, InputType::CborClientPinParameter);
});

View File

@@ -0,0 +1,11 @@
#![no_main]
use fuzz_helper::{process_ctap_specific_type, InputType};
use libfuzzer_sys::fuzz_target;
// Fuzz inputs as CTAP2 get assertion command parameters encoded in cbor.
// For a more generic fuzz target including all CTAP commands, you can use
// fuzz_target_process_ctap_command.
fuzz_target!(|data: &[u8]| {
process_ctap_specific_type(data, InputType::CborGetAssertionParameter);
});

View File

@@ -1,9 +1,11 @@
#![no_main]
use fuzz_helper::{process_input, InputType};
use fuzz_helper::{process_ctap_specific_type, InputType};
use libfuzzer_sys::fuzz_target;
// Fuzz inputs as CTAP2 make credential command parameters encoded in cbor.
// For a more generic fuzz target including all CTAP commands, you can use
// fuzz_target_process_ctap_command.
fuzz_target!(|data: &[u8]| {
process_input(data, InputType::CborMakeCredentialParameter);
process_ctap_specific_type(data, InputType::CborMakeCredentialParameter);
});

View File

@@ -0,0 +1,9 @@
#![no_main]
use fuzz_helper::process_ctap_any_type;
use libfuzzer_sys::fuzz_target;
// Generically fuzz inputs as CTAP commands.
fuzz_target!(|data: &[u8]| {
process_ctap_any_type(data);
});

View File

@@ -1,9 +1,9 @@
#![no_main]
use fuzz_helper::split_assemble;
use fuzz_helper::split_assemble_hid_packets;
use libfuzzer_sys::fuzz_target;
// Fuzzing HID packets splitting and assembling functions.
fuzz_target!(|data: &[u8]| {
split_assemble(data);
split_assemble_hid_packets(data);
});