mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2024-12-05 02:10:18 +01:00
cb6e5cb0c7
* use dep for vendoring * lets encrypt * moved web to transfer.sh-web repo * single command install * added first tests
25 lines
413 B
Go
25 lines
413 B
Go
// +build gofuzz
|
|
|
|
package securecookie
|
|
|
|
var hashKey = []byte("very-secret12345")
|
|
var blockKey = []byte("a-lot-secret1234")
|
|
var s = New(hashKey, blockKey)
|
|
|
|
type Cookie struct {
|
|
B bool
|
|
I int
|
|
S string
|
|
}
|
|
|
|
func Fuzz(data []byte) int {
|
|
datas := string(data)
|
|
var c Cookie
|
|
if err := s.Decode("fuzz", datas, &c); err != nil {
|
|
return 0
|
|
}
|
|
if _, err := s.Encode("fuzz", c); err != nil {
|
|
panic(err)
|
|
}
|
|
return 1
|
|
}
|