'Throws a SynapseError if a PDU does not have the correct
signatures.
Returns:
FrozenEvent: Either the given event or it redacted if it failed the
content hash check.'

def _check_sigs_and_hashes(self, pdus):

    redacted_pdus = [prune_event(pdu) for pdu in pdus]
    deferreds = preserve_fn(self.keyring.verify_json_objects_for_server)([(p.origin, p.get_pdu_json()) for p in redacted_pdus])
    def callback(_, pdu, redacted):
        if (not check_event_content_hash(pdu)):
            logger.warn('Event    content    has    been    tampered,    redacting    %s:    %s', pdu.event_id, pdu.get_pdu_json())
            return redacted
        return pdu
    def errback(failure, pdu):
        failure.trap(SynapseError)
        logger.warn('Signature    check    failed    for    %s', pdu.event_id)
        return failure
    for (deferred, pdu, redacted) in zip(deferreds, pdus, redacted_pdus):
        deferred.addCallbacks(callback, errback, callbackArgs=[pdu, redacted], errbackArgs=[pdu])
    return deferreds
