Cryptofuzz i386 (#2569)

* [cryptofuzz] Enable i386 builds

* [cryptofuzz] Enable i386 builds (update project.yaml)
This commit is contained in:
Guido Vranken 2019-07-05 19:12:40 +02:00 committed by jonathanmetzman
parent 9fe0fb9320
commit 6eab2634bf
3 changed files with 55 additions and 11 deletions

View File

@ -37,5 +37,6 @@ RUN wget https://gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.36.tar.bz2
RUN git clone --depth 1 -b oss-fuzz https://github.com/project-everest/hacl-star evercrypt
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 apt-get remove -y libunwind8
COPY build.sh $SRC/

View File

@ -59,7 +59,12 @@ then
cd $SRC/
tar jxvf libgpg-error-1.36.tar.bz2
cd libgpg-error-1.36/
if [[ $CFLAGS != *-m32* ]]
then
./configure --enable-static
else
./configure --enable-static --host=i386
fi
make -j$(nproc) >/dev/null 2>&1
make install
export LINK_FLAGS="$LINK_FLAGS $SRC/libgpg-error-1.36/src/.libs/libgpg-error.a"
@ -67,7 +72,12 @@ then
# Compile libgcrypt (with assembly)
cd $SRC/libgcrypt
autoreconf -ivf
if [[ $CFLAGS != *-m32* ]]
then
./configure --enable-static --disable-doc
else
./configure --enable-static --disable-doc --host=i386
fi
make -j$(nproc) >/dev/null 2>&1
export CXXFLAGS="$CXXFLAGS -DCRYPTOFUZZ_LIBGCRYPT"
@ -97,7 +107,7 @@ then
make -B
fi
if [[ $CFLAGS != *sanitize=memory* ]]
if [[ $CFLAGS != *sanitize=memory* && $CFLAGS != *-m32* ]]
then
# Compile EverCrypt (with assembly)
cd $SRC/evercrypt/dist
@ -135,7 +145,7 @@ cd $SRC/cryptofuzz/modules/monero
make -B
##############################################################################
if [[ $CFLAGS != *sanitize=memory* ]]
if [[ $CFLAGS != *sanitize=memory* && $CFLAGS != *-m32* ]]
then
# Compile LibreSSL (with assembly)
cd $SRC/libressl
@ -168,7 +178,12 @@ if [[ $CFLAGS != *sanitize=memory* ]]
then
# Compile Openssl (with assembly)
cd $SRC/openssl
if [[ $CFLAGS != *-m32* ]]
then
./config --debug enable-md2 enable-rc5
else
setarch i386 ./config --debug enable-md2 enable-rc5
fi
make -j$(nproc) >/dev/null 2>&1
# Compile Cryptofuzz OpenSSL (with assembly) module
@ -193,7 +208,12 @@ fi
##############################################################################
# Compile Openssl (without assembly)
cd $SRC/openssl
if [[ $CFLAGS != *-m32* ]]
then
./config --debug no-asm enable-md2 enable-rc5
else
setarch i386 ./config --debug no-asm enable-md2 enable-rc5
fi
make clean
make -j$(nproc) >/dev/null 2>&1
@ -216,7 +236,7 @@ cp $SRC/cryptofuzz/cryptofuzz-dict.txt $OUT/cryptofuzz-openssl-noasm.dict
cp $SRC/cryptofuzz-corpora/openssl_latest.zip $OUT/cryptofuzz-openssl-noasm_seed_corpus.zip
##############################################################################
if [[ $CFLAGS != *sanitize=memory* ]]
if [[ $CFLAGS != *sanitize=memory* && $CFLAGS != *-m32* ]]
then
# Compile BoringSSL (with assembly)
cd $SRC/boringssl
@ -279,7 +299,12 @@ if [[ $CFLAGS != *sanitize=memory* ]]
then
# Compile Openssl 1.1.0 (with assembly)
cd $SRC/openssl-OpenSSL_1_1_0-stable/
if [[ $CFLAGS != *-m32* ]]
then
./config --debug enable-md2 enable-rc5 $CFLAGS
else
setarch i386 ./config --debug enable-md2 enable-rc5 $CFLAGS
fi
make depend
make -j$(nproc) >/dev/null 2>&1
@ -306,7 +331,12 @@ fi
# Compile Openssl 1.1.0 (without assembly)
cd $SRC/openssl-OpenSSL_1_1_0-stable/
make clean || true
if [[ $CFLAGS != *-m32* ]]
then
./config --debug no-asm enable-md2 enable-rc5 $CFLAGS
else
setarch i386 ./config --debug no-asm enable-md2 enable-rc5 $CFLAGS
fi
make depend
make -j$(nproc) >/dev/null 2>&1
@ -335,7 +365,12 @@ if [[ $CFLAGS != *sanitize=memory* ]]
then
# Compile Openssl 1.0.2 (with assembly)
cd $SRC/openssl-OpenSSL_1_0_2-stable/
if [[ $CFLAGS != *-m32* ]]
then
./config --debug enable-md2 enable-rc5 $CFLAGS
else
setarch i386 ./config --debug enable-md2 enable-rc5 $CFLAGS
fi
make depend
make -j$(nproc) >/dev/null 2>&1
@ -362,7 +397,12 @@ fi
# Compile Openssl 1.0.2 (without assembly)
cd $SRC/openssl-OpenSSL_1_0_2-stable/
make clean || true
if [[ $CFLAGS != *-m32* ]]
then
./config --debug no-asm enable-md2 enable-rc5 $CFLAGS
else
setarch i386 ./config --debug no-asm enable-md2 enable-rc5 $CFLAGS
fi
make depend
make -j$(nproc) >/dev/null 2>&1

View File

@ -19,3 +19,6 @@ sanitizers:
- address
- undefined
- memory
architectures:
- x86_64
- i386