aboutsummaryrefslogtreecommitdiffhomepage
path: root/projects/bignum-fuzzer
diff options
context:
space:
mode:
authorGravatar Guido Vranken <guidovranken@users.noreply.github.com>2018-02-20 21:49:56 +0100
committerGravatar Kostya Serebryany <konstantin.s.serebryany@gmail.com>2018-02-20 12:49:56 -0800
commitce21653fecf57762f815dc9b58722c8c7aefb7ec (patch)
tree886b242318fca78e5d348f77c170331e468b96b3 /projects/bignum-fuzzer
parentb2f2519b6329efb5837a50f15684079d5f017abb (diff)
Requesting bignum-fuzzer integration (#1147)
* Add bignum-fuzzer project files * Remove .options file * Add OpenSSL recipients to project.yaml auto_ccs
Diffstat (limited to 'projects/bignum-fuzzer')
-rw-r--r--projects/bignum-fuzzer/Dockerfile25
-rwxr-xr-xprojects/bignum-fuzzer/build.sh32
-rw-r--r--projects/bignum-fuzzer/project.yaml7
3 files changed, 64 insertions, 0 deletions
diff --git a/projects/bignum-fuzzer/Dockerfile b/projects/bignum-fuzzer/Dockerfile
new file mode 100644
index 00000000..816446ec
--- /dev/null
+++ b/projects/bignum-fuzzer/Dockerfile
@@ -0,0 +1,25 @@
+# Copyright 2016 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
+MAINTAINER guidovranken@gmail.com
+RUN apt-get update && apt-get install -y software-properties-common python-software-properties wget
+RUN add-apt-repository -y ppa:gophers/archive && apt-get update && apt-get install -y golang-1.9-go
+RUN ln -s /usr/lib/go-1.9/bin/go /usr/bin/go
+
+RUN git clone --depth 1 https://github.com/guidovranken/bignum-fuzzer
+RUN git clone --depth 1 https://github.com/openssl/openssl
+COPY build.sh *.options $SRC/
diff --git a/projects/bignum-fuzzer/build.sh b/projects/bignum-fuzzer/build.sh
new file mode 100755
index 00000000..c91879b8
--- /dev/null
+++ b/projects/bignum-fuzzer/build.sh
@@ -0,0 +1,32 @@
+cd $SRC/openssl
+if [[ $CFLAGS = *sanitize=memory* ]]
+then
+ CFLAGS+=" -DOPENSSL_NO_ASM=1"
+fi
+./config $CFLAGS
+make -j$(nproc)
+
+# Build OpenSSL module
+cd $SRC/bignum-fuzzer/modules/openssl
+OPENSSL_INCLUDE_PATH=$SRC/openssl/include OPENSSL_LIBCRYPTO_A_PATH=$SRC/openssl/libcrypto.a make
+
+# Build Go module
+cd $SRC/bignum-fuzzer/modules/go
+make
+
+CXXFLAGS+=" -DBNFUZZ_FLAG_NO_NEGATIVE=1 -DBNFUZZ_FLAG_NUM_LEN=1200 -DBNFUZZ_FLAG_ALL_OPERATIONS=1"
+
+# Build fuzzer
+cd $SRC/bignum-fuzzer
+./config-modules.sh openssl go
+LIBFUZZER_LINK="-lFuzzingEngine" make
+
+cd $SRC
+
+# Copy fuzzer to the designated location
+cp $SRC/bignum-fuzzer/fuzzer $OUT/fuzzer_openssl_go_no_negative_num_len_1200_all_operations
+
+cp *.options $OUT/
+
+cd $OUT
+wget https://transfer.sh/gFacf/fuzzer_openssl_go_no_negative_num_len_1200_all_operations_seed_corpus.zip
diff --git a/projects/bignum-fuzzer/project.yaml b/projects/bignum-fuzzer/project.yaml
new file mode 100644
index 00000000..e8f6aa8c
--- /dev/null
+++ b/projects/bignum-fuzzer/project.yaml
@@ -0,0 +1,7 @@
+homepage: "https://github.com/guidovranken/bignum-fuzzer"
+primary_contact: "guidovranken@gmail.com"
+auto_ccs:
+ - "martin.swende@ethereum.org"
+ - "cdetrio@ethereum.org"
+ - "openssl-security@openssl.org"
+ - "kurt@roeckx.be"