diff options
author | 2020-03-09 16:33:02 +0100 | |
---|---|---|
committer | 2020-03-09 08:33:02 -0700 | |
commit | 1cc1638224a0f57c702abd57f7b40e5b78a13611 (patch) | |
tree | 87fb245d7de8654ff020dae0e2b22db2b6a0f29e /projects/go-dns | |
parent | 0a6e93ad77e378d13dd0e09b45e1c69255cc85c9 (diff) |
[go-dns] Adds golang project dns (#3474)
* Adds golang project dns
* Fix auto_ccs syntax
* Rename project go-dns with hyphen
Diffstat (limited to 'projects/go-dns')
-rw-r--r-- | projects/go-dns/Dockerfile | 22 | ||||
-rwxr-xr-x | projects/go-dns/build.sh | 33 | ||||
-rw-r--r-- | projects/go-dns/project.yaml | 9 |
3 files changed, 64 insertions, 0 deletions
diff --git a/projects/go-dns/Dockerfile b/projects/go-dns/Dockerfile new file mode 100644 index 00000000..84206b4a --- /dev/null +++ b/projects/go-dns/Dockerfile @@ -0,0 +1,22 @@ +# 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 +MAINTAINER miek@miek.nl +RUN go get -t github.com/miekg/dns + +COPY build.sh $SRC/ +WORKDIR $SRC/ diff --git a/projects/go-dns/build.sh b/projects/go-dns/build.sh new file mode 100755 index 00000000..26be8083 --- /dev/null +++ b/projects/go-dns/build.sh @@ -0,0 +1,33 @@ +#!/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. +# +################################################################################ + +# build target function +function compile_fuzzer { + path=$1 + function=$2 + fuzzer=$3 + + # Instrument all Go files relevant to this fuzzer + go-fuzz-build -tags fuzz -libfuzzer -func $function -o $fuzzer.a $path + + # Instrumented, compiled Go ($fuzzer.a) + fuzzing engine = fuzzer binary + $CXX $CXXFLAGS $LIB_FUZZING_ENGINE $fuzzer.a -lpthread -o $OUT/$fuzzer +} + +#same as usual except for added -tags fuzz +compile_fuzzer /root/go/src/github.com/miekg/dns/ FuzzNewRR fuzz_newrr +compile_fuzzer /root/go/src/github.com/miekg/dns/ Fuzz fuzz_msg_unpack diff --git a/projects/go-dns/project.yaml b/projects/go-dns/project.yaml new file mode 100644 index 00000000..22cea9e3 --- /dev/null +++ b/projects/go-dns/project.yaml @@ -0,0 +1,9 @@ +homepage: "https://github.com/miekg/dns" +primary_contact: "miek@miek.nl" +auto_ccs : +- "p.antoine@catenacyber.fr" +language: go +fuzzing_engines: +- libfuzzer +sanitizers: +- address |