Skip to content

Commit

Permalink
ssh: accept WSAECONNABORTED in TestClientAuthMaxAuthTriesPublicKey
Browse files Browse the repository at this point in the history
Fixes golang/go#50805

Change-Id: Icdd2835b1626240faf61936288f279570c873158
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/381614
Trust: Ian Lance Taylor <[email protected]>
Run-TryBot: Ian Lance Taylor <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Roland Shoemaker <[email protected]>
  • Loading branch information
ianlancetaylor authored and owenthereal committed Mar 5, 2022
1 parent f3933d2 commit a6d4f84
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion ssh/client_auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"log"
"net"
"os"
"runtime"
"strings"
"testing"
)
Expand Down Expand Up @@ -639,7 +640,15 @@ func TestClientAuthMaxAuthTriesPublicKey(t *testing.T) {
if err := tryAuth(t, invalidConfig); err == nil {
t.Fatalf("client: got no error, want %s", expectedErr)
} else if err.Error() != expectedErr.Error() {
t.Fatalf("client: got %s, want %s", err, expectedErr)
// On Windows we can see a WSAECONNABORTED error
// if the client writes another authentication request
// before the client goroutine reads the disconnection
// message. See issue 50805.
if runtime.GOOS == "windows" && strings.Contains(err.Error(), "wsarecv: An established connection was aborted") {
// OK.
} else {
t.Fatalf("client: got %s, want %s", err, expectedErr)
}
}
}

Expand Down

0 comments on commit a6d4f84

Please sign in to comment.