Skip to content

Commit

Permalink
Store hostname hashes in memory rathen than the non-hashed host entri…
Browse files Browse the repository at this point in the history
…es. Also assures that the host entries in known_hosts get saved in hashed format as it is currently standard in OpenSSH.
  • Loading branch information
sunweaver authored and bitprophet committed Apr 28, 2013
1 parent b329512 commit 4f481a5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions paramiko/hostkeys.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 4f481a5

Please sign in to comment.