{
SilcBuffer buffer;
SilcBool ret;
+ SilcID sid, rid;
if (silc_unlikely(!client || !conn || !client_entry))
return FALSE;
SILC_LOG_DEBUG(("Sending private message"));
+ sid.type = SILC_ID_CLIENT;
+ sid.u.client_id = conn->local_entry->id;
+ rid.type = SILC_ID_CLIENT;
+ rid.u.client_id = client_entry->id;
+
/* Encode private message payload */
buffer =
silc_message_payload_encode(flags, data, data_len,
TRUE, client_entry->internal.send_key,
client_entry->internal.hmac_send,
client->rng, NULL, conn->private_key,
- hash, NULL);
+ hash, &sid, &rid, NULL);
if (silc_unlikely(!buffer)) {
SILC_LOG_ERROR(("Error encoding private message"));
return FALSE;
TRUE, !remote_client->internal.generated,
remote_client->internal.receive_key,
remote_client->internal.hmac_receive,
+ packet->src_id, packet->src_id_len,
+ packet->dst_id, packet->dst_id_len,
NULL, FALSE, NULL);
if (silc_unlikely(!payload))
goto out;
TRUE, !client_entry->internal.generated,
client_entry->internal.receive_key,
client_entry->internal.hmac_receive,
+ packet->src_id, packet->src_id_len,
+ packet->dst_id, packet->dst_id_len,
NULL, FALSE, NULL);
if (!(*payload)) {
silc_packet_free(packet);
SilcDList clients,
void *context)
{
- SilcPacket packet = context;
+ SilcFSMThread thread = context;
+ SilcPacket packet = silc_fsm_get_state_context(thread);
unsigned char *cipher = NULL, *hmac = NULL;
SilcClientEntry client_entry;
int ret;
if (!clients) {
silc_packet_free(packet);
+ silc_fsm_finish(thread);
return;
}
silc_free(cipher);
silc_free(hmac);
silc_packet_free(packet);
+ silc_fsm_finish(thread);
}
/* Processes incoming Private Message Key payload to indicate that the