diff options
author | Erlang/OTP <[email protected]> | 2019-04-24 15:05:50 +0200 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2019-04-24 15:05:50 +0200 |
commit | 6382808213640ea67514f7919668701d5dd2ee7d (patch) | |
tree | 9043dc669b45f0f1f355c52445889d501665b62f /lib/ssh/src/ssh_connection_handler.erl | |
parent | 98669a56d4cacf5bf6c7413d264dc50289f84bb9 (diff) | |
parent | 167892981042f4a5eb4ac76a1e5a532d5ce65b65 (diff) | |
download | otp-6382808213640ea67514f7919668701d5dd2ee7d.tar.gz otp-6382808213640ea67514f7919668701d5dd2ee7d.tar.bz2 otp-6382808213640ea67514f7919668701d5dd2ee7d.zip |
Merge branch 'hans/ssh/hex_dump_info/OTP-15772' into maint-21
* hans/ssh/hex_dump_info/OTP-15772:
ssh: Dump 64 bytes in case of unexpected info line
ssh: Add hexdump utility in ssh_dbg
Diffstat (limited to 'lib/ssh/src/ssh_connection_handler.erl')
-rw-r--r-- | lib/ssh/src/ssh_connection_handler.erl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/ssh/src/ssh_connection_handler.erl b/lib/ssh/src/ssh_connection_handler.erl index 7c87591cf2..8f32966a12 100644 --- a/lib/ssh/src/ssh_connection_handler.erl +++ b/lib/ssh/src/ssh_connection_handler.erl @@ -594,7 +594,7 @@ handle_event(_, socket_control, {hello,_}=StateName, D) -> {stop, {shutdown,{unexpected_getopts_return, Other}}} end; -handle_event(_, {info_line,_Line}, {hello,Role}=StateName, D) -> +handle_event(_, {info_line,Line}, {hello,Role}=StateName, D) -> case Role of client -> %% The server may send info lines to the client before the version_exchange @@ -605,9 +605,9 @@ handle_event(_, {info_line,_Line}, {hello,Role}=StateName, D) -> %% But the client may NOT send them to the server. Openssh answers with cleartext, %% and so do we send_bytes("Protocol mismatch.", D), - ?call_disconnectfun_and_log_cond("Protocol mismatch.", - "Protocol mismatch in version exchange. Client sent info lines.", - StateName, D), + Msg = io_lib:format("Protocol mismatch in version exchange. Client sent info lines.~n~s", + [ssh_dbg:hex_dump(Line, 64)]), + ?call_disconnectfun_and_log_cond("Protocol mismatch.", Msg, StateName, D), {stop, {shutdown,"Protocol mismatch in version exchange. Client sent info lines."}} end; |