Skip to content

Commit fd88e48

Browse files
committed
fuzz: remove AFL support
AFAICT we literally never used this; it was available only on the bitcoin targets and not the honggfuzz ones; AFL has a broken dep tree (or at least, requires some more MSRV pins that I did not care to investigate). Just remove it entirely.
1 parent ab467cb commit fd88e48

22 files changed

Lines changed: 32 additions & 194 deletions

fuzz/Cargo.toml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,8 @@ publish = false
88
[package.metadata]
99
cargo-fuzz = true
1010

11-
[features]
12-
default = ["honggfuzz_fuzz"]
13-
afl_fuzz = ["afl"]
14-
honggfuzz_fuzz = ["honggfuzz"]
15-
1611
[dependencies]
17-
honggfuzz = { version = "0.5", optional = true, default-features = false }
18-
afl = { version = "0.4", optional = true }
12+
honggfuzz = { version = "0.5", default-features = false }
1913
bitcoin = { version = "0.30.0", features = [ "serde" ] }
2014

2115
rust-crypto = "0.2"

fuzz/cycle.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ REPO_DIR=$(git rev-parse --show-toplevel)
1010
# shellcheck source=./fuzz-util.sh
1111
source "$REPO_DIR/fuzz/fuzz-util.sh"
1212

13-
export HFUZZ_BUILD_ARGS='--features honggfuzz_fuzz'
1413
while :
1514
do
1615
for targetFile in $(listTargetFiles); do

fuzz/fuzz.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ for targetFile in $targetFiles; do
2828
else
2929
HFUZZ_INPUT_ARGS=""
3030
fi
31-
HFUZZ_BUILD_ARGS="--features honggfuzz_fuzz" HFUZZ_RUN_ARGS="--run_time 30 --exit_upon_crash -v $HFUZZ_INPUT_ARGS" cargo hfuzz run "$targetName"
31+
HFUZZ_RUN_ARGS="--run_time 30 --exit_upon_crash -v $HFUZZ_INPUT_ARGS" cargo hfuzz run "$targetName"
3232

3333
checkReport "$targetName"
3434
done

fuzz/fuzz_targets/bitcoin/deser_net_msg.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
1-
extern crate bitcoin;
1+
2+
use honggfuzz::fuzz;
23

34
fn do_test(data: &[u8]) {
45
let _: Result<bitcoin::network::message::RawNetworkMessage, _> = bitcoin::consensus::encode::deserialize(data);
56
}
67

7-
#[cfg(feature = "afl")]
8-
#[macro_use] extern crate afl;
9-
#[cfg(feature = "afl")]
10-
fn main() {
11-
fuzz!(|data| {
12-
do_test(&data);
13-
});
14-
}
15-
16-
#[cfg(feature = "honggfuzz")]
17-
#[macro_use] extern crate honggfuzz;
18-
#[cfg(feature = "honggfuzz")]
198
fn main() {
209
loop {
2110
fuzz!(|data| {

fuzz/fuzz_targets/bitcoin/deserialize_address.rs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
extern crate bitcoin;
1+
2+
use honggfuzz::fuzz;
23
use std::str::FromStr;
4+
35
fn do_test(data: &[u8]) {
46
let data_str = String::from_utf8_lossy(data);
57
let addr = match bitcoin::address::Address::from_str(&data_str) {
@@ -9,18 +11,6 @@ fn do_test(data: &[u8]) {
911
assert_eq!(addr.to_string(), data_str);
1012
}
1113

12-
#[cfg(feature = "afl")]
13-
#[macro_use] extern crate afl;
14-
#[cfg(feature = "afl")]
15-
fn main() {
16-
fuzz!(|data| {
17-
do_test(&data);
18-
});
19-
}
20-
21-
#[cfg(feature = "honggfuzz")]
22-
#[macro_use] extern crate honggfuzz;
23-
#[cfg(feature = "honggfuzz")]
2414
fn main() {
2515
loop {
2616
fuzz!(|data| {

fuzz/fuzz_targets/bitcoin/deserialize_amount.rs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
extern crate bitcoin;
1+
2+
use honggfuzz::fuzz;
23
use std::str::FromStr;
4+
35
fn do_test(data: &[u8]) {
46
let data_str = String::from_utf8_lossy(data);
57

@@ -26,18 +28,6 @@ fn do_test(data: &[u8]) {
2628
assert_eq!(amt, amt_roundtrip);
2729
}
2830

29-
#[cfg(feature = "afl")]
30-
#[macro_use] extern crate afl;
31-
#[cfg(feature = "afl")]
32-
fn main() {
33-
fuzz!(|data| {
34-
do_test(&data);
35-
});
36-
}
37-
38-
#[cfg(feature = "honggfuzz")]
39-
#[macro_use] extern crate honggfuzz;
40-
#[cfg(feature = "honggfuzz")]
4131
fn main() {
4232
loop {
4333
fuzz!(|data| {

fuzz/fuzz_targets/bitcoin/deserialize_block.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
1-
extern crate bitcoin;
1+
2+
use honggfuzz::fuzz;
23

34
fn do_test(data: &[u8]) {
45
let _: Result<bitcoin::blockdata::block::Block, _>= bitcoin::consensus::encode::deserialize(data);
56
}
67

7-
#[cfg(feature = "afl")]
8-
#[macro_use] extern crate afl;
9-
#[cfg(feature = "afl")]
10-
fn main() {
11-
fuzz!(|data| {
12-
do_test(&data);
13-
});
14-
}
15-
16-
#[cfg(feature = "honggfuzz")]
17-
#[macro_use] extern crate honggfuzz;
18-
#[cfg(feature = "honggfuzz")]
198
fn main() {
209
loop {
2110
fuzz!(|data| {

fuzz/fuzz_targets/bitcoin/deserialize_prefilled_transaction.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
extern crate bitcoin;
1+
2+
use honggfuzz::fuzz;
23

34
fn do_test(data: &[u8]) {
45
// We already fuzz Transactions in `./deserialize_transaction.rs`.
@@ -13,18 +14,6 @@ fn do_test(data: &[u8]) {
1314
}
1415
}
1516

16-
#[cfg(feature = "afl")]
17-
#[macro_use] extern crate afl;
18-
#[cfg(feature = "afl")]
19-
fn main() {
20-
fuzz!(|data| {
21-
do_test(&data);
22-
});
23-
}
24-
25-
#[cfg(feature = "honggfuzz")]
26-
#[macro_use] extern crate honggfuzz;
27-
#[cfg(feature = "honggfuzz")]
2817
fn main() {
2918
loop {
3019
fuzz!(|data| {

fuzz/fuzz_targets/bitcoin/deserialize_psbt.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
extern crate bitcoin;
1+
2+
use honggfuzz::fuzz;
23

34
fn do_test(data: &[u8]) {
45
let psbt: Result<bitcoin::psbt::PartiallySignedTransaction, _> = bitcoin::psbt::Psbt::deserialize(data);
@@ -13,18 +14,6 @@ fn do_test(data: &[u8]) {
1314
}
1415
}
1516

16-
#[cfg(feature = "afl")]
17-
#[macro_use] extern crate afl;
18-
#[cfg(feature = "afl")]
19-
fn main() {
20-
fuzz!(|data| {
21-
do_test(&data);
22-
});
23-
}
24-
25-
#[cfg(feature = "honggfuzz")]
26-
#[macro_use] extern crate honggfuzz;
27-
#[cfg(feature = "honggfuzz")]
2817
fn main() {
2918
loop {
3019
fuzz!(|data| {

fuzz/fuzz_targets/bitcoin/deserialize_script.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
extern crate bitcoin;
1+
2+
use honggfuzz::fuzz;
23

34
use bitcoin::address::Address;
45
use bitcoin::network::constants::Network;
@@ -43,18 +44,6 @@ fn do_test(data: &[u8]) {
4344
}
4445
}
4546

46-
#[cfg(feature = "afl")]
47-
#[macro_use] extern crate afl;
48-
#[cfg(feature = "afl")]
49-
fn main() {
50-
fuzz!(|data| {
51-
do_test(&data);
52-
});
53-
}
54-
55-
#[cfg(feature = "honggfuzz")]
56-
#[macro_use] extern crate honggfuzz;
57-
#[cfg(feature = "honggfuzz")]
5847
fn main() {
5948
loop {
6049
fuzz!(|data| {

0 commit comments

Comments
 (0)