summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/net/ssh/known_hosts.rb4
-rw-r--r--lib/net/ssh/verifiers/secure.rb2
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?