Commit Graph

8 Commits

Author SHA1 Message Date
y
2d41e54f14 fuzz: move all artifacts into regressions
Merge the libfuzzer and honggfuzz saved crash inputs into a shared
folder in fuzz/regressions

Add relevant entries to .gitignore
2023-09-19 16:13:50 -04:00
y
e7a7f6d02d fuzz: add regressions/ folder; improve READMEs 2023-09-19 16:09:22 -04:00
y
aaed928482 fuzz: cleanup zkas-compile harness in honggfuzz 2023-09-19 14:44:03 -04:00
y
c669ba4696 fuzz: fix old code comment in script 2023-09-16 23:00:24 +00:00
y
f9ed0b825c fuzz: add script to generate .zk file corpus 2023-09-16 23:00:24 +00:00
y
9d97aebf50 fuzz: Add fuzz harness for zkas compilation
Create a fuzz harness to test the ./zkas binary compilation process. The
whole pipeline is tested: Lexer, Parser, Compiler, Analyzer. This is
performed by copying the relevant code from bin/zkas/src/main.rs.

Testing the entire pipeline like this is not very efficient in terms of
fuzzing cycles but on the other hand it is a quick-and-dirty way to find
results. It also benefits from testing the actual inputs to the binary
in the way it's expecting, rather than checking each of the components
in a piecemeal way using interfaces that aren't expected to be exposed
anyway.
2023-09-16 23:00:24 +00:00
y
e23a5e9ee5 fuzz: Add differential fuzzing for BTC VarInt
DarkFi's VarInt struct is meant to be equivalent to the one used by BTC.
Most of the source code is extremeley similar. This commit adds very
basic tests to ensure equivalence between DarkFi's implementation and
the one used by the BTC crate.
The tests included here are quite basic. Future work can expand on
the testing done on the deserialized values.
This harness can also be used as as guide or template for future
differential fuzzing.
2023-09-06 10:57:28 +00:00
greptile
d9d918b884 fuzz: Add honggfuzz (#206)
* fuzz: Add honggfuzz

- Added honggfuzz in fuzz2/ (alongside libfuzzer in fuzz/)
- Created convenience script for fuzzing binary decoder
- Created a script to convert inputs that cause crashes into arrays so
  that they can be used in unit tests

* Create honggfuzz as subdirectory of fuzz/

- Reorg so that honggfuzz is under fuzz/ instead of in a separate
  sibling-level directory fuzz2
- Update fuzz/README.md to make it explicit that it covers libfuzzer

Note: `cargo fuzz`/libfuzzer seems to insist that its folder exists at
`$REPO/fuzz/` so that's the reason for this particular folder structure.

---------

Co-authored-by: y <y>
2023-09-04 16:42:34 +00:00