+Sat Jan 3 16:37:15 EET 2004 Pekka Riikonen <priikone@silcnet.org>
+
+ * Fixed whois public key hash table deleting and adding in
+ detached client case. Affected file silcd/packet_receive.c.
+
Sat Jan 03 12:15:38 CET 2004 Jochen Eisinger <jochen@penguin-breeder.org>
* Changed filenames of silc/fe module not to collide with filenames
Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1997 - 2003 Pekka Riikonen
+ Copyright (C) 1997 - 2004 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
be bogus client or some router in the net is buggy. */
if (server->server_type != SILC_SERVER)
goto out;
-
+
/* entry isn't known so we IDENTIFY it. otherwise the
silc_server_command_motd won't know about it and tell
the client that there is no such server */
SILC_PACKET_COMMAND, 0, buffer->data,
buffer->len, TRUE);
silc_server_command_pending(server, SILC_COMMAND_IDENTIFY,
- server->cmd_ident,
+ server->cmd_ident,
silc_server_command_reply_motd,
cmd);
silc_buffer_free(buffer);
goto out;
}
- if (!silc_hash_table_find_by_context(server->pk_hash, public_key,
- client, NULL))
- silc_hash_table_add(server->pk_hash, public_key, client);
+ if (!client->data.public_key) {
+ if (!silc_hash_table_find_by_context(server->pk_hash, public_key,
+ client, NULL))
+ silc_hash_table_add(server->pk_hash, public_key, client);
- client->data.public_key = public_key;
- public_key = NULL;
+ client->data.public_key = public_key;
+ public_key = NULL;
+ }
} else if (id_type == SILC_ID_SERVER) {
server_id = silc_id_payload_get_id(idp);
sock->user_data = detached_client;
detached_client->connection = sock;
- if (client->data.public_key)
+ if (detached_client->data.public_key)
silc_hash_table_del_by_context(server->pk_hash,
detached_client->data.public_key,
- client);
+ detached_client);
+ if (idata->public_key)
+ silc_hash_table_del_by_context(server->pk_hash,
+ idata->public_key, idata);
/* Take new keys and stuff into use in the old entry */
silc_idlist_del_data(detached_client);
if (detached_client->data.public_key)
silc_hash_table_add(server->pk_hash,
- detached_client->data.public_key, client);
+ detached_client->data.public_key, detached_client);
detached_client->data.status |= SILC_IDLIST_STATUS_REGISTERED;
detached_client->data.status |= SILC_IDLIST_STATUS_RESUMED;
silc_server_remove_from_channels(server, NULL, client, FALSE,
NULL, FALSE, FALSE);
- /* Remove from public key hash table. */
- if (client->data.public_key)
- silc_hash_table_del_by_context(server->pk_hash,
- client->data.public_key,
- client);
-
silc_server_del_from_watcher_list(server, client);
if (!silc_idlist_del_client(server->local_list, client))
silc_idlist_del_client(server->global_list, client);
/* Client is detached, and now it is resumed. Remove the detached
mode and mark that it is resumed. */
- /* we need to delete the public key from the has .. but do we need to
- * get the key again? */
if (detached_client->data.public_key)
silc_hash_table_del_by_context(server->pk_hash,
detached_client->data.public_key,
printf("SILCd Secure Internet Live Conferencing daemon, "
"version %s (base: SILC Toolkit %s)\n",
silc_dist_version, silc_version);
- printf("(c) 1997 - 2002 Pekka Riikonen "
+ printf("(c) 1997 - 2004 Pekka Riikonen "
"<priikone@silcnet.org>\n");
exit(0);
break;