Cloak/internal/multiplex/session_fuzz.go

24 lines
435 B
Go
Raw Normal View History

// +build gofuzz
2020-10-16 10:51:53 +00:00
package multiplex
func setupSesh_fuzz(unordered bool) *Session {
2020-10-21 15:42:24 +00:00
obfuscator, _ := MakeObfuscator(EncryptionMethodPlain, [32]byte{})
2020-10-16 10:51:53 +00:00
seshConfig := SessionConfig{
Obfuscator: obfuscator,
Valve: nil,
Unordered: unordered,
}
return MakeSession(0, seshConfig)
}
func Fuzz(data []byte) int {
sesh := setupSesh_fuzz(false)
err := sesh.recvDataFromRemote(data)
if err == nil {
return 1
}
return 0
}