Skip to content

Commit

Permalink
Build a corpus for client_initial and server_initial fuzz targets
Browse files Browse the repository at this point in the history
  • Loading branch information
larseggert committed Apr 18, 2024
1 parent 9a78b7f commit 5d55f1f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions neqo-transport/src/connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1508,6 +1508,16 @@ impl Connection {
d.tos(),
);

#[cfg(feature = "build-fuzzing-corpus")]
if packet.packet_type() == PacketType::Initial {
let target = if self.role == Role::Client {
"server_initial"
} else {
"client_initial"
};
neqo_common::write_item_to_fuzzing_corpus(target, &payload);
}

qlog::packet_received(&mut self.qlog, &packet, &payload);
let space = PacketNumberSpace::from(payload.packet_type());
if self.acks.get_mut(space).unwrap().is_duplicate(payload.pn()) {
Expand Down

0 comments on commit 5d55f1f

Please sign in to comment.