Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update NSS project to use the build.sh and fuzzers provided by NSS #316

Merged
merged 1 commit into from
Jan 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions projects/nss/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

FROM ossfuzz/base-builder
MAINTAINER mmoroz@chromium.org
RUN apt-get install -y make autoconf automake libtool mercurial zlib1g-dev
RUN apt-get install -y make mercurial zlib1g-dev gyp ninja-build libssl-dev

RUN hg clone https://hg.mozilla.org/projects/nspr nspr
RUN hg clone https://hg.mozilla.org/projects/nss nss
RUN git clone --depth 1 https://github.com/mozilla/nss-fuzzing-corpus.git nss-corpus

WORKDIR nss
COPY build.sh fuzzers/* $SRC/
COPY build.sh $SRC/
52 changes: 2 additions & 50 deletions projects/nss/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,54 +15,6 @@
#
################################################################################

# Build the library.
make CCC="$CXX" XCFLAGS="$CXXFLAGS" SANITIZER_CFLAGS="$CXXFLAGS" \
BUILD_OPT=1 USE_64=1 NSS_DISABLE_GTESTS=1 ZDEFS_FLAG= \
nss_clean_all nss_build_all
cd ..

# Copy libraries and some objects to $WORK/nss/lib.
mkdir -p $WORK/nss/lib
cp dist/Linux*/lib/*.a $WORK/nss/lib
cp nspr/Linux*/pr/src/misc/prlog2.o $WORK/nss/lib

# Copy includes to $WORK/nss/include.
mkdir -p $WORK/nss/include
cp -rL dist/Linux*/include/* $WORK/nss/include
cp -rL dist/{public,private}/nss/* $WORK/nss/include


# Build the fuzzers.
FUZZERS="asn1_algorithmid_fuzzer \
asn1_any_fuzzer \
asn1_bitstring_fuzzer \
asn1_bmpstring_fuzzer \
asn1_boolean_fuzzer \
asn1_generalizedtime_fuzzer \
asn1_ia5string_fuzzer \
asn1_integer_fuzzer \
asn1_null_fuzzer \
asn1_objectid_fuzzer \
asn1_octetstring_fuzzer \
asn1_utctime_fuzzer \
asn1_utf8string_fuzzer"

# The following fuzzers are currently disabled due to linking issues:
# cert_certificate_fuzzer, seckey_privatekeyinfo_fuzzer


for fuzzer in $FUZZERS; do
$CXX $CXXFLAGS -std=c++11 $SRC/$fuzzer.cc \
-I$WORK/nss/include \
-lFuzzingEngine \
$WORK/nss/lib/libnss.a $WORK/nss/lib/libnssutil.a \
$WORK/nss/lib/libnspr4.a $WORK/nss/lib/libplc4.a $WORK/nss/lib/libplds4.a \
$WORK/nss/lib/prlog2.o -o $OUT/$fuzzer
done

# Archive and copy to $OUT seed corpus if the build succeeded.
zip $WORK/nss/all_nss_seed_corpus.zip $SRC/nss-corpus/*/*

for fuzzer in $FUZZERS; do
cp $WORK/nss/all_nss_seed_corpus.zip $OUT/${fuzzer}_seed_corpus.zip
done
# Build NSS with fuzzers.
./automation/ossfuzz/build.sh
19 changes: 0 additions & 19 deletions projects/nss/fuzzers/asn1_algorithmid_fuzzer.cc

This file was deleted.

18 changes: 0 additions & 18 deletions projects/nss/fuzzers/asn1_any_fuzzer.cc

This file was deleted.

18 changes: 0 additions & 18 deletions projects/nss/fuzzers/asn1_bitstring_fuzzer.cc

This file was deleted.

18 changes: 0 additions & 18 deletions projects/nss/fuzzers/asn1_bmpstring_fuzzer.cc

This file was deleted.

18 changes: 0 additions & 18 deletions projects/nss/fuzzers/asn1_boolean_fuzzer.cc

This file was deleted.

45 changes: 0 additions & 45 deletions projects/nss/fuzzers/asn1_fuzzer_template.h

This file was deleted.

18 changes: 0 additions & 18 deletions projects/nss/fuzzers/asn1_generalizedtime_fuzzer.cc

This file was deleted.

18 changes: 0 additions & 18 deletions projects/nss/fuzzers/asn1_ia5string_fuzzer.cc

This file was deleted.

18 changes: 0 additions & 18 deletions projects/nss/fuzzers/asn1_integer_fuzzer.cc

This file was deleted.

18 changes: 0 additions & 18 deletions projects/nss/fuzzers/asn1_null_fuzzer.cc

This file was deleted.

18 changes: 0 additions & 18 deletions projects/nss/fuzzers/asn1_objectid_fuzzer.cc

This file was deleted.

18 changes: 0 additions & 18 deletions projects/nss/fuzzers/asn1_octetstring_fuzzer.cc

This file was deleted.

18 changes: 0 additions & 18 deletions projects/nss/fuzzers/asn1_utctime_fuzzer.cc

This file was deleted.

18 changes: 0 additions & 18 deletions projects/nss/fuzzers/asn1_utf8string_fuzzer.cc

This file was deleted.

19 changes: 0 additions & 19 deletions projects/nss/fuzzers/cert_certificate_fuzzer.cc

This file was deleted.

Loading