'Extract and verify server message.
Args:
response_comms: A ClientCommunication rdfvalue
Returns:
list of messages and the CN where they came from.
Raises:
DecryptionError: If the message failed to decrypt properly.'

def DecodeMessages(self, response_comms):

    cipher_verified = False
    try:
        cipher = self.encrypted_cipher_cache.Get(response_comms.encrypted_cipher)
        stats.STATS.IncrementCounter('grr_encrypted_cipher_cache', fields=['hits'])
        cipher.VerifyReceivedHMAC(response_comms)
        cipher_verified = True
        source = cipher.GetSource()
        remote_public_key = self._GetRemotePublicKey(source)
    except KeyError:
        stats.STATS.IncrementCounter('grr_encrypted_cipher_cache', fields=['misses'])
        cipher = ReceivedCipher(response_comms, self.private_key)
        source = cipher.GetSource()
        try:
            remote_public_key = self._GetRemotePublicKey(source)
            if cipher.VerifyCipherSignature(remote_public_key):
                self.encrypted_cipher_cache.Put(response_comms.encrypted_cipher, cipher)
                cipher_verified = True
        except UnknownClientCert:
            remote_public_key = None
    plain = cipher.Decrypt(response_comms.encrypted, response_comms.packet_iv)
    try:
        signed_message_list = rdf_flows.SignedMessageList.FromSerializedString(plain)
    except rdfvalue.DecodeError as e:
        raise DecryptionError(str(e))
    message_list = self.DecompressMessageList(signed_message_list)
    auth_state = self.VerifyMessageSignature(response_comms, signed_message_list, cipher, cipher_verified, response_comms.api_version, remote_public_key)
    for msg in message_list.job:
        msg.auth_state = auth_state
        msg.source = cipher.cipher_metadata.source
    return (message_list.job, cipher.cipher_metadata.source, signed_message_list.timestamp)
