private boolean isValid(IQ packet) {
        if (packet.getType() != IQ.Type.result)
            return false;

        final EntityCapabilities original = verAttributes.get(packet.getID());
        if (original == null) {
            return false;
        }
        final String newVerHash = generateVerHash(packet, original.getHashAttribute());

        return newVerHash.equals(original.getVerAttribute());
    }
Determines whether the packet received from a disco#info result
was valid by comparing its 'ver' hash (identities+features encapsulated
hash) with the 'ver' hash of the original caps packet that the
disco#info query was sent on behalf of.

@param packet the disco#info result packet.
@return true if the packet's generated 'ver' hash matches the 'ver'
        hash of the original CAPS packet.
xmppserver/src/main/java/org/jivesoftware/openfire/entitycaps/EntityCapabilitiesManager.java