for (i = 0; i < iv_len; i++) channel->iv[i] =
silc_rng_get_byte(client->rng);
else
- silc_hash_make(client->md5hash, channel->iv, iv_len, channel->iv);
+ silc_hash_make(client->internal->md5hash, channel->iv, iv_len,
+ channel->iv);
/* Encode the channel payload. This also encrypts the message payload. */
payload = silc_channel_message_payload_encode(flags, data_len, data, iv_len,
message = silc_channel_message_get_data(res->payload, NULL);
/* Pass the message to application */
- client->ops->channel_message(client, conn, clients[0], channel,
- silc_channel_message_get_flags(res->payload),
- message);
+ client->internal->ops->channel_message(
+ client, conn, clients[0], channel,
+ silc_channel_message_get_flags(res->payload),
+ message);
}
out:
all private keys and check what decrypts correctly. */
if (!(channel->mode & SILC_CHANNEL_MODE_PRIVKEY)) {
/* Parse the channel message payload. This also decrypts the payload */
- payload = silc_channel_message_payload_parse(buffer, channel->channel_key,
+ payload = silc_channel_message_payload_parse(buffer->data, buffer->len,
+ channel->channel_key,
channel->hmac);
/* If decryption failed and we have just performed channel key rekey
if (!channel->old_channel_key)
goto out;
- payload = silc_channel_message_payload_parse(buffer,
+ payload = silc_channel_message_payload_parse(buffer->data, buffer->len,
channel->old_channel_key,
channel->old_hmac);
if (!payload)
silc_dlist_start(channel->private_keys);
while ((entry = silc_dlist_get(channel->private_keys)) != SILC_LIST_END) {
/* Parse the channel message payload. This also decrypts the payload */
- payload = silc_channel_message_payload_parse(buffer, entry->cipher,
+ payload = silc_channel_message_payload_parse(buffer->data, buffer->len,
+ entry->cipher,
entry->hmac);
if (payload)
break;
message = silc_channel_message_get_data(payload, NULL);
/* Pass the message to application */
- client->ops->channel_message(client, conn, chu->client, channel,
- silc_channel_message_get_flags(payload),
- message);
+ client->internal->ops->channel_message(
+ client, conn, chu->client, channel,
+ silc_channel_message_get_flags(payload),
+ message);
out:
if (id)
SilcIDCacheEntry id_cache = NULL;
SilcChannelKeyPayload payload;
- payload = silc_channel_key_payload_parse(key_payload);
+ payload = silc_channel_key_payload_parse(key_payload->data,
+ key_payload->len);
if (!payload)
return;
memcpy(channel->key, key, tmp_len);
if (!silc_cipher_alloc(cipher, &channel->channel_key)) {
- conn->client->ops->say(conn->client, conn, SILC_CLIENT_MESSAGE_AUDIT,
+ conn->client->internal->ops->say(
+ conn->client, conn,
+ SILC_CLIENT_MESSAGE_AUDIT,
"Cannot talk to channel: unsupported cipher %s",
cipher);
goto out;
/* Produce the key material */
keymat = silc_calloc(1, sizeof(*keymat));
if (silc_ske_process_key_material_data(key, key_len, 16, 256, 16,
- client->md5hash, keymat)
+ client->internal->md5hash, keymat)
!= SILC_SKE_STATUS_OK)
return FALSE;