Problem
If a user does not have proper authorization to an SSH host, the sshtun.StateStarted is still being reported as if the connection was successful.
There is no error reported by sshtun and trying to access the forwarded port results in a debug log message similar to "Accepted connection from 127.0.0.1:6753" but the forwarded port never responds.
Expected Result
sshtun should either return an error upon calling sshtun.Start if the authentication is unsuccessful or at the very least not report sshtun.StateStarted.
Upon further inspection, it seems that the Mutex is never unlocked before calling tun.errStarted in the forward function. Calling tun.Unlock before tun.errStarted and then tun.Lock after, the behavior is correct.
Problem If a user does not have proper authorization to an SSH host, the sshtun.StateStarted is still being reported as if the connection was successful.
There is no error reported by sshtun and trying to access the forwarded port results in a debug log message similar to "Accepted connection from 127.0.0.1:6753" but the forwarded port never responds.
Expected Result sshtun should either return an error upon calling sshtun.Start if the authentication is unsuccessful or at the very least not report sshtun.StateStarted.