fuzz/Cargo.toml
# Gunnar's fuzz targets: the parsers that read bytes a stranger chose (a pushed pack, an
# object, a pkt-line request, an encrypted repository's envelope and key files, an SSH
# signature). The cargo-fuzz layout: `cargo fuzz run <target>` works, and so does a plain
# stable build (see README.md); the dwarves forge runs every target nightly.
[package]
name = "gunnar-fuzz"
version = "0.0.0"
edition = "2021"
publish = false
license = "AGPL-3.0-only"
description = "cargo-fuzz targets for Gunnar's untrusted-input parsers"
[package.metadata]
cargo-fuzz = true
# Its own workspace: a fuzz build takes instrumentation flags the product never does.
[workspace]
members = ["."]
[features]
default = ["libfuzzer"]
# The fuzz targets (bins). Off, the crate is only its entry functions, which
# `tests/seeds.rs` drives with the committed corpus on a plain stable `cargo test`.
libfuzzer = ["dep:libfuzzer-sys"]
[dependencies]
libfuzzer-sys = { version = "0.4", optional = true }
gunnar-core = { path = "../crates/gunnar-core" }
gunnar-crypt = { path = "../crates/gunnar-crypt" }
gunnar-policy = { path = "../crates/gunnar-policy" }
gunnar-store = { path = "../crates/gunnar-store" }
gunnar-wire = { path = "../crates/gunnar-wire" }
gix-hash = { version = "0.28", features = ["sha1", "sha256"] }
ssh-key = { version = "=0.7.0-rc.11", default-features = false, features = ["ed25519", "std", "rand_core", "encryption"] }
# gunnar-server's pack-end scanner is compiled in from its source file (src/lib.rs),
# so the fuzz build does not link the whole server; these are its two dependencies.
anyhow = "1"
flate2 = { version = "1", default-features = false, features = ["zlib-rs"] }
# The root's one patched dependency (see the root Cargo.toml), so the fuzzed code is the
# code Gunnar ships.
[patch.crates-io]
gix-parallel = { path = "../vendor/gix-parallel" }
[profile.release]
debug = 1
[[bin]]
name = "object_decode"
path = "fuzz_targets/object_decode.rs"
test = false
doc = false
bench = false
required-features = ["libfuzzer"]
[[bin]]
name = "pack_scan"
path = "fuzz_targets/pack_scan.rs"
test = false
doc = false
bench = false
required-features = ["libfuzzer"]
[[bin]]
name = "envelope_open"
path = "fuzz_targets/envelope_open.rs"
test = false
doc = false
bench = false
required-features = ["libfuzzer"]
[[bin]]
name = "crypt_files"
path = "fuzz_targets/crypt_files.rs"
test = false
doc = false
bench = false
required-features = ["libfuzzer"]
[[bin]]
name = "commit_signature"
path = "fuzz_targets/commit_signature.rs"
test = false
doc = false
bench = false
required-features = ["libfuzzer"]
[[bin]]
name = "sshsig_event"
path = "fuzz_targets/sshsig_event.rs"
test = false
doc = false
bench = false
required-features = ["libfuzzer"]
[[bin]]
name = "receive_preamble"
path = "fuzz_targets/receive_preamble.rs"
test = false
doc = false
bench = false
required-features = ["libfuzzer"]
[[bin]]
name = "upload_request"
path = "fuzz_targets/upload_request.rs"
test = false
doc = false
bench = false
required-features = ["libfuzzer"]