aboutsummaryrefslogtreecommitdiffhomepage
path: root/projects/cryptofuzz
diff options
context:
space:
mode:
authorGravatar Guido Vranken <guidovranken@users.noreply.github.com>2019-08-31 00:00:49 +0200
committerGravatar jonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com>2019-08-30 15:00:49 -0700
commit5a2952267a26782de1cb2d9708d5fbb86f8b3946 (patch)
tree91fb0f5d7a70349e648a8b2d3936377f393ccea7 /projects/cryptofuzz
parent824f9f39285b30cfc6235876abd1a5f53b9cd867 (diff)
[cryptofuzz] Add Botan (#2780)
Diffstat (limited to 'projects/cryptofuzz')
-rw-r--r--projects/cryptofuzz/Dockerfile2
-rwxr-xr-xprojects/cryptofuzz/build.sh57
-rw-r--r--projects/cryptofuzz/project.yaml1
3 files changed, 43 insertions, 17 deletions
diff --git a/projects/cryptofuzz/Dockerfile b/projects/cryptofuzz/Dockerfile
index b534d6ae..b6813b49 100644
--- a/projects/cryptofuzz/Dockerfile
+++ b/projects/cryptofuzz/Dockerfile
@@ -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/
diff --git a/projects/cryptofuzz/build.sh b/projects/cryptofuzz/build.sh
index a6c95d5d..545bbbfc 100755
--- a/projects/cryptofuzz/build.sh
+++ b/projects/cryptofuzz/build.sh
@@ -90,6 +90,25 @@ then
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
# Compile libgpg-error (dependency of libgcrypt)
@@ -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
+
diff --git a/projects/cryptofuzz/project.yaml b/projects/cryptofuzz/project.yaml
index f0a6662d..70e8933b 100644
--- a/projects/cryptofuzz/project.yaml
+++ b/projects/cryptofuzz/project.yaml
@@ -17,6 +17,7 @@ auto_ccs:
- "jonathan.protzenko@gmail.com"
- "richard@levitte.org"
- "ppzgs1@gmail.com"
+ - "jack.lloyd@gmail.com"
sanitizers:
- address
- undefined