# HG changeset patch # User Matt Johnston # Date 1615104385 -28800 # Node ID 1a22de6a6b1adff8192ba784c7d2557c55bbfba2 # Parent 6b857c4abe66bee769c1d3e1293b7b85d1c9cc5b Script to fetch new corpus and update the repository diff -r 6b857c4abe66 -r 1a22de6a6b1a fetch.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fetch.sh Sun Mar 07 16:06:25 2021 +0800 @@ -0,0 +1,30 @@ +#!/bin/sh + +# Fetch new corpus from oss-fuzz and update the repository. Make sure you commit first! + +# Before running you need to set up gcloud auth + +set -x +set -e + +FUZZERS=$(make list-fuzz-targets) + +rm -rf dl +mkdir dl +for F in $FUZZERS; do + gsutil cp gs://dropbear-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/dropbear_$F/latest.zip dl/$F.zip +done + +# need to use "xargs -n 200" to avoid "argument list too long" +rm -rf old +mkdir old +for F in $FUZZERS; do + mkdir old/$F + # 40 characters is a hash - those filenames came from a previous corpus + # we want to keep manually named files which are handcrafted seeds + echo $F/???????????????????????????????????????? | xargs -n 200 rm || true + # unzip overwrite, quiet + (cd $F; unzip -o -q ../dl/$F.zip) +done + +hg addremove $FUZZERS