summaryrefslogtreecommitdiff
path: root/src/config/mod.rs
diff options
context:
space:
mode:
authorAaron Hill <aa1ronham@gmail.com>2018-10-14 20:10:10 -0400
committerAaron Hill <aa1ronham@gmail.com>2018-10-17 21:19:10 -0400
commit204cb428b38c119922ed596f27b3f36a6b33366f (patch)
treea5a8f5706385b2e0508dd4d97b5a9ff43edc58f7 /src/config/mod.rs
parent5e8443be7324cb1e0e93a2d0c06791c9e180ec55 (diff)
downloadroughenough-204cb428b38c119922ed596f27b3f36a6b33366f.zip
Add fuzzing config
Diffstat (limited to 'src/config/mod.rs')
-rw-r--r--src/config/mod.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/config/mod.rs b/src/config/mod.rs
index f05578b..b70bbd5 100644
--- a/src/config/mod.rs
+++ b/src/config/mod.rs
@@ -112,6 +112,21 @@ pub fn make_config(arg: &str) -> Result<Box<ServerConfig>, Error> {
}
}
+/// Creates a config suitable for fuzzing a server instance
+/// This is intended to create a minimal useable config
+/// that allows a server to respond to requests.
+#[cfg(fuzzing)]
+pub fn make_fuzzing_config(port: u16) -> Box<ServerConfig> {
+ return Box(EnvironmentConfig {
+ port,
+ interface: "127.0.0.1".to_string(),
+ seed: hex::decode("a32049da0ffde0ded92ce10a0230d35fe615ec8461c14986baa63fe3b3bac3db").unwrap(),
+ batch_size: DEFAULT_BATCH_SIZE,
+ status_interval: DEFAULT_STATUS_INTERVAL,
+ key_protection: KeyProtection::Plaintext
+ })
+}
+
///
/// Validate configuration settings. Returns `true` if the config is valid, `false` otherwise.
///