Skip to content

Commit b698878

Browse files
committed
Update fuzzing
Enable password and pubkey auth on event Bump to newer honggfuzz dep
1 parent fd19d0f commit b698878

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fuzz/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
7-
honggfuzz = { version = "=0.5.57", optional = true }
7+
honggfuzz = { version = "=0.5.58", optional = true }
88
afl = { version = "*", optional = true }
99
sunset = { workspace = true, features = ["arbitrary"] }
1010
sunset-sshwire-derive.workspace = true

fuzz/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Minimise a corpus
8181
Install [`honggfuzz-rs`](https://github.com/rust-fuzz/honggfuzz-rs)
8282

8383
```
84-
HFUZZ_INPUT=$HOME/tmp/fuzzsunset/afl61/m_fuzz-server/queue HFUZZ_BUILD_ARGS="--profile=fuzz --features honggfuzz" RUSTFLAGS='-C target-cpu=native' HFUZZ_RUN_ARGS='-n24 --dict server.dict ' cargo hfuzz run fuzz-server
84+
HFUZZ_INPUT=$HOME/tmp/fuzzsunset/afl61/m_fuzz-server/queue HFUZZ_BUILD_ARGS="--profile=fuzz --features honggfuzz" RUSTFLAGS='-C target-cpu=native' HFUZZ_RUN_ARGS='-n24 --dict server.dict ' nice cargo hfuzz run fuzz-server
8585
```
8686

8787
Add `-M` to the `HFUZZ_RUN_ARGS` to minimise a corpus in-place.

fuzz/src/server.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,12 @@ fn serv_event(input: &mut FuzzInput, ev: Event, state: &mut State) -> Result<()>
4141
ServEvent::Hostkeys(h) => {
4242
h.hostkeys(core::slice::from_ref(&&state.conf.key))?;
4343
}
44-
ServEvent::FirstAuth(h) => {
44+
ServEvent::FirstAuth(mut h) => {
4545
assert!(!state.authed);
4646
assert!(!state.firstauth);
4747
state.firstauth = true;
48+
h.enable_password_auth(true).unwrap();
49+
h.enable_pubkey_auth(true).unwrap();
4850
black_box(h.username()?);
4951
if input.chance(0.9)? {
5052
state.authed = true;

0 commit comments

Comments
 (0)