aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh_transport.erl
diff options
context:
space:
mode:
authorFredrik Gustafsson <[email protected]>2012-11-08 13:47:33 +0100
committerFredrik Gustafsson <[email protected]>2013-02-15 11:35:16 +0100
commitdde4bc77cd5be76102cd913c1c931844856ad76e (patch)
tree451efdb56a9723d445d3ff0cf63c7697f5c19c1f /lib/ssh/src/ssh_transport.erl
parentad9e9bc79f01451df7f18f79a9b44afb71b05851 (diff)
downloadotp-dde4bc77cd5be76102cd913c1c931844856ad76e.tar.gz
otp-dde4bc77cd5be76102cd913c1c931844856ad76e.tar.bz2
otp-dde4bc77cd5be76102cd913c1c931844856ad76e.zip
Returning the actual reason why key exchange failed
Diffstat (limited to 'lib/ssh/src/ssh_transport.erl')
-rw-r--r--lib/ssh/src/ssh_transport.erl10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/ssh/src/ssh_transport.erl b/lib/ssh/src/ssh_transport.erl
index 1abb69921d..8f81cdde5e 100644
--- a/lib/ssh/src/ssh_transport.erl
+++ b/lib/ssh/src/ssh_transport.erl
@@ -356,12 +356,18 @@ handle_kexdh_reply(#ssh_msg_kexdh_reply{public_host_key = HostKey, f = F,
{ok, SshPacket, Ssh#ssh{shared_secret = K,
exchanged_hash = H,
session_id = sid(Ssh, H)}};
- _Error ->
+ Error ->
Disconnect = #ssh_msg_disconnect{
code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
description = "Key exchange failed",
language = "en"},
- throw(Disconnect)
+ ErrorMsg = case Error of
+ {error, rejected} ->
+ {error, {rejected, {hostkey, HostKey}}};
+ _ ->
+ Error
+ end,
+ throw({ErrorMsg, Disconnect})
end.
handle_kex_dh_gex_request(#ssh_msg_kex_dh_gex_request{min = _Min,