[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://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/

View File

@ -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

View File

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