From 1554665cda2c6d6cbadee04d1af98cca73693526 Mon Sep 17 00:00:00 2001 From: Shilpasri G Bhat Date: Sun, 29 Nov 2020 20:17:38 -0600 Subject: [PATCH 1/4] Add libhttpserver to oss-fuzz --- projects/libhttpserver/Dockerfile | 23 +++++++++++++++++++ projects/libhttpserver/build.sh | 34 +++++++++++++++++++++++++++++ projects/libhttpserver/project.yaml | 6 +++++ 3 files changed, 63 insertions(+) create mode 100644 projects/libhttpserver/Dockerfile create mode 100755 projects/libhttpserver/build.sh create mode 100644 projects/libhttpserver/project.yaml diff --git a/projects/libhttpserver/Dockerfile b/projects/libhttpserver/Dockerfile new file mode 100644 index 000000000000..06d92b4ceb29 --- /dev/null +++ b/projects/libhttpserver/Dockerfile @@ -0,0 +1,23 @@ +# Copyright 2020 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +FROM gcr.io/oss-fuzz-base/base-builder +RUN apt-get update && apt-get install -y make autoconf automake libtool +RUN apt-get install -y libgnutls-dev wget curl +RUN wget --no-check-certificate https://ftpmirror.gnu.org/libmicrohttpd/libmicrohttpd-latest.tar.gz +RUN git clone --depth 1 --branch fuzzing_PR https://github.com/sgbhat2/libhttpserver.git libhttpserver +WORKDIR libhttpserver +COPY build.sh $SRC/ diff --git a/projects/libhttpserver/build.sh b/projects/libhttpserver/build.sh new file mode 100755 index 000000000000..33f701a737be --- /dev/null +++ b/projects/libhttpserver/build.sh @@ -0,0 +1,34 @@ +#!/bin/bash -eu +# Copyright 2020 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +cd $SRC +tar -xf libmicrohttpd-latest.tar.gz +cd libmicrohttpd* +./configure +make +make install + +cd $SRC/libhttpserver +./bootstrap +mkdir build; cd build +../configure --enable-shared=no +make +make install + +cd ../test/fuzz +$CXX $CXXFLAGS -std=c++11 basic_fuzzer.cc -o $OUT/basic_fuzzer $LIB_FUZZING_ENGINE /usr/local/lib/libhttpserver.a /usr/local/lib/libmicrohttpd.a -lgnutls +cp *.zip $OUT diff --git a/projects/libhttpserver/project.yaml b/projects/libhttpserver/project.yaml new file mode 100644 index 000000000000..dc0f52872a6c --- /dev/null +++ b/projects/libhttpserver/project.yaml @@ -0,0 +1,6 @@ +homepage: "https://github.com/etr/libhttpserver" +language: c++ +primary_contact: "electrictwister2000@gmail.com" +auto_ccs: "shilpa.bhat11@gmail.com" +sanitizers: + - address From baa0469b469f488dbe2281955833bebbaca24186 Mon Sep 17 00:00:00 2001 From: Shilpasri G Bhat Date: Sun, 29 Nov 2020 20:48:33 -0600 Subject: [PATCH 2/4] Fix indentation of auto_ccs --- projects/libhttpserver/project.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/projects/libhttpserver/project.yaml b/projects/libhttpserver/project.yaml index dc0f52872a6c..d2be8923c210 100644 --- a/projects/libhttpserver/project.yaml +++ b/projects/libhttpserver/project.yaml @@ -1,6 +1,7 @@ homepage: "https://github.com/etr/libhttpserver" language: c++ primary_contact: "electrictwister2000@gmail.com" -auto_ccs: "shilpa.bhat11@gmail.com" +auto_ccs: + - "shilpa.bhat11@gmail.com" sanitizers: - address From 2e15b7512d1d0640f23109debedd87b5d499d02f Mon Sep 17 00:00:00 2001 From: Shilpasri G Bhat Date: Sat, 12 Dec 2020 18:51:38 -0600 Subject: [PATCH 3/4] Add new fuzz target --- projects/libhttpserver/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/projects/libhttpserver/build.sh b/projects/libhttpserver/build.sh index 33f701a737be..b314ed573be6 100755 --- a/projects/libhttpserver/build.sh +++ b/projects/libhttpserver/build.sh @@ -31,4 +31,5 @@ make install cd ../test/fuzz $CXX $CXXFLAGS -std=c++11 basic_fuzzer.cc -o $OUT/basic_fuzzer $LIB_FUZZING_ENGINE /usr/local/lib/libhttpserver.a /usr/local/lib/libmicrohttpd.a -lgnutls +$CXX $CXXFLAGS -std=c++11 ip_representation.cc -o $OUT/ip_representation $LIB_FUZZING_ENGINE /usr/local/lib/libhttpserver.a /usr/local/lib/libmicrohttpd.a -lgnutls cp *.zip $OUT From 4fb0bacc89e78de125ba4d064ee043fee13ce56e Mon Sep 17 00:00:00 2001 From: Shilpasri G Bhat Date: Sat, 12 Dec 2020 19:13:56 -0600 Subject: [PATCH 4/4] add main_repo --- projects/libhttpserver/project.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/projects/libhttpserver/project.yaml b/projects/libhttpserver/project.yaml index d2be8923c210..255e12875121 100644 --- a/projects/libhttpserver/project.yaml +++ b/projects/libhttpserver/project.yaml @@ -1,4 +1,5 @@ homepage: "https://github.com/etr/libhttpserver" +main_repo: "https://github.com/etr/libhttpserver" language: c++ primary_contact: "electrictwister2000@gmail.com" auto_ccs: