From fdbf040b59626cdf11b729a31ad2d61a89364a61 Mon Sep 17 00:00:00 2001 From: grethy <13621977+grethy@users.noreply.github.com> Date: Mon, 8 Jul 2019 14:16:48 +0100 Subject: [PATCH] Fix return error value when login fails At login failure the returned error is always nil and this creates a connection that is in an invalid state. Fixed the return so that it refers to the correct error value --- session.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/session.go b/session.go index 66fbc42..2b9112c 100644 --- a/session.go +++ b/session.go @@ -207,7 +207,7 @@ loginResponse: } if s.state.err != nil && s.state.err != io.EOF { - return err + return s.state.err } // RSA encryption supported, extract the public key