diff options
author | Hans Nilsson <[email protected]> | 2019-04-24 14:52:02 +0200 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2019-04-24 14:52:02 +0200 |
commit | a21ad3ee86e89ee8a73f6b9279e689eaae80376d (patch) | |
tree | 2efc724e9adebb629a7b77b30c86f91ed5cee4fe /lib/ssh/src/ssh_connection_handler.erl | |
parent | c302bd7493179e62ef0c3a5e1f9b19ed895ec5e1 (diff) | |
parent | 62f78b258e83871458ccd3599dbbcc5585ca4104 (diff) | |
download | otp-a21ad3ee86e89ee8a73f6b9279e689eaae80376d.tar.gz otp-a21ad3ee86e89ee8a73f6b9279e689eaae80376d.tar.bz2 otp-a21ad3ee86e89ee8a73f6b9279e689eaae80376d.zip |
Merge branch 'maint'
* maint:
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; |