# File lib/net/ssh/host-key-verifier.rb, line 7
      def verify(arguments)
        # first, find any matches on hostname+port
        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

        # we've never seen this host before, so just automatically add the key.
        # not the most secure option (since the first hit might be the one that
        # is hacked), but since almost nobody actually compares the key
        # fingerprint, this is a reasonable compromise between usability and
        # security.
        if matches.empty?
          add_key(arguments)
          return true
        end

        # If we found any matches, check to see that the key type and
        # blob also match.
        found = matches.any? do |item|
            item[:type] == arguments[:key].ssh_type &&
            item[:key]  == arguments[:key_blob]
          end

        # If a match was found, return true. Otherwise, raise an exception
        # indicating that the key was not recognized.
        found || process_cache_miss(arguments)
      end