def verify(arguments)
matches = keys.select do |item|
host = item[:host] || arguments[:peer][:host]
ip = item[:ip] || arguments[:peer][:ip]
port = item[:port] || arguments[:peer][:port]
type = item[:type] || arguments[:peer][:type]
host == arguments[:peer][:host] &&
ip == arguments[:peer][:ip] &&
port == arguments[:peer][:port] &&
type == arguments[:key].ssh_type
end
if matches.empty?
add_key(arguments)
return true
end
found = matches.any? do |item|
item[:type] == arguments[:key].ssh_type &&
item[:key] == arguments[:key_blob]
end
found || process_cache_miss(arguments)
end