SILC_LOG_DEBUG(("Key Exchange completed"));
/* Key exchange done */
- SILC_FSM_CALL_CONTINUE(fsm);
+ SILC_FSM_CALL_CONTINUE_SYNC(fsm);
}
/* Rekey protocol completion callback */
silc_ske_free_rekey_material(conn->internal->rekey);
conn->internal->rekey = rekey;
- SILC_LOG_DEBUG(("Rekey completed"));
+ silc_ske_free(conn->internal->ske);
+ conn->internal->ske = NULL;
+
+ SILC_LOG_DEBUG(("Rekey completed conn %p", conn));
/* Rekey done */
silc_fsm_finish(fsm);
SilcClientConnection conn = fsm_context;
SilcClient client = conn->client;
+ /* Get SILC protocol version remote supports */
+ silc_ske_parse_version(conn->internal->ske, &conn->internal->remote_version,
+ NULL, NULL, NULL, NULL);
+
silc_ske_free(conn->internal->ske);
conn->internal->ske = NULL;
SILC_LOG_DEBUG(("Connection established"));
/* Install rekey timer */
- silc_schedule_task_add_timeout(conn->internal->schedule,
- silc_client_rekey_timer, conn,
- conn->internal->params.rekey_secs, 0);
+ if (conn->type != SILC_CONN_CLIENT)
+ silc_schedule_task_add_timeout(conn->internal->schedule,
+ silc_client_rekey_timer, conn,
+ conn->internal->params.rekey_secs, 0);
/* If we connected to server, now register to network. */
if (conn->type == SILC_CONN_SERVER &&
conn->callback(client, conn, SILC_CLIENT_CONN_SUCCESS, 0, NULL,
conn->callback_context);
+ silc_async_free(conn->internal->cop);
+ conn->internal->cop = NULL;
+
return SILC_FSM_FINISH;
}
SilcClientConnection conn = context;
/* Signal to start rekey */
- conn->internal->rekey_responder = FALSE;
- conn->internal->rekeying = TRUE;
- SILC_FSM_EVENT_SIGNAL(&conn->internal->wait_event);
+ if (!silc_fsm_is_started(&conn->internal->event_thread)) {
+ conn->internal->rekey_responder = FALSE;
+ conn->internal->rekeying = TRUE;
+ SILC_FSM_EVENT_SIGNAL(&conn->internal->wait_event);
+ }
/* Reinstall rekey timer */
silc_schedule_task_add_timeout(conn->internal->schedule,
SilcClientConnection conn = fsm_context;
SilcClient client = conn->client;
- SILC_LOG_DEBUG(("Rekey"));
+ SILC_LOG_DEBUG(("Rekey conn %p", conn));
if (conn->internal->disconnected)
return SILC_FSM_FINISH;