From: Pekka Riikonen Date: Mon, 17 Mar 2003 17:32:59 +0000 (+0000) Subject: Fixed CMODE_CHANGE handling for founder key, Bug #122. X-Git-Tag: silc.client.0.9.12~1 X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=commitdiff_plain;h=d8799168747a377f09636195fa67f4e6c881fc73 Fixed CMODE_CHANGE handling for founder key, Bug #122. --- diff --git a/CHANGES b/CHANGES index 4854d9cb..b2d4813a 100644 --- a/CHANGES +++ b/CHANGES @@ -18,6 +18,9 @@ Mon Mar 17 18:35:24 EET 2003 Pekka Riikonen * 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 * Remove the mark for output (mark it only for input) after diff --git a/TODO b/TODO index 9d4c6b73..7b8dc36f 100644 --- 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 diff --git a/apps/silcd/packet_receive.c b/apps/silcd/packet_receive.c index ee45290f..b358452f 100644 --- a/apps/silcd/packet_receive.c +++ b/apps/silcd/packet_receive.c @@ -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