diff --git a/proxy/socks/protocol/socks_fuzz_test.go b/proxy/socks/protocol/socks_fuzz_test.go new file mode 100644 index 000000000..d8ed17686 --- /dev/null +++ b/proxy/socks/protocol/socks_fuzz_test.go @@ -0,0 +1,28 @@ +package protocol + +import ( + "crypto/rand" + "testing" +) + +const ( + Iterations = int(500000) +) + +func TestReadAuthentication(t *testing.T) { + for i := 0; i < Iterations; i++ { + ReadAuthentication(rand.Reader) + } +} + +func TestReadUserPassRequest(t *testing.T) { + for i := 0; i < Iterations; i++ { + ReadUserPassRequest(rand.Reader) + } +} + +func TestReadRequest(t *testing.T) { + for i := 0; i < Iterations; i++ { + ReadRequest(rand.Reader) + } +}