Skip to content

Commit

Permalink
Merge pull request #10 from epi052/add-stop-fuzzer-action
Browse files Browse the repository at this point in the history
added action to stop fuzzing
  • Loading branch information
epi052 authored Oct 10, 2022
2 parents 1f5bc62 + 5e7500b commit d8f8042
Show file tree
Hide file tree
Showing 8 changed files with 777 additions and 72 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "feroxfuzz"
version = "0.1.0-rc.0"
version = "1.0.0-rc.1"
edition = "2021"
authors = ["Ben 'epi' Risher (@epi052)"]
license = "Apache-2.0"
Expand Down
10 changes: 9 additions & 1 deletion src/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,13 @@ pub enum Action {
/// resulting `Action` will still be passed to any configured
/// [`Processor`]s.
AddToCorpus(&'static str, FlowControl),

/// break out of the current fuzz loop; no more iterations other than
/// what's already in flight will be performed
StopFuzzing,
}

/// analogous to the [`Action::Keep`] and [`Action::Discard`] variants
/// analogous to the [`Action::Keep`], [`Action::Discard`], and [`Action::StopFuzzing`] variants
///
/// used when the [`Action`] isn't a flow control directive itself
#[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Debug)]
Expand All @@ -61,4 +65,8 @@ pub enum FlowControl {
/// when used in a pre-send context, ignore the current [`Request`], if
/// used in a post-send context, ignore the current [`Response`]
Discard,

/// break out of the current fuzz loop; no more iterations other than
/// what's already in flight will be performed
StopFuzzing,
}
8 changes: 8 additions & 0 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,14 @@ pub enum FeroxFuzzError {
/// async fuzz_once loop.
#[error("Discarded request based on user-provided criteria")]
DiscardedRequest,

/// Represents a recommended [`Action::StopFuzzing`] during asynchronous fuzzing
///
/// Note: this is only used because of how the async fuzz_once loop
/// is implemented. It is not intended to be used outside of the
/// async fuzz_once loop.
#[error("Stopped fuzzing based on user-provided criteria")]
FuzzingStopped,
}

/// Used to differentiate between different types of errors that occur when making requests.
Expand Down
Loading

0 comments on commit d8f8042

Please sign in to comment.