1#!/bin/bash 2# Copyright 2020 Google Inc. 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15# 16################################################################################ 17 18set -ex 19 20( 21cd qpack 22# Fuzz qpack 23compile_go_fuzzer github.com/marten-seemann/qpack/fuzzing Fuzz qpack_fuzzer 24) 25 26( 27cd quic-go 28# Fuzz quic-go 29compile_go_fuzzer github.com/lucas-clemente/quic-go/fuzzing/frames Fuzz frame_fuzzer 30compile_go_fuzzer github.com/lucas-clemente/quic-go/fuzzing/header Fuzz header_fuzzer 31compile_go_fuzzer github.com/lucas-clemente/quic-go/fuzzing/transportparameters Fuzz transportparameter_fuzzer 32compile_go_fuzzer github.com/lucas-clemente/quic-go/fuzzing/tokens Fuzz token_fuzzer 33compile_go_fuzzer github.com/lucas-clemente/quic-go/fuzzing/handshake Fuzz handshake_fuzzer 34 35if [ $SANITIZER == "coverage" ]; then 36 # no need for corpuses if coverage 37 exit 0 38fi 39# generate seed corpora 40go generate ./fuzzing/... 41 42zip --quiet -r $OUT/header_fuzzer_seed_corpus.zip fuzzing/header/corpus 43zip --quiet -r $OUT/frame_fuzzer_seed_corpus.zip fuzzing/frames/corpus 44zip --quiet -r $OUT/transportparameter_fuzzer_seed_corpus.zip fuzzing/transportparameters/corpus 45zip --quiet -r $OUT/handshake_fuzzer_seed_corpus.zip fuzzing/handshake/corpus 46) 47 48# for debugging 49ls -al $OUT 50