Fixed CMODE command to send the founder key to server.
authorPekka Riikonen <priikone@silcnet.org>
Tue, 3 Dec 2002 21:33:17 +0000 (21:33 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Tue, 3 Dec 2002 21:33:17 +0000 (21:33 +0000)
CHANGES
lib/silcclient/command.c

diff --git a/CHANGES b/CHANGES
index 40e03929b5c3ed0f0733fa37f8c2ec046c555113..66528327131b0295cf5f55a4ecf10e96cf18f30d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,12 @@
+Tue Dec  3 23:26:55 EET 2002  Pekka Riikonen <priikone@silcnet.org>
+
+       * 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 <c0ffee@penguin-breeder.org>
 
        * Set realname and hostname in NICK_REC records. Affected file
index 346554fafd02aeb616f395d99e8716808cc4ae58..3131900efdc680fb6379fb6dafc5765c79639bef 100644 (file)
@@ -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);