diff --git a/projects/cryptofuzz/Dockerfile b/projects/cryptofuzz/Dockerfile index b534d6ae5..b6813b49f 100644 --- a/projects/cryptofuzz/Dockerfile +++ b/projects/cryptofuzz/Dockerfile @@ -30,7 +30,6 @@ RUN git clone --depth 1 https://github.com/openssl/openssl RUN git clone --depth 1 https://boringssl.googlesource.com/boringssl RUN git clone --depth 1 https://github.com/libressl-portable/portable libressl RUN cd $SRC/libressl && ./update.sh -RUN git clone --depth 1 https://github.com/jedisct1/libsodium.git RUN git clone --depth 1 https://github.com/weidai11/cryptopp/ RUN git clone --depth 1 https://dev.gnupg.org/source/libgcrypt.git RUN wget https://gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.36.tar.bz2 @@ -39,6 +38,7 @@ RUN wget https://github.com/openssl/openssl/archive/OpenSSL_1_1_0-stable.zip 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 apt-get remove -y libunwind8 COPY build.sh $SRC/ diff --git a/projects/cryptofuzz/build.sh b/projects/cryptofuzz/build.sh index a6c95d5d4..545bbbfce 100755 --- a/projects/cryptofuzz/build.sh +++ b/projects/cryptofuzz/build.sh @@ -89,6 +89,25 @@ then make -B fi +############################################################################## +# Compile Botan +cd $SRC/botan +if [[ $CFLAGS != *-m32* ]] +then + ./configure.py --cc-bin=$CXX --cc-abi-flags="$CXXFLAGS" --disable-shared --disable-modules=locking_allocator +else + ./configure.py --cpu=x86_32 --cc-bin=$CXX --cc-abi-flags="$CXXFLAGS" --disable-shared --disable-modules=locking_allocator +fi +make -j$(nproc) + +export CXXFLAGS="$CXXFLAGS -DCRYPTOFUZZ_BOTAN" +export LIBBOTAN_A_PATH="$SRC/botan/libbotan-2.a" +export BOTAN_INCLUDE_PATH="$SRC/botan/build/include" + +# Compile Cryptofuzz Botan module +cd $SRC/cryptofuzz/modules/botan +make -B + ############################################################################## if [[ $CFLAGS != *sanitize=memory* ]] then @@ -127,22 +146,27 @@ then fi ############################################################################## -if [[ $CFLAGS != *sanitize=memory* ]] -then - # Compile libsodium (with assembly) - cd $SRC/libsodium - autoreconf -ivf - ./configure - make -j$(nproc) >/dev/null 2>&1 - - export CXXFLAGS="$CXXFLAGS -DCRYPTOFUZZ_LIBSODIUM" - export LIBSODIUM_A_PATH="$SRC/libsodium/src/libsodium/.libs/libsodium.a" - export LIBSODIUM_INCLUDE_PATH="$SRC/libsodium/src/libsodium/include" - - # Compile Cryptofuzz libsodium (with assembly) module - cd $SRC/cryptofuzz/modules/libsodium - make -B -fi +# libsodium is currently disabled due to crashes whose cause +# is not entirely clear. +# It will be enabled again once the problem has been resolved. +# See also: https://github.com/jedisct1/libsodium/issues/859 +# +#if [[ $CFLAGS != *sanitize=memory* ]] +#then +# # Compile libsodium (with assembly) +# cd $SRC/libsodium +# autoreconf -ivf +# ./configure +# make -j$(nproc) >/dev/null 2>&1 +# +# export CXXFLAGS="$CXXFLAGS -DCRYPTOFUZZ_LIBSODIUM" +# export LIBSODIUM_A_PATH="$SRC/libsodium/src/libsodium/.libs/libsodium.a" +# export LIBSODIUM_INCLUDE_PATH="$SRC/libsodium/src/libsodium/include" +# +# # Compile Cryptofuzz libsodium (with assembly) module +# cd $SRC/cryptofuzz/modules/libsodium +# make -B +#fi if [[ $CFLAGS != *sanitize=memory* && $CFLAGS != *-m32* ]] then @@ -497,3 +521,4 @@ cp $SRC/cryptofuzz/cryptofuzz $OUT/cryptofuzz-openssl-102-noasm cp $SRC/cryptofuzz/cryptofuzz-dict.txt $OUT/cryptofuzz-openssl-102-noasm.dict # Copy seed corpus cp $SRC/cryptofuzz-corpora/openssl_latest.zip $OUT/cryptofuzz-openssl-102-noasm_seed_corpus.zip + diff --git a/projects/cryptofuzz/project.yaml b/projects/cryptofuzz/project.yaml index f0a6662db..70e8933b7 100644 --- a/projects/cryptofuzz/project.yaml +++ b/projects/cryptofuzz/project.yaml @@ -17,6 +17,7 @@ auto_ccs: - "jonathan.protzenko@gmail.com" - "richard@levitte.org" - "ppzgs1@gmail.com" + - "jack.lloyd@gmail.com" sanitizers: - address - undefined