fuzz/Cargo.toml
# monetize's fuzz targets: the parsers that read bytes a stranger (or a box, or a vendor) chose:
# a payment vendor's callback, the operator's feed and monetize.toml, the signed facts and
# go-aheads a product checks, the Fleet door's signed calls (the old sold-estate door folded in),
# and the signed orders a box pulls. 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.
#
# Only the OPEN crates are fuzzed here. The vendors in the private monetize-impl (Stripe,
# Klarna, Swish) have their own fuzz crate there.
[package]
name = "monetize-fuzz"
version = "0.0.0"
edition = "2021"
publish = false
license = "AGPL-3.0-only"
description = "cargo-fuzz targets for monetize'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 }
monetize = { path = "../crates/monetize" }
monetize-embed = { path = "../crates/monetize-embed" }
monetize-product = { path = "../crates/monetize-product" }
monetize-pay = { path = "../crates/monetize-pay", features = ["invoice", "sandbox"] }
monetize-proto = { path = "../crates/monetize-proto" }
monetize-guardian = { path = "../crates/monetize-guardian" }
monetize-estate-side = { path = "../crates/monetize-estate-side" }
monetize-front = { path = "../crates/monetize-front" }
monetize-server = { path = "../crates/monetize-server" }
prost = "0.14"
serde_json = "1"
toml = "1"
ed25519-dalek = { version = "3", features = ["rand_core"] }
# The root's patches (see the root Cargo.toml), so the fuzzed code is the code monetize ships.
[patch.crates-io]
monetize-product = { path = "../crates/monetize-product" }
monetize-product-guest = { path = "../crates/monetize-product-guest" }
monetize-embed = { path = "../crates/monetize-embed" }
[profile.release]
debug = 1
[[bin]]
name = "pay_callback"
path = "fuzz_targets/pay_callback.rs"
test = false
doc = false
bench = false
required-features = ["libfuzzer"]
[[bin]]
name = "feed_config"
path = "fuzz_targets/feed_config.rs"
test = false
doc = false
bench = false
required-features = ["libfuzzer"]
[[bin]]
name = "signed_facts"
path = "fuzz_targets/signed_facts.rs"
test = false
doc = false
bench = false
required-features = ["libfuzzer"]
[[bin]]
name = "fleet_door"
path = "fuzz_targets/fleet_door.rs"
test = false
doc = false
bench = false
required-features = ["libfuzzer"]
[[bin]]
name = "fleet_orders"
path = "fuzz_targets/fleet_orders.rs"
test = false
doc = false
bench = false
required-features = ["libfuzzer"]