Skip to content

Commit f4121e3

Browse files
alexinferno-chromium
authored andcommitted
Move the gnutls fuzzers to their own repo. (#188)
Also add two new ones.
1 parent 12a616f commit f4121e3

File tree

4 files changed

+21
-128
lines changed

4 files changed

+21
-128
lines changed

projects/gnutls/Dockerfile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,24 @@ RUN cd client-testcases/ && curl https://boringssl.googlesource.com/boringssl/+a
3232
RUN cp openssl/fuzz/corpora/client/* client-testcases/
3333
RUN zip gnutls_client_fuzzer_seed_corpus.zip client-testcases/*
3434

35+
# Applies to servers as well
36+
RUN mkdir server-testcases
37+
RUN cd server-testcases && curl https://boringssl.googlesource.com/boringssl/+archive/master/fuzz/server_corpus.tar.gz | tar -zx
38+
RUN cd server-testcases/ && curl https://boringssl.googlesource.com/boringssl/+archive/master/fuzz/server_corpus_no_fuzzer_mode.tar.gz | tar -zx
39+
RUN cp openssl/fuzz/corpora/server/* server-testcases/
40+
RUN zip gnutls_server_fuzzer_seed_corpus.zip server-testcases/*
41+
3542
# Same thing for X.509
3643
RUN mkdir x509-testcases
3744
RUN cd x509-testcases/ && curl https://boringssl.googlesource.com/boringssl/+archive/master/fuzz/cert_corpus.tar.gz | tar -zx
3845
RUN cp openssl/fuzz/corpora/x509/* x509-testcases/
3946
RUN zip gnutls_x509_parser_fuzzer_seed_corpus.zip x509-testcases/*
4047

48+
# And private keys
49+
RUN mkdir private-key-testcases
50+
RUN cd private-key-testcases && curl https://boringssl.googlesource.com/boringssl/+archive/master/fuzz/privkey_corpus.tar.gz | tar -zx
51+
RUN cd private-key-testcases && curl https://boringssl.googlesource.com/boringssl/+archive/master/fuzz/pkcs8_corpus.tar.gz | tar -zx
52+
RUN zip gnutls_private_key_parser_fuzzer_seed_corpus.zip private-key-testcases/*
53+
4154
WORKDIR gnutls
42-
COPY build.sh gnutls_client_fuzzer.cc gnutls_x509_parser_fuzzer.cc $SRC/
55+
COPY build.sh $SRC/

projects/gnutls/build.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ make bootstrap
1919
./configure --enable-gcc-warnings --enable-static --with-included-libtasn1 --with-included-unistring --without-p11-kit --disable-doc
2020
make "-j$(nproc)"
2121

22-
fuzzers="
23-
client
24-
x509_parser
25-
"
22+
fuzzers=$(find devel/fuzz/ -name "*_fuzzer.cc")
2623

27-
for fuzzer in $fuzzers; do
24+
for f in $fuzzers; do
25+
fuzzer=$(basename "$f" ".cc")
2826
$CXX $CXXFLAGS -std=c++11 -Ilib/includes \
29-
"$SRC/gnutls_${fuzzer}_fuzzer.cc" -o "$OUT/gnutls_${fuzzer}_fuzzer" \
27+
"devel/fuzz/${fuzzer}.cc" -o "$OUT/${fuzzer}" \
3028
lib/.libs/libgnutls.a -lFuzzingEngine -lpthread -Wl,-Bstatic \
3129
-lhogweed -lnettle -lgmp -Wl,-Bdynamic
3230

33-
cp "$SRC/gnutls_${fuzzer}_fuzzer_seed_corpus.zip" "$OUT/"
31+
if [ -f "$SRC/${fuzzer}_seed_corpus.zip" ]; then
32+
cp "$SRC/${fuzzer}_seed_corpus.zip" "$OUT/"
33+
fi
3434
done

projects/gnutls/gnutls_client_fuzzer.cc

Lines changed: 0 additions & 73 deletions
This file was deleted.

projects/gnutls/gnutls_x509_parser_fuzzer.cc

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)