From 8bad21247cde9015f897673cd5c10bea28582898 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Tue, 3 Dec 2002 21:33:17 +0000 Subject: [PATCH] Fixed CMODE command to send the founder key to server. --- CHANGES | 9 +++++++++ lib/silcclient/command.c | 13 ++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 40e03929..66528327 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,12 @@ +Tue Dec 3 23:26:55 EET 2002 Pekka Riikonen + + * Fixed founder key sending in CMODE command in client. + Affected file lib/silcclient/command.c. + + * Fixed CUMODE founder authentication in server to not check + for client's public key since it's not supposed to do that. + Affected file silcd/command.c. + Tue Dec 3 12:02:41 CET 2002 Jochen Eisinger * Set realname and hostname in NICK_REC records. Affected file diff --git a/lib/silcclient/command.c b/lib/silcclient/command.c index 346554fa..3131900e 100644 --- a/lib/silcclient/command.c +++ b/lib/silcclient/command.c @@ -1384,7 +1384,7 @@ SILC_CLIENT_CMD_FUNC(cmode) SilcClientCommandContext cmd = (SilcClientCommandContext)context; SilcClientConnection conn = cmd->conn; SilcChannelEntry channel; - SilcBuffer buffer, chidp, auth = NULL; + SilcBuffer buffer, chidp, auth = NULL, pk = NULL; unsigned char *name, *cp, modebuf[4], tmp[4], *arg = NULL; SilcUInt32 mode, add, type, len, arg_len = 0; int i; @@ -1565,6 +1565,7 @@ SILC_CLIENT_CMD_FUNC(cmode) } } + pk = silc_pkcs_public_key_payload_encode(pubkey); auth = silc_auth_public_key_auth_generate(pubkey, privkey, cmd->client->rng, cmd->client->sha1hash, @@ -1590,10 +1591,12 @@ SILC_CLIENT_CMD_FUNC(cmode) that requires an argument. */ if (type && arg) { buffer = - silc_command_payload_encode_va(SILC_COMMAND_CMODE, 0, 3, + silc_command_payload_encode_va(SILC_COMMAND_CMODE, 0, 4, 1, chidp->data, chidp->len, 2, modebuf, sizeof(modebuf), - type, arg, arg_len); + type, arg, arg_len, + 8, pk ? pk->data : NULL, + pk ? pk->len : 0); } else { buffer = silc_command_payload_encode_va(SILC_COMMAND_CMODE, 0, 2, @@ -1605,8 +1608,8 @@ SILC_CLIENT_CMD_FUNC(cmode) 0, NULL, NULL, buffer->data, buffer->len, TRUE); silc_buffer_free(buffer); silc_buffer_free(chidp); - if (auth) - silc_buffer_free(auth); + silc_buffer_free(auth); + silc_buffer_free(pk); /* Notify application */ COMMAND(SILC_STATUS_OK); -- 2.43.0