diff --git a/projects/go-ethereum/Dockerfile b/projects/go-ethereum/Dockerfile new file mode 100644 index 000000000..c0ca4f8f1 --- /dev/null +++ b/projects/go-ethereum/Dockerfile @@ -0,0 +1,43 @@ +# Copyright 2020 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +FROM gcr.io/oss-fuzz-base/base-builder + +RUN go get github.com/ethereum/go-ethereum +RUN go get golang.org/x/sys/cpu +RUN go get github.com/go-stack/stack +RUN go get github.com/deckarep/golang-set +RUN go get github.com/golang/snappy +RUN go get github.com/gorilla/websocket +RUN go get github.com/hashicorp/golang-lru +RUN go get github.com/holiman/uint256 +RUN go get github.com/olekukonko/tablewriter +RUN go get github.com/prometheus/tsdb/fileutil +RUN go get github.com/shirou/gopsutil/cpu +RUN go get github.com/steakknife/bloomfilter +RUN go get github.com/syndtr/goleveldb/leveldb +RUN go get github.com/syndtr/goleveldb/leveldb/errors +RUN go get github.com/syndtr/goleveldb/leveldb/filter +RUN go get github.com/syndtr/goleveldb/leveldb/opt +RUN go get github.com/syndtr/goleveldb/leveldb/util +RUN go get github.com/VictoriaMetrics/fastcache +RUN go get github.com/aristanetworks/goarista/monotime +RUN go get github.com/pborman/uuid +RUN go get github.com/rjeczalik/notify +RUN go get github.com/google/gofuzz + +COPY build.sh $SRC/ +WORKDIR $SRC/ diff --git a/projects/go-ethereum/build.sh b/projects/go-ethereum/build.sh new file mode 100755 index 000000000..b24b4e534 --- /dev/null +++ b/projects/go-ethereum/build.sh @@ -0,0 +1,44 @@ +#/bin/bash -eu +# Copyright 2020 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ +function compile_fuzzer { + path=$1 + function=$2 + fuzzer=$3 + + go-fuzz -func $function -o $fuzzer.a $path + + $CXX $CXXFLAGS $LIB_FUZZING_ENGINE $fuzzer.a -o $OUT/$fuzzer +} + +cd $GOPATH/src/github.com/ethereum/go-ethereum +make all + +cd $SRC + + +compile_fuzzer github.com/ethereum/go-ethereum/common/bitutil Fuzz fuzzBitutilCompress +compile_fuzzer github.com/ethereum/go-ethereum/crypto/bn256 FuzzAdd fuzzAdd +compile_fuzzer github.com/ethereum/go-ethereum/crypto/bn256 FuzzMul fuzzMul +compile_fuzzer github.com/ethereum/go-ethereum/crypto/bn256 FuzzPair fuzzPair +compile_fuzzer github.com/ethereum/go-ethereum/core/vm/runtime Fuzz fuzzVmRuntime +compile_fuzzer github.com/ethereum/go-ethereum/crypto/blake2b Fuzz fuzzBlake2b +compile_fuzzer github.com/ethereum/go-ethereum/tests/fuzzers/keystore Fuzz fuzzKeystore +compile_fuzzer github.com/ethereum/go-ethereum/tests/fuzzers/txfetcher Fuzz fuzzTxfetcher +#compile_fuzzer github.com/ethereum/go-ethereum/tests/fuzzers/abi Fuzz fuzzAbi +compile_fuzzer github.com/ethereum/go-ethereum/tests/fuzzers/rlp Fuzz fuzzRlp +compile_fuzzer github.com/ethereum/go-ethereum/tests/fuzzers/trie Fuzz fuzzTrie + diff --git a/projects/go-ethereum/project.yaml b/projects/go-ethereum/project.yaml new file mode 100644 index 000000000..339e37d8b --- /dev/null +++ b/projects/go-ethereum/project.yaml @@ -0,0 +1,11 @@ +homepage: "https://github.com/ethereum/go-ethereum" +primary_contact: "peter@ethereum.org" +auto_ccs : + - "adam@adalogics.com" + - "fjl@ethereum.org" + - "martin.swende@ethereum.org" +language: go +fuzzing_engines: + - libfuzzer +sanitizers: + - address