mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2024-11-23 12:53:23 +00:00
98263a7de6
* start fixing up tests * fix up tests + automate with drone * fiddle with linting * messing about with drone.yml * some more fiddling * hmmm * add cache * add vendor directory * verbose * ci updates * update some little things * update sig
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
|
|
}
|