INNER CODE UNIT · Rust
process_message
google/OpenSK · libraries/opensk/fuzz/fuzz_helper/src/lib.rs:121
fn process_message(data: &[u8], ctap: &mut Ctap<TestEnv>) {
let message = raw_to_message(data);
if let Some(hid_packet_iterator) = HidPacketIterator::new(message) {
let mut assembler_reply = MessageAssembler::default();
for pkt_request in hid_packet_iterator {
for pkt_reply in ctap.process_hid_packet(&pkt_request, Transport::MainHid) {
// Only checks for assembling crashes, not for semantics.
let (cid, processed_pkt) = CtapHid::<TestEnv>::process_single_packet(&pkt_reply);
let _ = assembler_reply.parse_packet(ctap.env(), cid, processed_pkt);
}
}
}
}
// Interprets the raw data as any ctap command (including the command byte) and
// invokes message splitting, packet processing at CTAP HID level and response assembling
// using an initialized and allocated channel.
pub fn process_ctap_any_type(data: &[u8]) -> arbitrary::Result<()> {