aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh_connection_handler.erl
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2015-11-06 10:33:16 +0100
committerHans Nilsson <[email protected]>2015-11-06 10:33:16 +0100
commit6f760fcaf2608cc25684e17660a95e51f080c7af (patch)
tree0b866bdbbd0c5c81afd6c999404445cf55ffcb47 /lib/ssh/src/ssh_connection_handler.erl
parent98ce5c34a27b3fd95febba5c44d87bfdbd40a822 (diff)
parent6ce8f9278b937b607be4c925c2b711cb163519fc (diff)
downloadotp-6f760fcaf2608cc25684e17660a95e51f080c7af.tar.gz
otp-6f760fcaf2608cc25684e17660a95e51f080c7af.tar.bz2
otp-6f760fcaf2608cc25684e17660a95e51f080c7af.zip
Merge branch 'maint'
* maint: ssh: changes after doc review ssh: Document pwdfun ssh: make corrections of keyboard-interactive client ssh: enable users to give option keyboard_interact_fun ssh: pwdfun/4 and simple tests
Diffstat (limited to 'lib/ssh/src/ssh_connection_handler.erl')
-rw-r--r--lib/ssh/src/ssh_connection_handler.erl18
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/ssh/src/ssh_connection_handler.erl b/lib/ssh/src/ssh_connection_handler.erl
index 7fb86c1108..a2d1b5b810 100644
--- a/lib/ssh/src/ssh_connection_handler.erl
+++ b/lib/ssh/src/ssh_connection_handler.erl
@@ -627,14 +627,24 @@ userauth_keyboard_interactive(#ssh_msg_userauth_info_response{} = Msg,
retry_fun(User, Address, Reason, Opts),
send_msg(Reply, State),
{next_state, userauth, next_packet(State#state{ssh_params = Ssh})}
- end.
-
+ end;
+userauth_keyboard_interactive(Msg = #ssh_msg_userauth_failure{},
+ #state{ssh_params = Ssh0 =
+ #ssh{role = client,
+ userauth_preference = Prefs0}}
+ = State) ->
+ Prefs = [{Method,M,F,A} || {Method,M,F,A} <- Prefs0,
+ Method =/= "keyboard-interactive"],
+ userauth(Msg, State#state{ssh_params = Ssh0#ssh{userauth_preference=Prefs}}).
+
-userauth_keyboard_interactive_info_response(Msg=#ssh_msg_userauth_failure{}, State) ->
+userauth_keyboard_interactive_info_response(Msg=#ssh_msg_userauth_failure{},
+ #state{ssh_params = #ssh{role = client}} = State) ->
userauth(Msg, State);
-userauth_keyboard_interactive_info_response(Msg=#ssh_msg_userauth_success{}, State) ->
+userauth_keyboard_interactive_info_response(Msg=#ssh_msg_userauth_success{},
+ #state{ssh_params = #ssh{role = client}} = State) ->
userauth(Msg, State).
%%--------------------------------------------------------------------