diff --git a/paramiko/hostkeys.py b/paramiko/hostkeys.py index e739312ad..da5b66ccc 100644 --- a/paramiko/hostkeys.py +++ b/paramiko/hostkeys.py @@ -141,6 +141,8 @@ def add(self, hostname, keytype, key): if (hostname in e.hostnames) and (e.key.get_name() == keytype): e.key = key return + if not hostname.startswith('|1|') and hash_hostname: + hostname = self.hash_host(hostname) self._entries.append(HostKeyEntry([hostname], key)) def load(self, filename):