Skip to content

Commit 3d5a8ee

Browse files
iseki0gopherbot
authored andcommitted
internal/socks: permit authenticating with an empty password
The behavior is accepted widely, and I found no reason to deny it. Fixes golang/go#57285 Change-Id: I39b07295cc89481ea0d6b70b71f2aa57f1a01407 GitHub-Last-Rev: b00ecb1 GitHub-Pull-Request: #157 Reviewed-on: https://go-review.googlesource.com/c/net/+/457355 Run-TryBot: Damien Neil <dneil@google.com> Auto-Submit: Damien Neil <dneil@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Damien Neil <dneil@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
1 parent 694cff8 commit 3d5a8ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/socks/socks.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ func (up *UsernamePassword) Authenticate(ctx context.Context, rw io.ReadWriter,
289289
case AuthMethodNotRequired:
290290
return nil
291291
case AuthMethodUsernamePassword:
292-
if len(up.Username) == 0 || len(up.Username) > 255 || len(up.Password) == 0 || len(up.Password) > 255 {
292+
if len(up.Username) == 0 || len(up.Username) > 255 || len(up.Password) > 255 {
293293
return errors.New("invalid username/password")
294294
}
295295
b := []byte{authUsernamePasswordVersion}

0 commit comments

Comments
 (0)