1#!/bin/bash -eu 2# Copyright 2018 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 18# build project 19perl scripts/config.pl set MBEDTLS_PLATFORM_TIME_ALT 20mkdir build 21cd build 22cmake .. 23# build including fuzzers 24make -j$(nproc) all 25cp programs/fuzz/fuzz_* $OUT/ 26 27# build corpuses 28cd ../programs 29cp -r ../../openssl/fuzz/corpora/crl fuzz/corpuses/ 30cp -r ../../openssl/fuzz/corpora/x509 fuzz/corpuses/ 31cp -r ../../boringssl/fuzz/privkey_corpus fuzz/corpuses/ 32cp ../../boringssl/fuzz/cert_corpus/* fuzz/corpuses/x509/ 33zip -r fuzz/fuzz_x509crl_seed_corpus.zip ../tests/data_files/crl* fuzz/corpuses/crl 34zip -r fuzz/fuzz_x509crt_seed_corpus.zip ../tests/data_files/*.crt ../tests/data_files/dir*/*.crt fuzz/corpuses/x509/ 35zip -r fuzz/fuzz_x509csr_seed_corpus.zip ../tests/data_files/*.csr ../tests/data_files/*.req.* 36zip -r fuzz/fuzz_privkey_seed_corpus.zip ../tests/data_files/*.key ../tests/data_files/*.pem fuzz/corpuses/privkey_corpus 37zip -r fuzz/fuzz_pubkey_seed_corpus.zip ../tests/data_files/*.pub ../tests/data_files/*.pubkey 38zip -r fuzz/fuzz_dtlsclient_seed_corpus.zip fuzz/corpuses/dtlsclient 39zip -r fuzz/fuzz_dtlsserver_seed_corpus.zip fuzz/corpuses/dtlsserver 40zip -r fuzz/fuzz_client_seed_corpus.zip fuzz/corpuses/client 41zip -r fuzz/fuzz_server_seed_corpus.zip fuzz/corpuses/server 42 43cd fuzz 44# export other associated stuff 45cp *.options $OUT/ 46cp fuzz_*_seed_corpus.zip $OUT/ 47