From c729e2677091f77d1e84280a004b6bcea0262ae9 Mon Sep 17 00:00:00 2001 From: Guido Vranken Date: Tue, 5 Nov 2019 16:34:47 +0100 Subject: [PATCH] [cryptofuzz] Enable wolfCrypt 32 bit builds (#3008) --- projects/cryptofuzz/build.sh | 39 ++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/projects/cryptofuzz/build.sh b/projects/cryptofuzz/build.sh index 2c17cd61b9b..4b031865ab3 100755 --- a/projects/cryptofuzz/build.sh +++ b/projects/cryptofuzz/build.sh @@ -91,27 +91,32 @@ 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 +cd $SRC/wolfssl +autoreconf -ivf - export CXXFLAGS="$CXXFLAGS -DCRYPTOFUZZ_WOLFCRYPT" - export WOLFCRYPT_LIBWOLFSSL_A_PATH="$SRC/wolfssl/src/.libs/libwolfssl.a" - export WOLFCRYPT_INCLUDE_PATH="$SRC/wolfssl" +export WOLFCRYPT_CONFIGURE_PARAMS="--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" - # Compile Cryptofuzz wolfcrypt (without assembly) module - cd $SRC/cryptofuzz/modules/wolfcrypt - make -B +if [[ $CFLAGS = *sanitize=memory* ]] +then + export WOLFCRYPT_CONFIGURE_PARAMS="$WOLFCRYPT_CONFIGURE_PARAMS -disable-asm" fi +if [[ $CFLAGS = *-m32* ]] +then + export WOLFCRYPT_CONFIGURE_PARAMS="$WOLFCRYPT_CONFIGURE_PARAMS -disable-fastmath" +fi + +./configure $WOLFCRYPT_CONFIGURE_PARAMS +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 + ############################################################################## # Compile Botan cd $SRC/botan