aboutsummaryrefslogtreecommitdiffhomepage
path: root/projects
diff options
context:
space:
mode:
authorGravatar Guido Vranken <guidovranken@users.noreply.github.com>2018-03-10 02:59:41 +0100
committerGravatar Abhishek Arya <inferno@chromium.org>2018-03-09 17:59:41 -0800
commitc5f13b4ce5bdb4f7eb0f3719465a29dd6d55b5ee (patch)
treee4591f7686aac78d320671089ce893ba5a95a906 /projects
parentdf573a03e204d175f6aca9b533effb274e92798a (diff)
Build OpenSSL+Rust target (#1222)
Diffstat (limited to 'projects')
-rw-r--r--projects/bignum-fuzzer/Dockerfile5
-rwxr-xr-xprojects/bignum-fuzzer/build.sh27
2 files changed, 24 insertions, 8 deletions
diff --git a/projects/bignum-fuzzer/Dockerfile b/projects/bignum-fuzzer/Dockerfile
index 98635118..753b5601 100644
--- a/projects/bignum-fuzzer/Dockerfile
+++ b/projects/bignum-fuzzer/Dockerfile
@@ -16,10 +16,13 @@
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 apt-get update && apt-get install -y software-properties-common python-software-properties wget curl sudo
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
+# Install Rust nightly
+RUN curl -s https://static.rust-lang.org/rustup.sh | sh -s -- --channel=nightly
+
RUN git clone --depth 1 https://github.com/guidovranken/bignum-fuzzer
RUN git clone --depth 1 https://github.com/openssl/openssl
COPY build.sh $SRC/
diff --git a/projects/bignum-fuzzer/build.sh b/projects/bignum-fuzzer/build.sh
index 37462c1a..5c33b82c 100755
--- a/projects/bignum-fuzzer/build.sh
+++ b/projects/bignum-fuzzer/build.sh
@@ -3,7 +3,7 @@ if [[ $CFLAGS = *sanitize=memory* ]]
then
CFLAGS+=" -DOPENSSL_NO_ASM=1"
fi
-./config $CFLAGS
+./config
make -j$(nproc)
# Build OpenSSL module
@@ -14,18 +14,31 @@ OPENSSL_INCLUDE_PATH=$SRC/openssl/include OPENSSL_LIBCRYPTO_A_PATH=$SRC/openssl/
cd $SRC/bignum-fuzzer/modules/go
make
-CXXFLAGS+=" -DBNFUZZ_FLAG_NO_NEGATIVE=1 -DBNFUZZ_FLAG_NUM_LEN=1200 -DBNFUZZ_FLAG_ALL_OPERATIONS=1"
+# Build Rust module
+cd $SRC/bignum-fuzzer/modules/rust
+make
+
+BASE_CXXFLAGS=$CXXFLAGS
-# Build fuzzer
+# Build OpenSSL/Go fuzzer
cd $SRC/bignum-fuzzer
./config-modules.sh openssl go
+CXXFLAGS="$BASE_CXXFLAGS -DBNFUZZ_FLAG_NO_NEGATIVE=1 -DBNFUZZ_FLAG_NUM_LEN=1200 -DBNFUZZ_FLAG_ALL_OPERATIONS=1"
LIBFUZZER_LINK="-lFuzzingEngine" make
-cd $SRC
-
-# Copy fuzzer to the designated location
+# Copy OpenSSL/Go fuzzer to the designated location
cp $SRC/bignum-fuzzer/fuzzer $OUT/fuzzer_openssl_go_no_negative_num_len_1200_all_operations
+# Build OpenSSL/Rust fuzzer
+cd $SRC/bignum-fuzzer
+make clean
+./config-modules.sh openssl rust
+CXXFLAGS="$BASE_CXXFLAGS -DBNFUZZ_FLAG_NUM_LEN=1200 -DBNFUZZ_FLAG_ALL_OPERATIONS=1 -DBNFUZZ_FLAG_NUM_LOOPS=1"
+LIBFUZZER_LINK="-lFuzzingEngine" make
+
+# Copy OpenSSL/Rust fuzzer to the designated location
+cp $SRC/bignum-fuzzer/fuzzer $OUT/fuzzer_openssl_rust_num_len_1200_all_operations_num_loops_1
-# Copy seed corpus to the designated location
+# Copy seed corpora to the designated location
cp $SRC/bignum-fuzzer/corpora/fuzzer_openssl_go_no_negative_num_len_1200_all_operations_seed_corpus.zip $OUT
+cp $SRC/bignum-fuzzer/corpora/fuzzer_openssl_rust_num_len_1200_all_operations_num_loops_1_seed_corpus.zip $OUT