aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2014-06-11 15:41:14 +0200
committerHans Nilsson <[email protected]>2014-06-16 11:09:32 +0200
commitc17d8929bbc7b8ada43ca174a74ba672c393a987 (patch)
tree07279783a771cd507caca1dec36dcc7261cf3a1e
parent6c504f08ae5c35d2b86b31a5878d40d7957a3db8 (diff)
downloadotp-c17d8929bbc7b8ada43ca174a74ba672c393a987.tar.gz
otp-c17d8929bbc7b8ada43ca174a74ba672c393a987.tar.bz2
otp-c17d8929bbc7b8ada43ca174a74ba672c393a987.zip
ssh: Accept disconnect msgs without language tag
-rw-r--r--lib/ssh/src/ssh_message.erl9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/ssh/src/ssh_message.erl b/lib/ssh/src/ssh_message.erl
index 8d6c77c0ed..e855f3cb08 100644
--- a/lib/ssh/src/ssh_message.erl
+++ b/lib/ssh/src/ssh_message.erl
@@ -461,6 +461,15 @@ decode(<<?BYTE(?SSH_MSG_DISCONNECT), ?UINT32(Code),
language = Lang
};
+%% Accept bad disconnects from ancient openssh clients that doesn't send language tag. Use english as a work-around.
+decode(<<?BYTE(?SSH_MSG_DISCONNECT), ?UINT32(Code),
+ ?UINT32(Len0), Desc:Len0/binary>>) ->
+ #ssh_msg_disconnect{
+ code = Code,
+ description = unicode:characters_to_list(Desc),
+ language = <<"en">>
+ };
+
decode(<<?SSH_MSG_NEWKEYS>>) ->
#ssh_msg_newkeys{};