aboutsummaryrefslogtreecommitdiffhomepage
path: root/projects
diff options
context:
space:
mode:
authorGravatar Catena cyber <35799796+catenacyber@users.noreply.github.com>2020-02-14 16:36:56 +0100
committerGravatar GitHub <noreply@github.com>2020-02-14 07:36:56 -0800
commitc3271ac0e45c59e5eb4afffca6c00f46ce423e38 (patch)
treef51c171f3da74e7ec96d3e2861e9f8afda9d0e68 /projects
parentf2de39d8e0aabf9d1b26237d57c5b77d646a9af6 (diff)
[ecc-diff-fuzzer] Use cmake for ecc-diff-fuzzer compilation (#3361)
* Uses cmake for ecc-diff-fuzzer compilation * remove before install * Comment unnecessary remove * Remove shared libraries for nettle * Do not remove so files * Disable shared for gmp and nettle * Parallel make for every project
Diffstat (limited to 'projects')
-rwxr-xr-xprojects/ecc-diff-fuzzer/build.sh40
1 files changed, 20 insertions, 20 deletions
diff --git a/projects/ecc-diff-fuzzer/build.sh b/projects/ecc-diff-fuzzer/build.sh
index 248941cd..173b4152 100755
--- a/projects/ecc-diff-fuzzer/build.sh
+++ b/projects/ecc-diff-fuzzer/build.sh
@@ -23,19 +23,21 @@ tar -xvf ../gmp-6.1.2.tar.bz2
cd gmp-6.1.2
#do not use assembly instructions as we do not know if they will be available on the machine who will run the fuzzer
#we could do instead --enable-fat
-./configure --disable-assembly
-make
+./configure --disable-shared --disable-assembly
+make -j$(nproc)
make install
cd ..
autoreconf
-./configure
-make
+./configure --disable-shared
+make -j$(nproc)
+make install
)
#cryptopp
(
cd cryptopp
-make
+make -j$(nproc)
+make install
)
#gcrypt
@@ -47,7 +49,7 @@ if [ "$ARCHITECTURE" = 'i386' ]; then
else
./configure --disable-doc --enable-static --disable-shared
fi
-make
+make -j$(nproc)
make install
cd ../gcrypt
./autogen.sh
@@ -56,7 +58,8 @@ if [ "$ARCHITECTURE" = 'i386' ]; then
else
./configure --enable-static --disable-shared --disable-doc --enable-maintainer-mode --disable-asm
fi
-make
+make -j$(nproc)
+make install
)
#mbedtls
@@ -64,6 +67,7 @@ make
cd mbedtls
cmake . -DENABLE_PROGRAMS=0 -DENABLE_TESTING=0
make -j$(nproc) all
+make install
)
#openssl
@@ -76,13 +80,14 @@ else
./config no-poly1305 no-shared no-threads
fi
make build_generated libcrypto.a
+make install
)
#libecc
(
cd libecc
#required by libecc
-(export CFLAGS="$CFLAGS -fPIC"; make)
+(export CFLAGS="$CFLAGS -fPIC"; make; cp build/*.a /usr/local/lib; cp -r src/* /usr/local/include/)
)
#botan
@@ -96,7 +101,8 @@ if [ "$ARCHITECTURE" = 'i386' ]; then
else
./configure.py --disable-shared-library
fi
-make
+make -j$(nproc)
+make install
)
#build fuzz target
@@ -105,14 +111,8 @@ zip -r fuzz_ec_seed_corpus.zip corpus/
cp fuzz_ec_seed_corpus.zip $OUT/
cp fuzz_ec.dict $OUT/
-$CC $CFLAGS -I. -c fuzz_ec.c -o fuzz_ec.o
-$CC $CFLAGS -I. -c fail.c -o fail.o
-$CC $CFLAGS -I. -I../mbedtls/include -I../mbedtls/crypto/include -c modules/mbedtls.c -o mbedtls.o
-$CC $CFLAGS -I. -I../openssl/include -c modules/openssl.c -o openssl.o
-$CC $CFLAGS -DWITH_STDLIB -I. -I../libecc/src -c modules/libecc.c -o libecc.o
-$CC $CFLAGS -I. -I../gcrypt/src -c modules/gcrypt.c -o gcrypt.o
-$CXX $CXXFLAGS -I. -I../ -c modules/cryptopp.cpp -o cryptopp.o
-$CC $CFLAGS -I. -I../ -c modules/nettle.c -o nettle.o
-$CXX $CXXFLAGS -std=c++11 -I. -I../ -I../botan/build/include -c modules/botan.cpp -o botan.o
-
-$CXX $CXXFLAGS fuzz_ec.o fail.o mbedtls.o libecc.o openssl.o gcrypt.o cryptopp.o nettle.o botan.o -o $OUT/fuzz_ec ../mbedtls/crypto/library/libmbedcrypto.a ../libecc/build/libec.a ../libecc/src/external_deps/rand.o ../openssl/libcrypto.a ../nettle/libhogweed.a ../nettle/libnettle.a ../nettle/gmp-6.1.2/.libs/libgmp.a ../gcrypt/src/.libs/libgcrypt.a ../cryptopp/libcryptopp.a ../botan/libbotan-2.a -lgpg-error $LIB_FUZZING_ENGINE
+mkdir build
+cd build
+cmake ..
+make -j$(nproc)
+cp ecfuzzer $OUT/fuzz_ec