mirror of
https://github.com/trussed-dev/fido-authenticator.git
synced 2026-06-20 04:16:16 -07:00
46 lines
1.3 KiB
Rust
46 lines
1.3 KiB
Rust
#![no_main]
|
|
|
|
use ctap_types::{
|
|
authenticator::Request,
|
|
ctap1::Authenticator as _,
|
|
ctap2::{Authenticator as _, Response},
|
|
};
|
|
use fido_authenticator::{Authenticator, Config, Conforming};
|
|
use trussed::virt::StoreConfig;
|
|
use trussed_staging::virt;
|
|
|
|
use libfuzzer_sys::fuzz_target;
|
|
|
|
fuzz_target!(|requests: Vec<Request<'_>>| {
|
|
virt::with_client(StoreConfig::ram(), "fido", |client| {
|
|
let mut authenticator = Authenticator::new(
|
|
client,
|
|
Conforming {},
|
|
Config {
|
|
max_msg_size: 0,
|
|
skip_up_timeout: None,
|
|
max_resident_credential_count: None,
|
|
large_blobs: None,
|
|
nfc_transport: false,
|
|
ccid_transport: false,
|
|
firmware_version: Some(0.into()),
|
|
credential_id_version: None,
|
|
long_touch_for_reset: true,
|
|
fido2_up_timeout: None,
|
|
},
|
|
);
|
|
|
|
for request in requests {
|
|
match request {
|
|
Request::Ctap1(request) => {
|
|
authenticator.call_ctap1(&request).ok();
|
|
}
|
|
Request::Ctap2(request) => {
|
|
let mut response = Response::Reset;
|
|
authenticator.call_ctap2(&request, &mut response).ok();
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|