2023-03-06 16:51:05 +00:00
|
|
|
//go:build gofuzz
|
2020-10-16 10:55:50 +00:00
|
|
|
// +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
|
|
|
|
}
|