forked from google/oss-fuzz
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[go-dns] Adds golang project dns (google#3474)
* Adds golang project dns * Fix auto_ccs syntax * Rename project go-dns with hyphen
- Loading branch information
1 parent
0a6e93a
commit 1cc1638
Showing
3 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |