[gnutls] use an initial corpus for x509 (#164)

* [gnutls] use an initial corpus for x509

and add OpenSSL's corpus for client transcripts

* Use --depth=1 on clones
This commit is contained in:
Alex Gaynor 2016-12-10 12:28:26 -05:00 committed by inferno-chromium
parent 0ad5352198
commit 6b27f9b7fa
2 changed files with 19 additions and 8 deletions

View File

@ -18,14 +18,25 @@ FROM ossfuzz/base-libfuzzer
MAINTAINER alex.gaynor@gmail.com
RUN apt-get install -y make autoconf automake libtool autopoint libnettle6 nettle-dev pkg-config gperf bison autogen texinfo curl
RUN git clone https://gitlab.com/gnutls/gnutls.git
RUN git clone --depth=1 https://gitlab.com/gnutls/gnutls.git
RUN cd gnutls && git submodule update --init
# Using the client_corpus transcripts from boringssl, they're a decent starting point.
RUN mkdir boringssl-testcases
RUN cd boringssl-testcases/ && curl https://boringssl.googlesource.com/boringssl/+archive/master/fuzz/client_corpus.tar.gz | tar -zx
RUN cd boringssl-testcases/ && curl https://boringssl.googlesource.com/boringssl/+archive/master/fuzz/client_corpus_no_fuzzer_mode.tar.gz | tar -zx
RUN zip gnutls_client_fuzzer_seed_corpus.zip boringssl-testcases/*
# clone OpenSSL to get it's fuzzer testcases
RUN git clone --depth=1 https://github.com/openssl/openssl
# Using the client_corpus transcripts from BoringSSL and OpenSSL, they're a
# decent starting point.
RUN mkdir client-testcases
RUN cd client-testcases/ && curl https://boringssl.googlesource.com/boringssl/+archive/master/fuzz/client_corpus.tar.gz | tar -zx
RUN cd client-testcases/ && curl https://boringssl.googlesource.com/boringssl/+archive/master/fuzz/client_corpus_no_fuzzer_mode.tar.gz | tar -zx
RUN cp openssl/fuzz/corpora/client/* client-testcases/
RUN zip gnutls_client_fuzzer_seed_corpus.zip client-testcases/*
# Same thing for X.509
RUN mkdir x509-testcases
RUN cd x509-testcases/ && curl https://boringssl.googlesource.com/boringssl/+archive/master/fuzz/cert_corpus.tar.gz | tar -zx
RUN cp openssl/fuzz/corpora/x509/* x509-testcases/
RUN zip gnutls_x509_parser_fuzzer_seed_corpus.zip x509-testcases/*
WORKDIR gnutls
COPY build.sh gnutls_client_fuzzer.cc gnutls_x509_parser_fuzzer.cc $SRC/

View File

@ -29,6 +29,6 @@ for fuzzer in $fuzzers; do
"$SRC/gnutls_${fuzzer}_fuzzer.cc" -o "$OUT/gnutls_${fuzzer}_fuzzer" \
lib/.libs/libgnutls.a -lFuzzingEngine -lpthread -Wl,-Bstatic \
-lhogweed -lnettle -lgmp -Wl,-Bdynamic
done
cp "$SRC/gnutls_client_fuzzer_seed_corpus.zip" "$OUT/"
cp "$SRC/gnutls_${fuzzer}_fuzzer_seed_corpus.zip" "$OUT/"
done