diff options
Diffstat (limited to 'projects/cryptofuzz')
-rw-r--r-- | projects/cryptofuzz/Dockerfile | 1 | ||||
-rwxr-xr-x | projects/cryptofuzz/build.sh | 36 | ||||
-rw-r--r-- | projects/cryptofuzz/project.yaml | 4 |
3 files changed, 41 insertions, 0 deletions
diff --git a/projects/cryptofuzz/Dockerfile b/projects/cryptofuzz/Dockerfile index b6813b49..ed18cf88 100644 --- a/projects/cryptofuzz/Dockerfile +++ b/projects/cryptofuzz/Dockerfile @@ -39,6 +39,7 @@ RUN wget https://github.com/openssl/openssl/archive/OpenSSL_1_0_2-stable.zip RUN git clone --depth 1 https://github.com/google/cityhash.git RUN git clone --depth 1 https://github.com/golang/go RUN git clone --depth 1 https://github.com/randombit/botan.git +RUN git clone --depth 1 https://github.com/wolfSSL/wolfssl.git RUN apt-get remove -y libunwind8 COPY build.sh $SRC/ diff --git a/projects/cryptofuzz/build.sh b/projects/cryptofuzz/build.sh index 5fa3ccda..2c17cd61 100755 --- a/projects/cryptofuzz/build.sh +++ b/projects/cryptofuzz/build.sh @@ -90,6 +90,29 @@ then fi ############################################################################## +# Compile wolfCrypt +if [[ $CFLAGS != *-m32* ]] +then + cd $SRC/wolfssl + autoreconf -ivf + if [[ $CFLAGS != *sanitize=memory* ]] + then + ./configure --enable-static --enable-md2 --enable-md4 --enable-ripemd --enable-blake2 --enable-blake2s --enable-pwdbased --enable-scrypt --enable-hkdf --enable-cmac --enable-arc4 --enable-camellia --enable-rabbit --enable-aesccm --enable-aesctr --enable-hc128 --enable-xts --enable-des3 --enable-idea --enable-x963kdf --enable-harden + else + ./configure --enable-static --enable-md2 --enable-md4 --enable-ripemd --enable-blake2 --enable-blake2s --enable-pwdbased --enable-scrypt --enable-hkdf --enable-cmac --enable-arc4 --enable-camellia --enable-rabbit --enable-aesccm --enable-aesctr --enable-hc128 --enable-xts --enable-des3 --enable-idea --enable-x963kdf --enable-harden --disable-asm + fi + make -j$(nproc) >/dev/null 2>&1 + + export CXXFLAGS="$CXXFLAGS -DCRYPTOFUZZ_WOLFCRYPT" + export WOLFCRYPT_LIBWOLFSSL_A_PATH="$SRC/wolfssl/src/.libs/libwolfssl.a" + export WOLFCRYPT_INCLUDE_PATH="$SRC/wolfssl" + + # Compile Cryptofuzz wolfcrypt (without assembly) module + cd $SRC/cryptofuzz/modules/wolfcrypt + make -B +fi + +############################################################################## # Compile Botan cd $SRC/botan if [[ $CFLAGS != *-m32* ]] @@ -271,6 +294,10 @@ then cp $SRC/cryptofuzz-corpora/libressl_latest.zip $OUT/cryptofuzz-libressl-noasm_seed_corpus.zip fi +# OpenSSL can currently not be used together with wolfCrypt due to symbol collisions +export SAVE_CXXFLAGS="$CXXFLAGS" +export CXXFLAGS=${CXXFLAGS/-DCRYPTOFUZZ_WOLFCRYPT/} + ############################################################################## if [[ $CFLAGS != *sanitize=memory* ]] then @@ -333,6 +360,8 @@ cp $SRC/cryptofuzz/cryptofuzz-dict.txt $OUT/cryptofuzz-openssl-noasm.dict # Copy seed corpus cp $SRC/cryptofuzz-corpora/openssl_latest.zip $OUT/cryptofuzz-openssl-noasm_seed_corpus.zip +export CXXFLAGS="$SAVE_CXXFLAGS" + ############################################################################## if [[ $CFLAGS != *sanitize=memory* && $CFLAGS != *-m32* ]] then @@ -389,6 +418,10 @@ cp $SRC/cryptofuzz/cryptofuzz-dict.txt $OUT/cryptofuzz-boringssl-noasm.dict cp $SRC/cryptofuzz-corpora/boringssl_latest.zip $OUT/cryptofuzz-boringssl-noasm_seed_corpus.zip +# OpenSSL 1.1.0 can currently not be used together with wolfCrypt due to symbol collisions +export SAVE_CXXFLAGS="$CXXFLAGS" +export CXXFLAGS=${CXXFLAGS/-DCRYPTOFUZZ_WOLFCRYPT/} + ############################################################################## cd $SRC; unzip OpenSSL_1_1_0-stable.zip @@ -449,12 +482,15 @@ LIBFUZZER_LINK="$LIB_FUZZING_ENGINE" CXXFLAGS="$CXXFLAGS -I $SRC/openssl-OpenSSL # Generate dictionary ./generate_dict + # Copy fuzzer cp $SRC/cryptofuzz/cryptofuzz $OUT/cryptofuzz-openssl-110-noasm # Copy dictionary cp $SRC/cryptofuzz/cryptofuzz-dict.txt $OUT/cryptofuzz-openssl-110-noasm.dict # Copy seed corpus cp $SRC/cryptofuzz-corpora/openssl_latest.zip $OUT/cryptofuzz-openssl-110-noasm_seed_corpus.zip + +export CXXFLAGS="$SAVE_CXXFLAGS" ############################################################################## cd $SRC; unzip OpenSSL_1_0_2-stable.zip diff --git a/projects/cryptofuzz/project.yaml b/projects/cryptofuzz/project.yaml index e4e08029..270a362b 100644 --- a/projects/cryptofuzz/project.yaml +++ b/projects/cryptofuzz/project.yaml @@ -19,6 +19,10 @@ auto_ccs: - "ppzgs1@gmail.com" - "jack.lloyd@gmail.com" - "shane.lontis@hotmail.com" + - "david@wolfssl.com" + - "kaleb@wolfssl.com" + - "levi@wolfssl.com" + - "testing@wolfssl.com" sanitizers: - address - undefined |