Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fuzz: make all fuzz packages works with oss-fuzz #9143

Merged
merged 1 commit into from
Apr 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions fuzz/crypto/hd/DerivePrivateKeyForPath/main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package derive
package deriveprivatekeyforpath

import (
"bytes"
Expand All @@ -13,9 +13,9 @@ func mnemonicToSeed(mnemonic string) []byte {

func Fuzz(in []byte) int {
splits := bytes.Split(in, []byte("*"))
if len(splits) == 1 {
return -1
}
if len(splits) == 1 {
return -1
}
mnemonic, path := splits[0], splits[1]
seed := mnemonicToSeed(string(mnemonic))
master, ch := hd.ComputeMastersFromSeed(seed)
Expand Down
10 changes: 10 additions & 0 deletions fuzz/oss-fuzz-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,14 @@

export FUZZ_ROOT="github.com/cosmos/cosmos-sdk"

compile_go_fuzzer "$FUZZ_ROOT"/fuzz/crypto/hd/deriveprivatekeyforpath Fuzz fuzz_crypto_hd_deriveprivatekeyforpath fuzz

compile_go_fuzzer "$FUZZ_ROOT"/fuzz/types/dec/parsecoin Fuzz fuzz_types_parsecoin fuzz
compile_go_fuzzer "$FUZZ_ROOT"/fuzz/types/dec/parsedeccoin Fuzz fuzz_types_parsedeccoin fuzz
compile_go_fuzzer "$FUZZ_ROOT"/fuzz/types/dec/parsetimebytes Fuzz fuzz_types_parsetimebytes fuzz
compile_go_fuzzer "$FUZZ_ROOT"/fuzz/types/dec/verifyaddressformat Fuzz fuzz_types_verifyaddressformat fuzz
compile_go_fuzzer "$FUZZ_ROOT"/fuzz/types/dec/setstring Fuzz fuzz_types_dec_setstring fuzz

compile_go_fuzzer "$FUZZ_ROOT"/fuzz/unknownproto Fuzz fuzz_unknownproto fuzz

compile_go_fuzzer "$FUZZ_ROOT"/fuzz/x/bank/types/addressfrombalancesstore Fuzz fuzz_x_bank_types_addressfrombalancesstore fuzz
File renamed without changes.
File renamed without changes.
Loading