+Sun Aug 12 12:28:17 EEST 2001 Pekka Riikonen <priikone@silcnet.org>
+
+ * Added couple of return's in rekey protocol if error orccurred
+ during the protocol. The execution must be terminated.
+ Affected file silcd/protocol.c. Also, terminate the protocol
+ always with timeout.
+
Sat Aug 11 12:36:02 EEST 2001 Pekka Riikonen <priikone@silcnet.org>
* The client's Client ID was created initally from the wrong
o -n and -c options does not work.
+ o Switching servers while on channel is supposed to crash the client?
+
o Add local command to switch the channel's private key when channel has
several private keys. Currently sending channel messages with many
keys is not possible because changing the key is not possible by the
/* Remove the client entry, If it is locally connected then we will also
disconnect the client here */
- if (remote_client->data.registered && remote_client->connection) {
+ if (remote_client->connection) {
/* Remove locally conneted client */
SilcSocketConnection sock = remote_client->connection;
silc_server_free_client_data(server, sock, remote_client, FALSE, NULL);
/* Close the connection to the server */
sock = (SilcSocketConnection)server_entry->connection;
- if (sock->user_data)
- silc_server_free_sock_user_data(server, sock);
+ silc_server_free_sock_user_data(server, sock);
silc_server_close_connection(server, sock);
out:
/* If the client is one of ours, then close the connection to the
client now. This removes the client from all channels as well. */
- if (packet->dst_id_type == SILC_ID_CLIENT && client->data.registered &&
- client->connection) {
+ if (packet->dst_id_type == SILC_ID_CLIENT && client->connection) {
sock = client->connection;
silc_server_free_client_data(server, NULL, client, FALSE, NULL);
silc_server_close_connection(server, sock);
/* Error in protocol */
protocol->state = SILC_PROTOCOL_STATE_ERROR;
silc_protocol_execute(protocol, server->schedule, 0, 300000);
+ return;
}
ctx->ske = silc_ske_alloc();
/* Error in protocol */
protocol->state = SILC_PROTOCOL_STATE_ERROR;
silc_protocol_execute(protocol, server->schedule, 0, 300000);
+ return;
}
status = silc_ske_initiator_finish(ctx->ske, ctx->packet->buffer);
if (ctx->packet->type != SILC_PACKET_REKEY_DONE) {
/* Error in protocol */
protocol->state = SILC_PROTOCOL_STATE_ERROR;
- silc_protocol_execute(protocol, server->schedule, 0, 0);
+ silc_protocol_execute(protocol, server->schedule, 0, 300000);
+ return;
}
/* We received the REKEY_DONE packet and all packets after this is
/* Unregister all tasks */
silc_schedule_task_del_by_fd(server->schedule, sock->sock);
- silc_schedule_task_del_by_fd(server->schedule, sock->sock);
/* Close the actual connection */
silc_net_close_connection(sock->sock);
}
silc_schedule_task_add(server->schedule, 0,
- silc_server_close_connection_final,
- (void *)sock, 0, 1, SILC_TASK_TIMEOUT,
- SILC_TASK_PRI_NORMAL);
+ silc_server_close_connection_final,
+ (void *)sock, 0, 1, SILC_TASK_TIMEOUT,
+ SILC_TASK_PRI_NORMAL);
}
/* Sends disconnect message to remote connection and disconnects the
/* Re-register re-key timeout */
silc_schedule_task_add(server->schedule, sock->sock,
- silc_server_rekey_callback,
- context, idata->rekey->timeout, 0,
- SILC_TASK_TIMEOUT, SILC_TASK_PRI_NORMAL);
+ silc_server_rekey_callback,
+ context, idata->rekey->timeout, 0,
+ SILC_TASK_TIMEOUT, SILC_TASK_PRI_NORMAL);
}
/* The final callback for the REKEY protocol. This will actually take the