Fixed CMODE_CHANGE handling for founder key, Bug #122.
authorPekka Riikonen <priikone@silcnet.org>
Mon, 17 Mar 2003 17:32:59 +0000 (17:32 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Mon, 17 Mar 2003 17:32:59 +0000 (17:32 +0000)
CHANGES
TODO
apps/silcd/packet_receive.c

diff --git a/CHANGES b/CHANGES
index 4854d9cb249199379948bb0b9cf7634bad57c626..b2d4813aa13b778218eeb5f3c4bcd4ec9642af59 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -18,6 +18,9 @@ Mon Mar 17 18:35:24 EET 2003  Pekka Riikonen <priikone@silcnet.org>
        * Fixed INVITE notify sending in INVITE command, send it
          only when needed.  Affected file silcd/command.c.
 
+       * Handle the founder key change properly in CMODE_CHANGE
+         notify.  Bug #122.  Affected file silcd/packet_receive.c.
+
 Sun Mar  9 16:29:20 EET 2003  Pekka Riikonen <priikone@silcnet.org>
 
        * Remove the mark for output (mark it only for input) after
diff --git a/TODO b/TODO
index 9d4c6b738220c19f19f95ff237884bbf160349ca..7b8dc36f1e8869798e9864ad4473cc1cbe20ae77 100644 (file)
--- a/TODO
+++ b/TODO
@@ -9,7 +9,7 @@ TODO for Irssi SILC Client 1.0
 TODO for SILC Server 1.0
 ========================
 
- o Fix CUMODE_CHANGE and CMODE_CHANGE for founder key things.
+ o Fix CUMODE_CHANGE founder key things.
 
  o 1.2 backup router support
 
index ee45290f0b1b779625c1142f201f2f8bc126f9e7..b358452fdc2f6a5f38f4f119ad75823f0cb1d756 100644 (file)
@@ -720,18 +720,9 @@ void silc_server_notify(SilcServer server,
       if (channel->founder_key)
        silc_pkcs_public_key_free(channel->founder_key);
       channel->founder_key = NULL;
-      silc_pkcs_public_key_payload_decode(tmp, tmp_len, &channel->founder_key);
-
-      if (!channel->founder_key || 
-         (client && client->data.public_key && 
-          server->server_type == SILC_ROUTER &&
-          !silc_pkcs_public_key_compare(channel->founder_key,
-                                        client->data.public_key))) {
-       /* A really buggy server isn't checking public keys correctly.
-          It's not possible that the mode setter and founder wouldn't
-          have same public key. */
+      if (!silc_pkcs_public_key_payload_decode(tmp, tmp_len,
+                                              &channel->founder_key)) {
        SILC_LOG_DEBUG(("Enforcing sender to change channel mode"));
-
        mode &= ~SILC_CHANNEL_MODE_FOUNDER_AUTH;
        silc_server_send_notify_cmode(server, sock, FALSE, channel,
                                      mode, server->id, SILC_ID_SERVER,
@@ -741,9 +732,6 @@ void silc_server_notify(SilcServer server,
        if (channel->founder_key)
          silc_pkcs_public_key_free(channel->founder_key);
        channel->founder_key = NULL;
-      } else if (client && !client->data.public_key) {
-       client->data.public_key = 
-         silc_pkcs_public_key_copy(channel->founder_key);
       }
     }
 
@@ -913,6 +901,8 @@ void silc_server_notify(SilcServer server,
        silc_hash_table_list(channel->user_list, &htl);
        while (silc_hash_table_get(&htl, NULL, (void *)&chl2))
          if (chl2->mode & SILC_CHANNEL_UMODE_CHANFO) {
+           /* XXX this is not correct anymore in 1.2 -Pekka */
+
            /* If the founder on the channel is not the one whom has set
               the founder mode, then it's possible that this CUMODE_CHANGE
               is correct.  Due to netsplits it's possible that this