//! Fuzzes the decoder against arbitrary datagrams — the exact input an open UDP //! port receives from the internet. //! //! ```sh //! cargo +nightly fuzz run decode //! ``` //! //! Note the deliberate limitation: without the key, almost nothing here gets //! past the AEAD, so this target mostly exercises `Header::peek` and the //! ChaCha20-Poly1305 layer. The payload decoders — where the interesting //! structural parsing lives — are reached by the `decode_payload` target //! instead. Fuzzing only this one would give a comforting but nearly meaningless //! coverage number. #![no_main] use libfuzzer_sys::fuzz_target; /// Fixed key: a fuzzer cannot forge a tag either way, so varying it would only /// waste the corpus. const KEY: [u8; 32] = [0x11; 32]; fuzz_target!(|data: &[u8]| { let _ = otproto::Header::peek(data); let _ = otproto::open_message(&KEY, data); });