[cryptofuzz] Add Botan (#2780)

This commit is contained in:
Guido Vranken 2019-08-31 00:00:49 +02:00 committed by jonathanmetzman
parent 824f9f3928
commit 5a2952267a
3 changed files with 43 additions and 17 deletions

View File

@ -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://boringssl.googlesource.com/boringssl
RUN git clone --depth 1 https://github.com/libressl-portable/portable libressl RUN git clone --depth 1 https://github.com/libressl-portable/portable libressl
RUN cd $SRC/libressl && ./update.sh 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://github.com/weidai11/cryptopp/
RUN git clone --depth 1 https://dev.gnupg.org/source/libgcrypt.git 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 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 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/google/cityhash.git
RUN git clone --depth 1 https://github.com/golang/go 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 RUN apt-get remove -y libunwind8
COPY build.sh $SRC/ COPY build.sh $SRC/

View File

@ -89,6 +89,25 @@ then
make -B make -B
fi 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* ]] if [[ $CFLAGS != *sanitize=memory* ]]
then then
@ -127,22 +146,27 @@ then
fi fi
############################################################################## ##############################################################################
if [[ $CFLAGS != *sanitize=memory* ]] # libsodium is currently disabled due to crashes whose cause
then # is not entirely clear.
# Compile libsodium (with assembly) # It will be enabled again once the problem has been resolved.
cd $SRC/libsodium # See also: https://github.com/jedisct1/libsodium/issues/859
autoreconf -ivf #
./configure #if [[ $CFLAGS != *sanitize=memory* ]]
make -j$(nproc) >/dev/null 2>&1 #then
# # Compile libsodium (with assembly)
export CXXFLAGS="$CXXFLAGS -DCRYPTOFUZZ_LIBSODIUM" # cd $SRC/libsodium
export LIBSODIUM_A_PATH="$SRC/libsodium/src/libsodium/.libs/libsodium.a" # autoreconf -ivf
export LIBSODIUM_INCLUDE_PATH="$SRC/libsodium/src/libsodium/include" # ./configure
# make -j$(nproc) >/dev/null 2>&1
# Compile Cryptofuzz libsodium (with assembly) module #
cd $SRC/cryptofuzz/modules/libsodium # export CXXFLAGS="$CXXFLAGS -DCRYPTOFUZZ_LIBSODIUM"
make -B # export LIBSODIUM_A_PATH="$SRC/libsodium/src/libsodium/.libs/libsodium.a"
fi # 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* ]] if [[ $CFLAGS != *sanitize=memory* && $CFLAGS != *-m32* ]]
then 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 cp $SRC/cryptofuzz/cryptofuzz-dict.txt $OUT/cryptofuzz-openssl-102-noasm.dict
# Copy seed corpus # Copy seed corpus
cp $SRC/cryptofuzz-corpora/openssl_latest.zip $OUT/cryptofuzz-openssl-102-noasm_seed_corpus.zip cp $SRC/cryptofuzz-corpora/openssl_latest.zip $OUT/cryptofuzz-openssl-102-noasm_seed_corpus.zip

View File

@ -17,6 +17,7 @@ auto_ccs:
- "jonathan.protzenko@gmail.com" - "jonathan.protzenko@gmail.com"
- "richard@levitte.org" - "richard@levitte.org"
- "ppzgs1@gmail.com" - "ppzgs1@gmail.com"
- "jack.lloyd@gmail.com"
sanitizers: sanitizers:
- address - address
- undefined - undefined