Skip to content

Commit

Permalink
internal/socks: permit authenticating with an empty password
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
iseki0 authored and gopherbot committed Apr 7, 2023
1 parent 694cff8 commit 3d5a8ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/socks/socks.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func (up *UsernamePassword) Authenticate(ctx context.Context, rw io.ReadWriter,
case AuthMethodNotRequired:
return nil
case AuthMethodUsernamePassword:
if len(up.Username) == 0 || len(up.Username) > 255 || len(up.Password) == 0 || len(up.Password) > 255 {
if len(up.Username) == 0 || len(up.Username) > 255 || len(up.Password) > 255 {
return errors.New("invalid username/password")
}
b := []byte{authUsernamePasswordVersion}
Expand Down

0 comments on commit 3d5a8ee

Please sign in to comment.