+ /* If the private key mode, however is not set on the channel then
+ try the actual channel key first before trying private keys. */
+ if (!(channel->mode & SILC_CHANNEL_MODE_PRIVKEY))
+ payload = silc_message_payload_parse(buffer->data, buffer->len, FALSE,
+ FALSE, channel->channel_key,
+ channel->hmac);
+
+ if (!payload) {
+ silc_dlist_start(channel->private_keys);
+ while ((key = silc_dlist_get(channel->private_keys))
+ != SILC_LIST_END) {
+ /* Parse the message payload. This also decrypts the payload */
+ payload = silc_message_payload_parse(buffer->data, buffer->len,
+ FALSE, FALSE,
+ key->cipher, key->hmac);
+ if (payload)
+ break;
+ }
+ if (key == SILC_LIST_END)
+ goto out;
+ }