You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

26 lines
413 B

  1. // +build gofuzz
  2. package securecookie
  3. var hashKey = []byte("very-secret12345")
  4. var blockKey = []byte("a-lot-secret1234")
  5. var s = New(hashKey, blockKey)
  6. type Cookie struct {
  7. B bool
  8. I int
  9. S string
  10. }
  11. func Fuzz(data []byte) int {
  12. datas := string(data)
  13. var c Cookie
  14. if err := s.Decode("fuzz", datas, &c); err != nil {
  15. return 0
  16. }
  17. if _, err := s.Encode("fuzz", c); err != nil {
  18. panic(err)
  19. }
  20. return 1
  21. }