2019-02-28 23:50:31 +00:00
# Compile latest Go
cd go/src
./make.bash
cd $SRC
# Remove previous Go install (used for bootstrapping)
apt-get remove golang-1.9-go -y
rm /usr/bin/go
export PATH = ` realpath $SRC /go/bin` :$PATH
2019-01-09 15:12:33 +00:00
# Install Rust nightly
curl https://sh.rustup.rs -sSf | sh -s -- -y
2018-12-30 18:43:22 +00:00
source $HOME /.cargo/env
2019-03-01 15:03:15 +00:00
# Build libmpdec
tar zxf mpdecimal-2.4.2.tar.gz
cd mpdecimal-2.4.2
./configure && make -j$( nproc)
2018-02-20 20:49:56 +00:00
cd $SRC /openssl
if [ [ $CFLAGS = *sanitize= memory* ] ]
then
CFLAGS += " -DOPENSSL_NO_ASM=1"
fi
2019-04-06 14:28:40 +00:00
./config --debug no-fips no-shared no-tests
2019-05-19 14:59:05 +00:00
make -j$( nproc)
2018-02-20 20:49:56 +00:00
2018-07-03 16:51:01 +00:00
# Build libgmp
cd $SRC /libgmp
autoreconf -ivf
./configure --enable-maintainer-mode
make -j$( nproc)
2018-02-20 20:49:56 +00:00
# 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
2018-03-10 01:59:41 +00:00
# Build Rust module
cd $SRC /bignum-fuzzer/modules/rust
make
2018-03-22 15:01:35 +00:00
# Build C++-Boost module
cd $SRC /bignum-fuzzer/modules/cpp_boost
make
2018-07-03 16:51:01 +00:00
# Build libgmp module
cd $SRC /bignum-fuzzer/modules/libgmp
LIBGMP_INCLUDE_PATH = $SRC /libgmp LIBGMP_A_PATH = $SRC /libgmp/.libs/libgmp.a make
2019-03-01 15:03:15 +00:00
# Build libmpdec module
cd $SRC /bignum-fuzzer/modules/libmpdec
LIBMPDEC_A_PATH = $SRC /mpdecimal-2.4.2/libmpdec/libmpdec.a LIBMPDEC_INCLUDE_PATH = $SRC /mpdecimal-2.4.2/libmpdec make
2018-03-10 01:59:41 +00:00
BASE_CXXFLAGS = $CXXFLAGS
2018-02-20 20:49:56 +00:00
2018-03-10 01:59:41 +00:00
# Build OpenSSL/Go fuzzer
2018-02-20 20:49:56 +00:00
cd $SRC /bignum-fuzzer
./config-modules.sh openssl go
2018-03-10 01:59:41 +00:00
CXXFLAGS = " $BASE_CXXFLAGS -DBNFUZZ_FLAG_NO_NEGATIVE=1 -DBNFUZZ_FLAG_NUM_LEN=1200 -DBNFUZZ_FLAG_ALL_OPERATIONS=1 "
2019-05-01 15:09:55 +00:00
LIBFUZZER_LINK = " $LIB_FUZZING_ENGINE " make
2018-02-20 20:49:56 +00:00
2018-03-10 01:59:41 +00:00
# Copy OpenSSL/Go fuzzer to the designated location
2018-02-20 20:49:56 +00:00
cp $SRC /bignum-fuzzer/fuzzer $OUT /fuzzer_openssl_go_no_negative_num_len_1200_all_operations
2018-03-10 01:59:41 +00:00
# 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 "
2019-05-01 15:09:55 +00:00
LIBFUZZER_LINK = " $LIB_FUZZING_ENGINE " make
2018-03-10 01:59:41 +00:00
# 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
2018-02-23 15:51:45 +00:00
2018-03-22 15:01:35 +00:00
# Build OpenSSL/C++-Boost fuzzer
cd $SRC /bignum-fuzzer
make clean
./config-modules.sh openssl cpp_boost
CXXFLAGS = " $BASE_CXXFLAGS -DBNFUZZ_FLAG_NUM_LEN=1200 -DBNFUZZ_FLAG_ALL_OPERATIONS=1 -DBNFUZZ_FLAG_NUM_LOOPS=1 "
2019-05-01 15:09:55 +00:00
LIBFUZZER_LINK = " $LIB_FUZZING_ENGINE " make
2018-03-22 15:01:35 +00:00
# Copy OpenSSL/C++-Boost fuzzer to the designated location
cp $SRC /bignum-fuzzer/fuzzer $OUT /fuzzer_openssl_cpp_boost_num_len_1200_all_operations_num_loops_1
2018-07-03 16:51:01 +00:00
# Build OpenSSL/libgmp fuzzer
cd $SRC /bignum-fuzzer
make clean
./config-modules.sh openssl libgmp
CXXFLAGS = " $BASE_CXXFLAGS -DBNFUZZ_FLAG_NUM_LEN=1200 -DBNFUZZ_FLAG_ALL_OPERATIONS=1 -DBNFUZZ_FLAG_NUM_LOOPS=1 "
2019-05-01 15:09:55 +00:00
LIBFUZZER_LINK = " $LIB_FUZZING_ENGINE " make
2018-07-03 16:51:01 +00:00
# Copy OpenSSL/libgmp fuzzer to the designated location
cp $SRC /bignum-fuzzer/fuzzer $OUT /fuzzer_openssl_libgmp_num_len_1200_all_operations_num_loops_1
2019-04-09 16:07:55 +00:00
# Build mbedtls
2019-06-04 15:13:23 +00:00
cd $SRC /mbedtls/crypto
2019-04-09 16:07:55 +00:00
make lib -j$( nproc)
2018-07-23 13:45:34 +00:00
# Build BoringSSL
cd $SRC /boringssl
mkdir build
cd build
cmake -DCMAKE_CXX_FLAGS= " $CXXFLAGS " -DCMAKE_C_FLAGS= " $CFLAGS " -DBORINGSSL_ALLOW_CXX_RUNTIME= 1 ..
make -j$( nproc)
# Build BoringSSL module
cd $SRC /bignum-fuzzer/modules/openssl
make clean
CFLAGS = " $CFLAGS -DBIGNUM_FUZZER_BORINGSSL " OPENSSL_INCLUDE_PATH = $SRC /boringssl/include OPENSSL_LIBCRYPTO_A_PATH = $SRC /boringssl/build/crypto/libcrypto.a make
2019-04-09 16:07:55 +00:00
# Build mbedtls module
cd $SRC /bignum-fuzzer/modules/mbedtls
2019-06-04 15:13:23 +00:00
MBEDTLS_LIBMBEDCRYPTO_A_PATH = $SRC /mbedtls/crypto/library/libmbedcrypto.a MBEDTLS_INCLUDE_PATH = $SRC /mbedtls/crypto/include make
2019-04-09 16:07:55 +00:00
# Build BoringSSL/mbedtls fuzzer
cd $SRC /bignum-fuzzer
make clean
./config-modules.sh boringssl mbedtls
CXXFLAGS = " $BASE_CXXFLAGS -DBNFUZZ_FLAG_NUM_LEN=100 -DBNFUZZ_FLAG_ALL_OPERATIONS=1 -DBNFUZZ_FLAG_NUM_LOOPS=1 "
2019-05-01 15:09:55 +00:00
LIBFUZZER_LINK = " $LIB_FUZZING_ENGINE " make
2019-04-09 16:07:55 +00:00
# Copy BoringSSL/mbedtls fuzzer to the designated location
cp $SRC /bignum-fuzzer/fuzzer $OUT /fuzzer_boringssl_mbedtls_num_len_100_all_operations_num_loops_1
2019-03-01 15:03:15 +00:00
# Build BoringSSL/libmpdec fuzzer
cd $SRC /bignum-fuzzer
make clean
./config-modules.sh boringssl libmpdec
CXXFLAGS = " $BASE_CXXFLAGS -DBNFUZZ_FLAG_NUM_LEN=100 -DBNFUZZ_FLAG_ALL_OPERATIONS=1 -DBNFUZZ_FLAG_NUM_LOOPS=1 "
2019-05-01 15:09:55 +00:00
LIBFUZZER_LINK = " $LIB_FUZZING_ENGINE " make
2019-03-01 15:03:15 +00:00
# Copy BoringSSL/libmpdec fuzzer to the designated location
cp $SRC /bignum-fuzzer/fuzzer $OUT /fuzzer_boringssl_libmpdec_num_len_100_all_operations_num_loops_1
2018-03-10 01:59:41 +00:00
# Copy seed corpora to the designated location
2018-02-23 15:51:45 +00:00
cp $SRC /bignum-fuzzer/corpora/fuzzer_openssl_go_no_negative_num_len_1200_all_operations_seed_corpus.zip $OUT
2018-03-10 01:59:41 +00:00
cp $SRC /bignum-fuzzer/corpora/fuzzer_openssl_rust_num_len_1200_all_operations_num_loops_1_seed_corpus.zip $OUT
2018-03-22 15:01:35 +00:00
cp $SRC /bignum-fuzzer/corpora/fuzzer_openssl_cpp_boost_num_len_1200_all_operations_num_loops_1_seed_corpus.zip $OUT
2018-07-03 16:51:01 +00:00
cp $SRC /bignum-fuzzer/corpora/fuzzer_openssl_libgmp_num_len_1200_all_operations_num_loops_1_seed_corpus.zip $OUT
2019-04-09 16:07:55 +00:00
cp $SRC /bignum-fuzzer/corpora/fuzzer_boringssl_mbedtls_num_len_100_all_operations_num_loops_1_seed_corpus.zip $OUT
2019-03-01 15:03:15 +00:00
cp $SRC /bignum-fuzzer/corpora/fuzzer_boringssl_mbedtls_num_len_100_all_operations_num_loops_1_seed_corpus.zip $OUT /fuzzer_boringssl_libmpdec_num_len_100_all_operations_num_loops_1_seed_corpus.zip