From d7ec88d06ea7e8d0af341e0064ea3fc3a22408b4 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Fri, 8 Aug 2003 14:32:14 +0000 Subject: [PATCH] JOIN command reply to return founder key and channel public keys to application. --- lib/doc/command_reply_args.html | 8 ++++++-- lib/silcclient/command_reply.c | 26 ++++++++++++++++++-------- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/lib/doc/command_reply_args.html b/lib/doc/command_reply_args.html index e030614d..a4570021 100644 --- a/lib/doc/command_reply_args.html +++ b/lib/doc/command_reply_args.html @@ -235,12 +235,16 @@ silc_client_get_clients_by_list function and pass the 'client_id_list' as argument to it. The 'client_mode_list' includes 32-bit integers one after the other and they are in same order as clients in 'client_mode_list'. If application resolves the information with silc_client_get_clients_by_list -parsing the 'client_mode_list' is not necessary. +parsing the 'client_mode_list' is not necessary. The 'founder_key' is the +channel founder's key and may be NULL. The 'channel_pubkeys' is Argument +List Payload containing Public Key Payloads of all added channel public +keys, it may be NULL. char *channel_name, SilcChannelEntry channel, SilcUInt32 channel_mode, int ignored, SilcBuffer key_payload, NULL, NULL, char *topic, char *hmac_name, SilcUInt32 list_count, SilcBuffer client_id_list, -SilcBuffer client_mode_list +SilcBuffer client_mode_list, SilcPublicKey founder_key, +SilcBuffer channel_pubkeys diff --git a/lib/silcclient/command_reply.c b/lib/silcclient/command_reply.c index 7d24d9fa..e99abb2e 100644 --- a/lib/silcclient/command_reply.c +++ b/lib/silcclient/command_reply.c @@ -941,6 +941,8 @@ SILC_CLIENT_CMD_REPLY_FUNC(join) SilcUInt32 argc, mode = 0, len, list_count; char *topic, *tmp, *channel_name = NULL, *hmac; SilcBuffer keyp = NULL, client_id_list = NULL, client_mode_list = NULL; + SilcPublicKey founder_key = NULL; + SilcBufferStruct chpklist; int i; SILC_LOG_DEBUG(("Start")); @@ -1098,22 +1100,30 @@ SILC_CLIENT_CMD_REPLY_FUNC(join) if (keyp && !(channel->mode & SILC_CHANNEL_MODE_PRIVKEY)) silc_client_save_channel_key(cmd->client, conn, keyp, channel); + /* Get founder key */ + tmp = silc_argument_get_arg_type(cmd->args, 15, &len); + if (tmp) + silc_pkcs_public_key_payload_decode(tmp, len, &founder_key); + + /* Get channel public key list */ + tmp = silc_argument_get_arg_type(cmd->args, 16, &len); + if (tmp) + silc_buffer_set(&chpklist, tmp, len); + /* Notify application */ COMMAND_REPLY((SILC_ARGS, channel_name, channel, mode, 0, keyp ? keyp->head : NULL, NULL, NULL, topic, hmac, list_count, client_id_list, - client_mode_list)); + client_mode_list, founder_key, tmp ? &chpklist : NULL)); out: SILC_CLIENT_PENDING_EXEC(cmd, SILC_COMMAND_JOIN); silc_client_command_reply_free(cmd); - - if (keyp) - silc_buffer_free(keyp); - if (client_id_list) - silc_buffer_free(client_id_list); - if (client_mode_list) - silc_buffer_free(client_mode_list); + if (founder_key) + silc_pkcs_public_key_free(founder_key); + silc_buffer_free(keyp); + silc_buffer_free(client_id_list); + silc_buffer_free(client_mode_list); } /* Received reply for MOTD command */ -- 2.43.0