From f4048463be9891ccd66aea5c4dfd3088efc2d7d5 Mon Sep 17 00:00:00 2001 From: Alexandre Rodrigues Date: Tue, 3 Dec 2024 20:14:59 +0100 Subject: [PATCH] ssh: avoid protocol error on userauth banner 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 --- lib/ssh/src/ssh_fsm_userauth_client.erl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ssh/src/ssh_fsm_userauth_client.erl b/lib/ssh/src/ssh_fsm_userauth_client.erl index 362747d02d47..a252b95bd836 100644 --- a/lib/ssh/src/ssh_fsm_userauth_client.erl +++ b/lib/ssh/src/ssh_fsm_userauth_client.erl @@ -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