annotate fetch.sh @ 25:0ef1e51e583f default tip

Add some more pubkey options to the dict
author Matt Johnston <matt@ucc.asn.au>
date Thu, 27 Oct 2022 19:09:07 +0800
parents 4032153b8b7a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
21
1a22de6a6b1a Script to fetch new corpus and update the repository
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
1 #!/bin/sh
1a22de6a6b1a Script to fetch new corpus and update the repository
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
2
1a22de6a6b1a Script to fetch new corpus and update the repository
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
3 # Fetch new corpus from oss-fuzz and update the repository. Make sure you commit first!
1a22de6a6b1a Script to fetch new corpus and update the repository
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
4
1a22de6a6b1a Script to fetch new corpus and update the repository
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
5 # Before running you need to set up gcloud auth
1a22de6a6b1a Script to fetch new corpus and update the repository
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
6
1a22de6a6b1a Script to fetch new corpus and update the repository
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
7 set -x
1a22de6a6b1a Script to fetch new corpus and update the repository
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
8 set -e
1a22de6a6b1a Script to fetch new corpus and update the repository
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
9
1a22de6a6b1a Script to fetch new corpus and update the repository
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
10 FUZZERS=$(make list-fuzz-targets)
1a22de6a6b1a Script to fetch new corpus and update the repository
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
11
1a22de6a6b1a Script to fetch new corpus and update the repository
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
12 rm -rf dl
1a22de6a6b1a Script to fetch new corpus and update the repository
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
13 mkdir dl
1a22de6a6b1a Script to fetch new corpus and update the repository
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
14 for F in $FUZZERS; do
1a22de6a6b1a Script to fetch new corpus and update the repository
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
15 gsutil cp gs://dropbear-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/dropbear_$F/latest.zip dl/$F.zip
1a22de6a6b1a Script to fetch new corpus and update the repository
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
16 done
1a22de6a6b1a Script to fetch new corpus and update the repository
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
17
1a22de6a6b1a Script to fetch new corpus and update the repository
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
18 # need to use "xargs -n 200" to avoid "argument list too long"
1a22de6a6b1a Script to fetch new corpus and update the repository
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
19 for F in $FUZZERS; do
1a22de6a6b1a Script to fetch new corpus and update the repository
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
20 # 40 characters is a hash - those filenames came from a previous corpus
1a22de6a6b1a Script to fetch new corpus and update the repository
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
21 # we want to keep manually named files which are handcrafted seeds
1a22de6a6b1a Script to fetch new corpus and update the repository
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
22 echo $F/???????????????????????????????????????? | xargs -n 200 rm || true
1a22de6a6b1a Script to fetch new corpus and update the repository
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
23 # unzip overwrite, quiet
1a22de6a6b1a Script to fetch new corpus and update the repository
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
24 (cd $F; unzip -o -q ../dl/$F.zip)
1a22de6a6b1a Script to fetch new corpus and update the repository
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
25 done
1a22de6a6b1a Script to fetch new corpus and update the repository
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
26
1a22de6a6b1a Script to fetch new corpus and update the repository
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
27 hg addremove $FUZZERS