Page MenuHomePhabricator

[backport#19379] tests: Add fuzzing harness for SigHasLowR(...) and ecdsa_signature_parse_der_lax(...)
ClosedPublic

Authored by majcosta on Dec 14 2022, 20:12.

Details

Summary

46fcac1e4b9e0b1026bc0b663582148b2fd60390 tests: Add fuzzing harness for ec_seckey_import_der(...) and ec_seckey_export_der(...) (practicalswift)
b667a90389cce7e1bf882f4ac78323c48858efaa tests: Add fuzzing harness for SigHasLowR(...) and ecdsa_signature_parse_der_lax(...) (practicalswift)

Pull request description:

Add fuzzing harness for `SigHasLowR(...)` and `ecdsa_signature_parse_der_lax(...)`.

See [`doc/fuzzing.md`](https://github.com/bitcoin/bitcoin/blob/master/doc/fuzzing.md) for information on how to fuzz Bitcoin Core. Don't forget to contribute any coverage increasing inputs you find to the [Bitcoin Core fuzzing corpus repo](https://github.com/bitcoin-core/qa-assets).

Happy fuzzing :)

static was added to bool SigHasLowR in D4467, fuzzer can't link
without removing it

This is a backport of core#19379

Test Plan
mkdir bfuzz && cd bfuzz && cmake .. -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DENABLE_SANITIZERS="fuzzer;address;undefined"
ninja fuzz-secp256k1_ec_seckey_import_export_der fuzz-secp256k1_ecdsa_signature_parse_der_lax
./src/test/fuzz/secp256k1_ec_seckey_import_export_der
./src/test/fuzz/secp256k1_ecdsa_signature_parse_der_lax
cd ..
mkdir build && cd build && cmake .. -GNinja
ninja all check check-functional

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable