Package: python-paramiko
Version: 1.7.7.1-2
Severity: important
Tags: upstream patch
in lines 307-310 in client.py, the hostname is rewritten
to "[origname]:portnumber" if the port isn't 22.
this serves no useful purpose at all, and it breaks
the lookup for the host key that is attempted on the next few
lines: that now fails as the ssh known hosts format allows
hostnames or ip addresses, nothing else (and certainly
not '[hostname]:port').
result: you get a "unknown server" exception (unless you enable the
only-warn missing host key policy).
the attached patch removes the problematic hostname rewriting.
regards
az
--- client.py.orig 2012-04-10 11:59:19.892476651 +1000
+++ client.py 2012-04-10 11:59:58.743449158 +1000
@@ -303,11 +303,7 @@
server_key = t.get_remote_server_key()
keytype = server_key.get_name()
-
- if port == SSH_PORT:
- server_hostkey_name = hostname
- else:
- server_hostkey_name = "[%s]:%d" % (hostname, port)
+ server_hostkey_name = hostname
our_server_key = self._system_host_keys.get(server_hostkey_name,
{}).get(keytype, None)
if our_server_key is None:
our_server_key = self._host_keys.get(server_hostkey_name,
{}).get(keytype, None)