aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorFredrik Gustafsson <[email protected]>2013-01-21 11:22:13 +0100
committerFredrik Gustafsson <[email protected]>2013-01-21 11:22:13 +0100
commit65c7e90605fc653c5a4a19e91334bd29c981f02d (patch)
tree4d06392a8baf43ccc288cd9a09601c1155dcbaef /lib
parent583ca8a0a86ad8ddfe4dc71c9f030f456fb8cc99 (diff)
parent1f53eb8d0fb0b4953c3a9cca230c0be9b908661e (diff)
downloadotp-65c7e90605fc653c5a4a19e91334bd29c981f02d.tar.gz
otp-65c7e90605fc653c5a4a19e91334bd29c981f02d.tar.bz2
otp-65c7e90605fc653c5a4a19e91334bd29c981f02d.zip
Merge branch 'fredrik/ssh/ssh-internal-error/OTP-10731'
* fredrik/ssh/ssh-internal-error/OTP-10731: Fixed internal error on when client and server can not agree o which authmethod to use
Diffstat (limited to 'lib')
-rw-r--r--lib/ssh/src/ssh_connection_handler.erl14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/ssh/src/ssh_connection_handler.erl b/lib/ssh/src/ssh_connection_handler.erl
index 88b45111ff..9378686242 100644
--- a/lib/ssh/src/ssh_connection_handler.erl
+++ b/lib/ssh/src/ssh_connection_handler.erl
@@ -422,11 +422,15 @@ 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})};
-
+ Ssh1 = Ssh0#ssh{userauth_methods = AuthMethods},
+ case ssh_auth:userauth_request_msg(Ssh1) 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{},
#state{ssh_params = #ssh{role = client} = Ssh0} = State) ->