mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2024-12-25 20:00:19 +01:00
Configure Fuzzit
This commit is contained in:
parent
6b148d3574
commit
76f00c5d04
2 changed files with 53 additions and 0 deletions
15
.travis.yml
15
.travis.yml
|
@ -4,6 +4,9 @@ sudo: false
|
|||
os:
|
||||
- linux
|
||||
|
||||
services:
|
||||
- docker
|
||||
|
||||
go:
|
||||
- 1.10.x
|
||||
- 1.11.x
|
||||
|
@ -19,6 +22,18 @@ script:
|
|||
- go vet ./...
|
||||
- go test ./...
|
||||
|
||||
jobs:
|
||||
include:
|
||||
- stage: Fuzz regression
|
||||
go: 1.12.x
|
||||
dist: bionic
|
||||
script: ./fuzzit.sh local-regression
|
||||
- stage: Fuzz
|
||||
if: branch = master AND type IN (push)
|
||||
go: 1.12.x
|
||||
dist: bionic
|
||||
script: ./fuzzit.sh fuzzing
|
||||
|
||||
before_deploy:
|
||||
- mkdir -p release
|
||||
- "GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags -a -tags netgo -ldflags '-s -w -extldflags -static' -o release/transfersh-$TRAVIS_TAG-linux-amd64"
|
||||
|
|
38
fuzzit.sh
Executable file
38
fuzzit.sh
Executable file
|
@ -0,0 +1,38 @@
|
|||
#!/bin/bash
|
||||
set -xe
|
||||
|
||||
# Validate arguments
|
||||
if [ "$#" -ne 1 ]; then
|
||||
echo "Usage: $0 <fuzz-type>"
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "$FUZZIT_API_KEY" ]; then
|
||||
echo "Set FUZZIT_API_KEY to your Fuzzit API key"
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Configure
|
||||
ROOT=./server
|
||||
TYPE=$1
|
||||
|
||||
# Setup
|
||||
export GO111MODULE="off"
|
||||
go get -u github.com/dvyukov/go-fuzz/go-fuzz github.com/dvyukov/go-fuzz/go-fuzz-build
|
||||
go get -d -v -u ./...
|
||||
if [ ! -f fuzzit ]; then
|
||||
wget -q -O fuzzit https://github.com/fuzzitdev/fuzzit/releases/download/v2.4.29/fuzzit_Linux_x86_64
|
||||
chmod a+x fuzzit
|
||||
fi
|
||||
|
||||
# Fuzz
|
||||
function fuzz {
|
||||
FUNC=Fuzz$1
|
||||
TARGET=$2
|
||||
DIR=${3:-$ROOT}
|
||||
go-fuzz-build -libfuzzer -func $FUNC -o fuzzer.a $DIR
|
||||
clang -fsanitize=fuzzer fuzzer.a -o fuzzer
|
||||
./fuzzit create job --type $TYPE $TARGET fuzzer
|
||||
}
|
||||
fuzz Profile profile
|
||||
fuzz HTTP http
|
||||
fuzz HTTPS https
|
Loading…
Reference in a new issue