class Net::SSH::KnownHosts
def known_host_hash?(hostlist, entries, scanner)
Indicates whether one of the entries matches an hostname that has been
def known_host_hash?(hostlist, entries, scanner) if hostlist.size == 1 && hostlist.first =~ /\A\|1(\|.+){2}\z/ chunks = hostlist.first.split(/\|/) salt = Base64.decode64(chunks[2]) digest = OpenSSL::Digest.new('sha1') entries.each do |entry| hmac = OpenSSL::HMAC.digest(digest, salt, entry) return true if Base64.encode64(hmac).chomp == chunks[3] end end false end