diff options
author | Fredrik Gustafsson <[email protected]> | 2013-06-27 18:49:07 +0200 |
---|---|---|
committer | Fredrik Gustafsson <[email protected]> | 2013-06-27 18:49:07 +0200 |
commit | dc5e0ede0f692000afc60c64ec428ea81ce67040 (patch) | |
tree | a53ccfdb018c432e1cd953dc9395c9af4bd54111 /lib/ssh/src/ssh_connection_handler.erl | |
parent | 48c0c1699cff4ebd7e6750af4f1085ed9a48d005 (diff) | |
download | otp-dc5e0ede0f692000afc60c64ec428ea81ce67040.tar.gz otp-dc5e0ede0f692000afc60c64ec428ea81ce67040.tar.bz2 otp-dc5e0ede0f692000afc60c64ec428ea81ce67040.zip |
ssh: fixed bad match failure when disconnect msg
Diffstat (limited to 'lib/ssh/src/ssh_connection_handler.erl')
-rw-r--r-- | lib/ssh/src/ssh_connection_handler.erl | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/ssh/src/ssh_connection_handler.erl b/lib/ssh/src/ssh_connection_handler.erl index d8950a7b67..0ec0424f74 100644 --- a/lib/ssh/src/ssh_connection_handler.erl +++ b/lib/ssh/src/ssh_connection_handler.erl @@ -419,10 +419,16 @@ userauth(#ssh_msg_userauth_failure{authentications = Methodes}, #state{ssh_params = #ssh{role = client, userauth_methods = none} = Ssh0} = State) -> AuthMethods = string:tokens(Methodes, ","), - {Msg, Ssh} = ssh_auth:userauth_request_msg( - Ssh0#ssh{userauth_methods = AuthMethods}), - send_msg(Msg, State), - {next_state, userauth, next_packet(State#state{ssh_params = Ssh})}; + case ssh_auth:userauth_request_msg( + Ssh0#ssh{userauth_methods = AuthMethods}) of + {disconnect, DisconnectMsg,{Msg, Ssh}} -> + send_msg(Msg, State), + handle_disconnect(DisconnectMsg, State#state{ssh_params = Ssh}); + {Msg, Ssh} -> + send_msg(Msg, State), + {next_state, userauth, next_packet(State#state{ssh_params = Ssh})} + end; + %% The prefered authentication method failed try next method userauth(#ssh_msg_userauth_failure{}, |