tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

cryptofuzz.sh (1245B)


      1 #!/usr/bin/env bash
      2 
      3 source $(dirname "$0")/tools.sh
      4 
      5 # Fetch Cryptofuzz artifact.
      6 if [ "$TASKCLUSTER_ROOT_URL" = "https://taskcluster.net" ] || [ -z "$TASKCLUSTER_ROOT_URL" ]; then
      7    url=https://queue.taskcluster.net/v1/task/$TC_PARENT_TASK_ID/artifacts/public/cryptofuzz.tar.bz2
      8 else
      9    url=$TASKCLUSTER_ROOT_URL/api/queue/v1/task/$TC_PARENT_TASK_ID/artifacts/public/cryptofuzz.tar.bz2
     10 fi
     11 
     12 if [ ! -d "cryptofuzz" ]; then
     13    curl --retry 3 -Lo cryptofuzz.tar.bz2 $url
     14    tar xvjf cryptofuzz.tar.bz2
     15 fi
     16 
     17 # Create and change to corpus directory.
     18 mkdir -p nss/fuzz/corpus/cryptofuzz
     19 pushd nss/fuzz/corpus/cryptofuzz
     20 
     21 # Fetch and unzip the public OSS-Fuzz corpus. Handle the case that the
     22 # corpus may be missing.
     23 code=$(curl -w "%{http_code}" -O "https://storage.googleapis.com/nss-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/nss_cryptofuzz/public.zip")
     24 if [[ $code -eq 200 ]]; then
     25    unzip public.zip
     26 fi
     27 rm -f public.zip
     28 
     29 # Change back to previous working directory.
     30 popd
     31 
     32 # Run Cryptofuzz.
     33 # Decrease the default ASAN quarantine size of 256 MB as we tend to run
     34 # out of memory on 32-bit.
     35 ASAN_OPTIONS="quarantine_size_mb=64" ./cryptofuzz/cryptofuzz -dict="./cryptofuzz/cryptofuzz-dict.txt" "nss/fuzz/corpus/cryptofuzz" "$@"