From: Pekka Riikonen Date: Wed, 28 Feb 2001 19:09:35 +0000 (+0000) Subject: updates. X-Git-Tag: SILC.0.1~144 X-Git-Url: http://git.silcnet.org/gitweb/?p=silc.git;a=commitdiff_plain;h=09e2294db9818e3cf46038c6f107be5b51c301c7 updates. --- diff --git a/CHANGES b/CHANGES index c97304a5..bae2c482 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,13 @@ +Wed Feb 28 20:56:29 EET 2001 Pekka Riikonen + + * Fixed a minor bug in the login when the channel key is + re-generated in the server. It used to generate the key in + wrong order and thus caused problems in the channel traffic. + + * Fixed a minor bug in channel key distsribution after + KICK command. The key was not sent to the router even though + it should've been. + Tue Feb 27 20:24:25 EET 2001 Pekka Riikonen * Added silc_ske_process_key_material_data as generic routine diff --git a/apps/silcd/command.c b/apps/silcd/command.c index 2361f87f..1e59ea7f 100644 --- a/apps/silcd/command.c +++ b/apps/silcd/command.c @@ -1893,14 +1893,15 @@ static void silc_server_command_join_channel(SilcServer server, } /* Generate new channel key as protocol dictates */ - if (!created || !channel->channel_key) + if ((!created && silc_list_count(channel->user_list) > 0) || + !channel->channel_key) silc_server_create_channel_key(server, channel, 0); /* Send the channel key. This is broadcasted to the channel but is not sent to the client who is joining to the channel. */ silc_server_send_channel_key(server, NULL, channel, server->server_type == SILC_ROUTER ? - FALSE : server->standalone); + FALSE : !server->standalone); /* Join the client to the channel by adding it to channel's user list. Add also the channel to client entry's channels list for fast cross- @@ -2962,7 +2963,7 @@ SILC_SERVER_CMD_FUNC(kick) to the client who joined the channel. */ silc_server_send_channel_key(server, target_client->connection, channel, server->server_type == SILC_ROUTER ? - FALSE : server->standalone); + FALSE : !server->standalone); out: silc_server_command_free(cmd); @@ -2988,7 +2989,7 @@ SILC_SERVER_CMD_FUNC(connect) unsigned int tmp_len; unsigned int port = SILC_PORT; - SILC_SERVER_COMMAND_CHECK_ARGC(SILC_COMMAND_CONNECT, cmd, 0, 0); + SILC_SERVER_COMMAND_CHECK_ARGC(SILC_COMMAND_CONNECT, cmd, 1, 2); if (!client || cmd->sock->type != SILC_SOCKET_TYPE_CLIENT) goto out; @@ -3048,7 +3049,7 @@ SILC_SERVER_CMD_FUNC(close) unsigned char *name; unsigned int port = SILC_PORT; - SILC_SERVER_COMMAND_CHECK_ARGC(SILC_COMMAND_CLOSE, cmd, 0, 0); + SILC_SERVER_COMMAND_CHECK_ARGC(SILC_COMMAND_CLOSE, cmd, 1, 2); if (!client || cmd->sock->type != SILC_SOCKET_TYPE_CLIENT) goto out; diff --git a/apps/silcd/testi2.conf b/apps/silcd/testi2.conf index 674f0cfa..50064d06 100644 --- a/apps/silcd/testi2.conf +++ b/apps/silcd/testi2.conf @@ -3,7 +3,7 @@ aes-256-cbc:../lib/silcsim/modules/aes.sim.so:32:16 aes-192-cbc:../lib/silcsim/modules/aes.sim.so:24:16 aes-128-cbc:../lib/silcsim/modules/aes.sim.so:16:16 twofish-256-cbc:../lib/silcsim/modules/twofish.sim.so:32:16 -twofish-192-cbc:../lib/silcsim/modules/twofish.sim.so:24:16 +twofish-192-cbc:../lib/silcsim/modules/twofish.sim.so:24:16 twofish-128-cbc:../lib/silcsim/modules/twofish.sim.so:16:16 mars-256-cbc:../lib/silcsim/modules/mars.sim.so:32:16 mars-192-cbc:../lib/silcsim/modules/mars.sim.so:24:16 @@ -25,10 +25,10 @@ nobody:nobody Mun huone:Mun servo:Pekka Riikonen:priikone@poseidon.pspt.fi [ServerInfo] -lassi.kuo.fi.ssh.com:10.2.1.7:Kuopio, Finland:1334 +lassi.kuo.fi.ssh.com:212.146.42.253:Kuopio, Finland:1334 [ListenPort] -10.2.1.7:10.2.1.7:1334 +212.146.42.253:212.146.42.253:1334 [Logging] infologfile:silcd2.log:10000 @@ -49,10 +49,10 @@ errorlogfile:silcd2.log:10000 [AdminConnection] [ServerConnection] -10.2.1.7:passwd:priikone:1333:1:1 +212.146.42.253:passwd:priikone:1333:1:1 [RouterConnection] -10.2.1.7:passwd:priikone:1335:1:1:0 +212.146.42.253:passwd:priikone:1335:1:1:0 [DenyConnection] [RedirectClient] diff --git a/doc/example_silc.conf b/doc/example_silc.conf index abdd4284..5949ca2a 100644 --- a/doc/example_silc.conf +++ b/doc/example_silc.conf @@ -6,9 +6,9 @@ # If the cipher is builtin the maybe omitted. # [cipher] -rijndael-256-cbc:../lib/silcsim/modules/rijndael.sim.so:32:16 -rijndael-192-cbc:../lib/silcsim/modules/rijndael.sim.so:24:16 -rijndael-128-cbc:../lib/silcsim/modules/rijndael.sim.so:16:16 +aes-256-cbc:../lib/silcsim/modules/aes.sim.so:32:16 +aes-192-cbc:../lib/silcsim/modules/aes.sim.so:24:16 +aes-128-cbc:../lib/silcsim/modules/aes.sim.so:16:16 twofish-256-cbc:../lib/silcsim/modules/twofish.sim.so:32:16 twofish-192-cbc:../lib/silcsim/modules/twofish.sim.so:24:16 twofish-128-cbc:../lib/silcsim/modules/twofish.sim.so:16:16 diff --git a/doc/example_silcd.conf b/doc/example_silcd.conf index 1aa5fc95..236e200e 100644 --- a/doc/example_silcd.conf +++ b/doc/example_silcd.conf @@ -6,9 +6,9 @@ # If the cipher is builtin the maybe omitted. # [Cipher] -rijndael-256-cbc:../lib/silcsim/modules/rijndael.sim.so:32:16 -rijndael-192-cbc:../lib/silcsim/modules/rijndael.sim.so:24:16 -rijndael-128-cbc:../lib/silcsim/modules/rijndael.sim.so:16:16 +aes-256-cbc:../lib/silcsim/modules/aes.sim.so:32:16 +aes-192-cbc:../lib/silcsim/modules/aes.sim.so:24:16 +aes-128-cbc:../lib/silcsim/modules/aes.sim.so:16:16 twofish-256-cbc:../lib/silcsim/modules/twofish.sim.so:32:16 twofish-192-cbc:../lib/silcsim/modules/twofish.sim.so:24:16 twofish-128-cbc:../lib/silcsim/modules/twofish.sim.so:16:16 diff --git a/lib/silcclient/client.c b/lib/silcclient/client.c index fe169232..32e0a32d 100644 --- a/lib/silcclient/client.c +++ b/lib/silcclient/client.c @@ -992,7 +992,8 @@ void silc_client_send_channel_message(SilcClient client, /* Generate IV */ block_len = silc_cipher_get_block_len(channel->channel_key); if (channel->iv[0] == '\0') - for (i = 0; i < block_len; i++) channel->iv[i] = silc_rng_get_byte(client->rng); + for (i = 0; i < block_len; i++) channel->iv[i] = + silc_rng_get_byte(client->rng); else silc_hash_make(client->md5hash, channel->iv, block_len, channel->iv); @@ -2076,6 +2077,8 @@ void silc_client_channel_message(SilcClient client, int found = FALSE; unsigned int block_len; + SILC_LOG_DEBUG(("Start")); + /* Sanity checks */ if (packet->dst_id_type != SILC_ID_CHANNEL) goto out; diff --git a/lib/silcske/silcske.c b/lib/silcske/silcske.c index e82b41a2..234d88d8 100644 --- a/lib/silcske/silcske.c +++ b/lib/silcske/silcske.c @@ -1422,15 +1422,16 @@ void silc_ske_free_key_material(SilcSKEKeyMaterial *key) if (key->receive_iv) silc_free(key->receive_iv); if (key->send_enc_key) { - memset(key->send_enc_key, 0, key->enc_key_len); + memset(key->send_enc_key, 0, key->enc_key_len / 8); silc_free(key->send_enc_key); } if (key->receive_enc_key) { - memset(key->receive_enc_key, 0, key->enc_key_len); + memset(key->receive_enc_key, 0, key->enc_key_len / 8); silc_free(key->receive_enc_key); } if (key->hmac_key) { memset(key->hmac_key, 0, key->hmac_key_len); silc_free(key->hmac_key); } + silc_free(key); }