Skip to content

Commit

Permalink
ssh: avoid protocol error on userauth banner
Browse files Browse the repository at this point in the history
SSH servers can send userauth banners at any time during authentication
and the erlang SSH client only accepted userauth banners in some limited
circumstances.

Closes #9065
  • Loading branch information
alexandrejbr committed Dec 3, 2024
1 parent 709aed9 commit f404846
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/ssh/src/ssh_fsm_userauth_client.erl
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ handle_event(internal, #ssh_msg_userauth_failure{authentications = Methods}, Sta
end;

%%---- banner to client
handle_event(internal, #ssh_msg_userauth_banner{message = Msg}, {userauth,client}, D) ->
handle_event(internal, #ssh_msg_userauth_banner{message = Msg}, {S,client}, D)
when S == userauth; S == userauth_keyboard_interactive;
S == userauth_keyboard_interactive_extra;
S == userauth_keyboard_interactive_info_response ->
case D#data.ssh_params#ssh.userauth_quiet_mode of
false -> io:format("~s", [Msg]);
true -> ok
Expand Down

0 comments on commit f404846

Please sign in to comment.