diff options
author | Miklos Fazekas <mfazekas@szemafor.com> | 2016-03-05 20:19:48 +0100 |
---|---|---|
committer | Miklos Fazekas <mfazekas@szemafor.com> | 2016-03-05 20:19:48 +0100 |
commit | 8d940b7a4e54f8c2e2e6fd4ae80f357dfd9b2e08 (patch) | |
tree | 520d696b9680051e78477b697d162a887f9c1cd2 | |
parent | d1e7f65aa502cd547d847ed45643250113875dd2 (diff) | |
download | net-ssh-8d940b7a4e54f8c2e2e6fd4ae80f357dfd9b2e08.tar.gz |
Fix host_keys issues
-rw-r--r-- | lib/net/ssh/known_hosts.rb | 4 | ||||
-rw-r--r-- | lib/net/ssh/verifiers/secure.rb | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/net/ssh/known_hosts.rb b/lib/net/ssh/known_hosts.rb index dd9864a..f1a1c31 100644 --- a/lib/net/ssh/known_hosts.rb +++ b/lib/net/ssh/known_hosts.rb @@ -24,6 +24,10 @@ module Net; module SSH def each(&block) @host_keys.each(&block) end + + def empty? + @host_keys.empty? + end end # Searches an OpenSSH-style known-host file for a given host, and returns all diff --git a/lib/net/ssh/verifiers/secure.rb b/lib/net/ssh/verifiers/secure.rb index 899fe26..71b7fbb 100644 --- a/lib/net/ssh/verifiers/secure.rb +++ b/lib/net/ssh/verifiers/secure.rb @@ -13,7 +13,7 @@ module Net; module SSH; module Verifiers # Otherwise, this returns true. class Secure def verify(arguments) - host_keys = arguments[:session].host_key + host_keys = arguments[:session].host_keys # We've never seen this host before, so raise an exception. if host_keys.empty? |