projects
/
silc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
updates.
[silc.git]
/
apps
/
silcd
/
protocol.c
diff --git
a/apps/silcd/protocol.c
b/apps/silcd/protocol.c
index 0a720081d69db1a4275033bc40d6ebf5fd3d3e5d..170120f696c98007627aa1a7394628185b8ecf59 100644
(file)
--- a/
apps/silcd/protocol.c
+++ b/
apps/silcd/protocol.c
@@
-280,6
+280,12
@@
int silc_server_protocol_ke_set_keys(SilcSKE ske,
sock->user_data = (void *)conn_data;
sock->user_data = (void *)conn_data;
+ SILC_LOG_INFO(("%s (%s) security properties: %s %s %s",
+ sock->hostname, sock->ip,
+ idata->send_key->cipher->name,
+ idata->hmac_send->hmac->name,
+ idata->hash->hash->name));
+
return TRUE;
}
return TRUE;
}
@@
-359,13
+365,13
@@
static void silc_server_protocol_ke_continue(SilcSKE ske, void *context)
SILC_LOG_DEBUG(("Start"));
if (ske->status != SILC_SKE_STATUS_OK) {
SILC_LOG_DEBUG(("Start"));
if (ske->status != SILC_SKE_STATUS_OK) {
- SILC_LOG_WARNING(("Error (
type %d
) during Key Exchange protocol",
- s
ke->status
));
- SILC_LOG_DEBUG(("Error (
type %d
) during Key Exchange protocol",
- s
ke->status
));
+ SILC_LOG_WARNING(("Error (
%s
) during Key Exchange protocol",
+ s
ilc_ske_map_status(ske->status)
));
+ SILC_LOG_DEBUG(("Error (
%s
) during Key Exchange protocol",
+ s
ilc_ske_map_status(ske->status)
));
protocol->state = SILC_PROTOCOL_STATE_ERROR;
protocol->state = SILC_PROTOCOL_STATE_ERROR;
- silc_protocol_execute(protocol, server->
timeout_queu
e, 0, 300000);
+ silc_protocol_execute(protocol, server->
schedul
e, 0, 300000);
return;
}
return;
}
@@
-383,7
+389,7
@@
static void silc_server_protocol_ke_continue(SilcSKE ske, void *context)
function. */
if (ctx->responder == TRUE) {
protocol->state++;
function. */
if (ctx->responder == TRUE) {
protocol->state++;
- silc_protocol_execute(protocol, server->
timeout_queu
e, 0, 100000);
+ silc_protocol_execute(protocol, server->
schedul
e, 0, 100000);
}
}
}
}
@@
-449,20
+455,20
@@
SILC_TASK_CALLBACK(silc_server_protocol_key_exchange)
return;
if (status != SILC_SKE_STATUS_OK) {
return;
if (status != SILC_SKE_STATUS_OK) {
- SILC_LOG_WARNING(("Error (
type %d
) during Key Exchange protocol",
- s
tatus
));
- SILC_LOG_DEBUG(("Error (
type %d
) during Key Exchange protocol",
- s
tatus
));
+ SILC_LOG_WARNING(("Error (
%s
) during Key Exchange protocol",
+ s
ilc_ske_map_status(status)
));
+ SILC_LOG_DEBUG(("Error (
%s
) during Key Exchange protocol",
+ s
ilc_ske_map_status(status)
));
protocol->state = SILC_PROTOCOL_STATE_ERROR;
protocol->state = SILC_PROTOCOL_STATE_ERROR;
- silc_protocol_execute(protocol, server->
timeout_queu
e, 0, 300000);
+ silc_protocol_execute(protocol, server->
schedul
e, 0, 300000);
return;
}
/* Advance protocol state and call the next state if we are responder */
protocol->state++;
if (ctx->responder == TRUE)
return;
}
/* Advance protocol state and call the next state if we are responder */
protocol->state++;
if (ctx->responder == TRUE)
- silc_protocol_execute(protocol, server->
timeout_queu
e, 0, 100000);
+ silc_protocol_execute(protocol, server->
schedul
e, 0, 100000);
}
break;
case 2:
}
break;
case 2:
@@
-487,20
+493,20
@@
SILC_TASK_CALLBACK(silc_server_protocol_key_exchange)
return;
if (status != SILC_SKE_STATUS_OK) {
return;
if (status != SILC_SKE_STATUS_OK) {
- SILC_LOG_WARNING(("Error (
type %d
) during Key Exchange protocol",
- s
tatus
));
- SILC_LOG_DEBUG(("Error (
type %d
) during Key Exchange protocol",
- s
tatus
));
+ SILC_LOG_WARNING(("Error (
%s
) during Key Exchange protocol",
+ s
ilc_ske_map_status(status)
));
+ SILC_LOG_DEBUG(("Error (
%s
) during Key Exchange protocol",
+ s
ilc_ske_map_status(status)
));
protocol->state = SILC_PROTOCOL_STATE_ERROR;
protocol->state = SILC_PROTOCOL_STATE_ERROR;
- silc_protocol_execute(protocol, server->
timeout_queu
e, 0, 300000);
+ silc_protocol_execute(protocol, server->
schedul
e, 0, 300000);
return;
}
/* Advance protocol state and call next state if we are initiator */
protocol->state++;
if (ctx->responder == FALSE)
return;
}
/* Advance protocol state and call next state if we are initiator */
protocol->state++;
if (ctx->responder == FALSE)
- silc_protocol_execute(protocol, server->
timeout_queu
e, 0, 100000);
+ silc_protocol_execute(protocol, server->
schedul
e, 0, 100000);
}
break;
case 3:
}
break;
case 3:
@@
-529,13
+535,13
@@
SILC_TASK_CALLBACK(silc_server_protocol_key_exchange)
return;
if (status != SILC_SKE_STATUS_OK) {
return;
if (status != SILC_SKE_STATUS_OK) {
- SILC_LOG_WARNING(("Error (
type %d
) during Key Exchange protocol",
- s
tatus
));
- SILC_LOG_DEBUG(("Error (
type %d
) during Key Exchange protocol",
- s
tatus
));
+ SILC_LOG_WARNING(("Error (
%s
) during Key Exchange protocol",
+ s
ilc_ske_map_status(status)
));
+ SILC_LOG_DEBUG(("Error (
%s
) during Key Exchange protocol",
+ s
ilc_ske_map_status(status)
));
protocol->state = SILC_PROTOCOL_STATE_ERROR;
protocol->state = SILC_PROTOCOL_STATE_ERROR;
- silc_protocol_execute(protocol, server->
timeout_queu
e, 0, 300000);
+ silc_protocol_execute(protocol, server->
schedul
e, 0, 300000);
return;
}
}
return;
}
}
@@
-567,13
+573,13
@@
SILC_TASK_CALLBACK(silc_server_protocol_key_exchange)
return;
if (status != SILC_SKE_STATUS_OK) {
return;
if (status != SILC_SKE_STATUS_OK) {
- SILC_LOG_WARNING(("Error (
type %d
) during Key Exchange protocol",
- s
tatus
));
- SILC_LOG_DEBUG(("Error (
type %d
) during Key Exchange protocol",
- s
tatus
));
+ SILC_LOG_WARNING(("Error (
%s
) during Key Exchange protocol",
+ s
ilc_ske_map_status(status)
));
+ SILC_LOG_DEBUG(("Error (
%s
) during Key Exchange protocol",
+ s
ilc_ske_map_status(status)
));
protocol->state = SILC_PROTOCOL_STATE_ERROR;
protocol->state = SILC_PROTOCOL_STATE_ERROR;
- silc_protocol_execute(protocol, server->
timeout_queu
e, 0, 300000);
+ silc_protocol_execute(protocol, server->
schedul
e, 0, 300000);
return;
}
}
return;
}
}
@@
-594,7
+600,7
@@
SILC_TASK_CALLBACK(silc_server_protocol_key_exchange)
keymat);
if (status != SILC_SKE_STATUS_OK) {
protocol->state = SILC_PROTOCOL_STATE_ERROR;
keymat);
if (status != SILC_SKE_STATUS_OK) {
protocol->state = SILC_PROTOCOL_STATE_ERROR;
- silc_protocol_execute(protocol, server->
timeout_queu
e, 0, 300000);
+ silc_protocol_execute(protocol, server->
schedul
e, 0, 300000);
silc_ske_free_key_material(keymat);
return;
}
silc_ske_free_key_material(keymat);
return;
}
@@
-609,11
+615,11
@@
SILC_TASK_CALLBACK(silc_server_protocol_key_exchange)
This was the timeout task to be executed if the protocol is
not completed fast enough. */
if (ctx->timeout_task)
This was the timeout task to be executed if the protocol is
not completed fast enough. */
if (ctx->timeout_task)
- silc_
task_unregister(server->timeout_queu
e, ctx->timeout_task);
+ silc_
schedule_task_del(server->schedul
e, ctx->timeout_task);
/* Call the final callback */
if (protocol->final_callback)
/* Call the final callback */
if (protocol->final_callback)
- silc_protocol_execute_final(protocol, server->
timeout_queu
e);
+ silc_protocol_execute_final(protocol, server->
schedul
e);
else
silc_protocol_free(protocol);
}
else
silc_protocol_free(protocol);
}
@@
-631,11
+637,11
@@
SILC_TASK_CALLBACK(silc_server_protocol_key_exchange)
This was the timeout task to be executed if the protocol is
not completed fast enough. */
if (ctx->timeout_task)
This was the timeout task to be executed if the protocol is
not completed fast enough. */
if (ctx->timeout_task)
- silc_
task_unregister(server->timeout_queu
e, ctx->timeout_task);
+ silc_
schedule_task_del(server->schedul
e, ctx->timeout_task);
/* On error the final callback is always called. */
if (protocol->final_callback)
/* On error the final callback is always called. */
if (protocol->final_callback)
- silc_protocol_execute_final(protocol, server->
timeout_queu
e);
+ silc_protocol_execute_final(protocol, server->
schedul
e);
else
silc_protocol_free(protocol);
break;
else
silc_protocol_free(protocol);
break;
@@
-649,11
+655,11
@@
SILC_TASK_CALLBACK(silc_server_protocol_key_exchange)
This was the timeout task to be executed if the protocol is
not completed fast enough. */
if (ctx->timeout_task)
This was the timeout task to be executed if the protocol is
not completed fast enough. */
if (ctx->timeout_task)
- silc_
task_unregister(server->timeout_queu
e, ctx->timeout_task);
+ silc_
schedule_task_del(server->schedul
e, ctx->timeout_task);
/* On error the final callback is always called. */
if (protocol->final_callback)
/* On error the final callback is always called. */
if (protocol->final_callback)
- silc_protocol_execute_final(protocol, server->
timeout_queu
e);
+ silc_protocol_execute_final(protocol, server->
schedul
e);
else
silc_protocol_free(protocol);
break;
else
silc_protocol_free(protocol);
break;
@@
-712,7
+718,8
@@
silc_server_public_key_authentication(SilcServer server,
SILC_STR_END);
/* Verify signature */
SILC_STR_END);
/* Verify signature */
- if (silc_pkcs_verify(pkcs, sign, sign_len, auth->data, auth->len)) {
+ if (silc_pkcs_verify_with_hash(pkcs, ske->prop->hash, sign, sign_len,
+ auth->data, auth->len)) {
silc_pkcs_free(pkcs);
silc_buffer_free(auth);
return TRUE;
silc_pkcs_free(pkcs);
silc_buffer_free(auth);
return TRUE;
@@
-725,7
+732,6
@@
silc_server_public_key_authentication(SilcServer server,
static int
silc_server_get_public_key_auth(SilcServer server,
static int
silc_server_get_public_key_auth(SilcServer server,
- SilcPublicKey pub_key,
unsigned char *auth_data,
uint32 *auth_data_len,
SilcSKE ske)
unsigned char *auth_data,
uint32 *auth_data_len,
SilcSKE ske)
@@
-734,14
+740,7
@@
silc_server_get_public_key_auth(SilcServer server,
SilcPKCS pkcs;
SilcBuffer auth;
SilcPKCS pkcs;
SilcBuffer auth;
- if (!pub_key)
- return FALSE;
-
- silc_pkcs_alloc(pub_key->name, &pkcs);
- if (!silc_pkcs_public_key_set(pkcs, pub_key)) {
- silc_pkcs_free(pkcs);
- return FALSE;
- }
+ pkcs = server->pkcs;
/* Make the authentication data. Protocol says it is HASH plus
KE Start Payload. */
/* Make the authentication data. Protocol says it is HASH plus
KE Start Payload. */
@@
-754,13
+753,12
@@
silc_server_get_public_key_auth(SilcServer server,
ske->start_payload_copy->len),
SILC_STR_END);
ske->start_payload_copy->len),
SILC_STR_END);
- if (silc_pkcs_sign
(pkcs, auth->data, auth->len, auth_data, auth_data_len)) {
- silc_pkcs_free(pkcs);
+ if (silc_pkcs_sign
_with_hash(pkcs, ske->prop->hash, auth->data,
+ auth->len, auth_data, auth_data_len)) {
silc_buffer_free(auth);
return TRUE;
}
silc_buffer_free(auth);
return TRUE;
}
- silc_pkcs_free(pkcs);
silc_buffer_free(auth);
return FALSE;
}
silc_buffer_free(auth);
return FALSE;
}
@@
-811,14
+809,14
@@
SILC_TASK_CALLBACK(silc_server_protocol_connection_auth)
if (ret == -1) {
SILC_LOG_DEBUG(("Bad payload in authentication packet"));
protocol->state = SILC_PROTOCOL_STATE_ERROR;
if (ret == -1) {
SILC_LOG_DEBUG(("Bad payload in authentication packet"));
protocol->state = SILC_PROTOCOL_STATE_ERROR;
- silc_protocol_execute(protocol, server->
timeout_queu
e, 0, 300000);
+ silc_protocol_execute(protocol, server->
schedul
e, 0, 300000);
return;
}
if (payload_len != ctx->packet->buffer->len) {
SILC_LOG_DEBUG(("Bad payload in authentication packet"));
protocol->state = SILC_PROTOCOL_STATE_ERROR;
return;
}
if (payload_len != ctx->packet->buffer->len) {
SILC_LOG_DEBUG(("Bad payload in authentication packet"));
protocol->state = SILC_PROTOCOL_STATE_ERROR;
- silc_protocol_execute(protocol, server->
timeout_queu
e, 0, 300000);
+ silc_protocol_execute(protocol, server->
schedul
e, 0, 300000);
return;
}
return;
}
@@
-828,7
+826,7
@@
SILC_TASK_CALLBACK(silc_server_protocol_connection_auth)
conn_type > SILC_SOCKET_TYPE_ROUTER) {
SILC_LOG_ERROR(("Bad connection type %d", conn_type));
protocol->state = SILC_PROTOCOL_STATE_ERROR;
conn_type > SILC_SOCKET_TYPE_ROUTER) {
SILC_LOG_ERROR(("Bad connection type %d", conn_type));
protocol->state = SILC_PROTOCOL_STATE_ERROR;
- silc_protocol_execute(protocol, server->
timeout_queu
e, 0, 300000);
+ silc_protocol_execute(protocol, server->
schedul
e, 0, 300000);
return;
}
return;
}
@@
-842,7
+840,7
@@
SILC_TASK_CALLBACK(silc_server_protocol_connection_auth)
if (ret == -1) {
SILC_LOG_DEBUG(("Bad payload in authentication packet"));
protocol->state = SILC_PROTOCOL_STATE_ERROR;
if (ret == -1) {
SILC_LOG_DEBUG(("Bad payload in authentication packet"));
protocol->state = SILC_PROTOCOL_STATE_ERROR;
- silc_protocol_execute(protocol, server->
timeout_queu
e, 0, 300000);
+ silc_protocol_execute(protocol, server->
schedul
e, 0, 300000);
return;
}
}
return;
}
}
@@
-880,7
+878,7
@@
SILC_TASK_CALLBACK(silc_server_protocol_connection_auth)
SILC_LOG_DEBUG(("Authentication failed"));
silc_free(auth_data);
protocol->state = SILC_PROTOCOL_STATE_ERROR;
SILC_LOG_DEBUG(("Authentication failed"));
silc_free(auth_data);
protocol->state = SILC_PROTOCOL_STATE_ERROR;
- silc_protocol_execute(protocol, server->
timeout_queu
e,
+ silc_protocol_execute(protocol, server->
schedul
e,
0, 300000);
return;
break;
0, 300000);
return;
break;
@@
-901,7
+899,7
@@
SILC_TASK_CALLBACK(silc_server_protocol_connection_auth)
SILC_LOG_DEBUG(("Authentication failed"));
silc_free(auth_data);
protocol->state = SILC_PROTOCOL_STATE_ERROR;
SILC_LOG_DEBUG(("Authentication failed"));
silc_free(auth_data);
protocol->state = SILC_PROTOCOL_STATE_ERROR;
- silc_protocol_execute(protocol, server->
timeout_queu
e,
+ silc_protocol_execute(protocol, server->
schedul
e,
0, 300000);
return;
}
0, 300000);
return;
}
@@
-911,7
+909,7
@@
SILC_TASK_CALLBACK(silc_server_protocol_connection_auth)
SILC_LOG_ERROR(("Authentication failed"));
silc_free(auth_data);
protocol->state = SILC_PROTOCOL_STATE_ERROR;
SILC_LOG_ERROR(("Authentication failed"));
silc_free(auth_data);
protocol->state = SILC_PROTOCOL_STATE_ERROR;
- silc_protocol_execute(protocol, server->
timeout_queu
e,
+ silc_protocol_execute(protocol, server->
schedul
e,
0, 300000);
return;
}
0, 300000);
return;
}
@@
-942,7
+940,7
@@
SILC_TASK_CALLBACK(silc_server_protocol_connection_auth)
SILC_LOG_DEBUG(("Authentication failed"));
silc_free(auth_data);
protocol->state = SILC_PROTOCOL_STATE_ERROR;
SILC_LOG_DEBUG(("Authentication failed"));
silc_free(auth_data);
protocol->state = SILC_PROTOCOL_STATE_ERROR;
- silc_protocol_execute(protocol, server->
timeout_queu
e,
+ silc_protocol_execute(protocol, server->
schedul
e,
0, 300000);
return;
break;
0, 300000);
return;
break;
@@
-963,7
+961,7
@@
SILC_TASK_CALLBACK(silc_server_protocol_connection_auth)
SILC_LOG_DEBUG(("Authentication failed"));
silc_free(auth_data);
protocol->state = SILC_PROTOCOL_STATE_ERROR;
SILC_LOG_DEBUG(("Authentication failed"));
silc_free(auth_data);
protocol->state = SILC_PROTOCOL_STATE_ERROR;
- silc_protocol_execute(protocol, server->
timeout_queu
e,
+ silc_protocol_execute(protocol, server->
schedul
e,
0, 300000);
return;
}
0, 300000);
return;
}
@@
-972,7
+970,7
@@
SILC_TASK_CALLBACK(silc_server_protocol_connection_auth)
SILC_LOG_ERROR(("Remote connection not configured"));
SILC_LOG_ERROR(("Authentication failed"));
protocol->state = SILC_PROTOCOL_STATE_ERROR;
SILC_LOG_ERROR(("Remote connection not configured"));
SILC_LOG_ERROR(("Authentication failed"));
protocol->state = SILC_PROTOCOL_STATE_ERROR;
- silc_protocol_execute(protocol, server->
timeout_queu
e,
+ silc_protocol_execute(protocol, server->
schedul
e,
0, 300000);
silc_free(auth_data);
return;
0, 300000);
silc_free(auth_data);
return;
@@
-1004,7
+1002,7
@@
SILC_TASK_CALLBACK(silc_server_protocol_connection_auth)
SILC_LOG_DEBUG(("Authentication failed"));
silc_free(auth_data);
protocol->state = SILC_PROTOCOL_STATE_ERROR;
SILC_LOG_DEBUG(("Authentication failed"));
silc_free(auth_data);
protocol->state = SILC_PROTOCOL_STATE_ERROR;
- silc_protocol_execute(protocol, server->
timeout_queu
e,
+ silc_protocol_execute(protocol, server->
schedul
e,
0, 300000);
return;
break;
0, 300000);
return;
break;
@@
-1025,7
+1023,7
@@
SILC_TASK_CALLBACK(silc_server_protocol_connection_auth)
SILC_LOG_DEBUG(("Authentication failed"));
silc_free(auth_data);
protocol->state = SILC_PROTOCOL_STATE_ERROR;
SILC_LOG_DEBUG(("Authentication failed"));
silc_free(auth_data);
protocol->state = SILC_PROTOCOL_STATE_ERROR;
- silc_protocol_execute(protocol, server->
timeout_queu
e,
+ silc_protocol_execute(protocol, server->
schedul
e,
0, 300000);
return;
}
0, 300000);
return;
}
@@
-1035,7
+1033,7
@@
SILC_TASK_CALLBACK(silc_server_protocol_connection_auth)
SILC_LOG_ERROR(("Authentication failed"));
silc_free(auth_data);
protocol->state = SILC_PROTOCOL_STATE_ERROR;
SILC_LOG_ERROR(("Authentication failed"));
silc_free(auth_data);
protocol->state = SILC_PROTOCOL_STATE_ERROR;
- silc_protocol_execute(protocol, server->
timeout_queu
e,
+ silc_protocol_execute(protocol, server->
schedul
e,
0, 300000);
return;
}
0, 300000);
return;
}
@@
-1049,7
+1047,7
@@
SILC_TASK_CALLBACK(silc_server_protocol_connection_auth)
/* Advance protocol state. */
protocol->state = SILC_PROTOCOL_STATE_END;
/* Advance protocol state. */
protocol->state = SILC_PROTOCOL_STATE_END;
- silc_protocol_execute(protocol, server->
timeout_queu
e, 0, 0);
+ silc_protocol_execute(protocol, server->
schedul
e, 0, 0);
} else {
/*
} else {
/*
@@
-1081,8
+1079,7
@@
SILC_TASK_CALLBACK(silc_server_protocol_connection_auth)
unsigned char sign[1024];
/* Public key authentication */
unsigned char sign[1024];
/* Public key authentication */
- silc_server_get_public_key_auth(server, ctx->auth_data,
- sign, &auth_data_len,
+ silc_server_get_public_key_auth(server, sign, &auth_data_len,
ctx->ske);
auth_data = silc_calloc(auth_data_len, sizeof(*auth_data));
memcpy(auth_data, sign, auth_data_len);
ctx->ske);
auth_data = silc_calloc(auth_data_len, sizeof(*auth_data));
memcpy(auth_data, sign, auth_data_len);
@@
-1136,11
+1133,11
@@
SILC_TASK_CALLBACK(silc_server_protocol_connection_auth)
This was the timeout task to be executed if the protocol is
not completed fast enough. */
if (ctx->timeout_task)
This was the timeout task to be executed if the protocol is
not completed fast enough. */
if (ctx->timeout_task)
- silc_
task_unregister(server->timeout_queu
e, ctx->timeout_task);
+ silc_
schedule_task_del(server->schedul
e, ctx->timeout_task);
/* Protocol has ended, call the final callback */
if (protocol->final_callback)
/* Protocol has ended, call the final callback */
if (protocol->final_callback)
- silc_protocol_execute_final(protocol, server->
timeout_queu
e);
+ silc_protocol_execute_final(protocol, server->
schedul
e);
else
silc_protocol_free(protocol);
}
else
silc_protocol_free(protocol);
}
@@
-1162,11
+1159,11
@@
SILC_TASK_CALLBACK(silc_server_protocol_connection_auth)
This was the timeout task to be executed if the protocol is
not completed fast enough. */
if (ctx->timeout_task)
This was the timeout task to be executed if the protocol is
not completed fast enough. */
if (ctx->timeout_task)
- silc_
task_unregister(server->timeout_queu
e, ctx->timeout_task);
+ silc_
schedule_task_del(server->schedul
e, ctx->timeout_task);
/* On error the final callback is always called. */
if (protocol->final_callback)
/* On error the final callback is always called. */
if (protocol->final_callback)
- silc_protocol_execute_final(protocol, server->
timeout_queu
e);
+ silc_protocol_execute_final(protocol, server->
schedul
e);
else
silc_protocol_free(protocol);
}
else
silc_protocol_free(protocol);
}
@@
-1181,11
+1178,11
@@
SILC_TASK_CALLBACK(silc_server_protocol_connection_auth)
This was the timeout task to be executed if the protocol is
not completed fast enough. */
if (ctx->timeout_task)
This was the timeout task to be executed if the protocol is
not completed fast enough. */
if (ctx->timeout_task)
- silc_
task_unregister(server->timeout_queu
e, ctx->timeout_task);
+ silc_
schedule_task_del(server->schedul
e, ctx->timeout_task);
/* On error the final callback is always called. */
if (protocol->final_callback)
/* On error the final callback is always called. */
if (protocol->final_callback)
- silc_protocol_execute_final(protocol, server->
timeout_queu
e);
+ silc_protocol_execute_final(protocol, server->
schedul
e);
else
silc_protocol_free(protocol);
break;
else
silc_protocol_free(protocol);
break;
@@
-1372,7
+1369,8
@@
SILC_TASK_CALLBACK(silc_server_protocol_rekey)
if (ctx->packet->type != SILC_PACKET_KEY_EXCHANGE_1) {
/* Error in protocol */
protocol->state = SILC_PROTOCOL_STATE_ERROR;
if (ctx->packet->type != SILC_PACKET_KEY_EXCHANGE_1) {
/* Error in protocol */
protocol->state = SILC_PROTOCOL_STATE_ERROR;
- silc_protocol_execute(protocol, server->timeout_queue, 0, 300000);
+ silc_protocol_execute(protocol, server->schedule, 0, 300000);
+ return;
}
ctx->ske = silc_ske_alloc();
}
ctx->ske = silc_ske_alloc();
@@
-1388,17
+1386,17
@@
SILC_TASK_CALLBACK(silc_server_protocol_rekey)
status = silc_ske_responder_phase_2(ctx->ske, ctx->packet->buffer);
if (status != SILC_SKE_STATUS_OK) {
status = silc_ske_responder_phase_2(ctx->ske, ctx->packet->buffer);
if (status != SILC_SKE_STATUS_OK) {
- SILC_LOG_WARNING(("Error (
type %d
) during Re-key (PFS)",
- s
tatus
));
+ SILC_LOG_WARNING(("Error (
%s
) during Re-key (PFS)",
+ s
ilc_ske_map_status(status)
));
protocol->state = SILC_PROTOCOL_STATE_ERROR;
protocol->state = SILC_PROTOCOL_STATE_ERROR;
- silc_protocol_execute(protocol, server->
timeout_queu
e, 0, 300000);
+ silc_protocol_execute(protocol, server->
schedul
e, 0, 300000);
return;
}
/* Advance the protocol state */
protocol->state++;
return;
}
/* Advance the protocol state */
protocol->state++;
- silc_protocol_execute(protocol, server->
timeout_queu
e, 0, 0);
+ silc_protocol_execute(protocol, server->
schedul
e, 0, 0);
} else {
/*
* Do normal and simple re-key.
} else {
/*
* Do normal and simple re-key.
@@
-1444,11
+1442,11
@@
SILC_TASK_CALLBACK(silc_server_protocol_rekey)
status = silc_ske_initiator_phase_2(ctx->ske, NULL, NULL);
if (status != SILC_SKE_STATUS_OK) {
status = silc_ske_initiator_phase_2(ctx->ske, NULL, NULL);
if (status != SILC_SKE_STATUS_OK) {
- SILC_LOG_WARNING(("Error (
type %d
) during Re-key (PFS)",
- s
tatus
));
+ SILC_LOG_WARNING(("Error (
%s
) during Re-key (PFS)",
+ s
ilc_ske_map_status(status)
));
protocol->state = SILC_PROTOCOL_STATE_ERROR;
protocol->state = SILC_PROTOCOL_STATE_ERROR;
- silc_protocol_execute(protocol, server->
timeout_queu
e, 0, 300000);
+ silc_protocol_execute(protocol, server->
schedul
e, 0, 300000);
return;
}
return;
}
@@
-1489,11
+1487,11
@@
SILC_TASK_CALLBACK(silc_server_protocol_rekey)
status = silc_ske_responder_finish(ctx->ske, NULL, NULL,
SILC_SKE_PK_TYPE_SILC);
if (status != SILC_SKE_STATUS_OK) {
status = silc_ske_responder_finish(ctx->ske, NULL, NULL,
SILC_SKE_PK_TYPE_SILC);
if (status != SILC_SKE_STATUS_OK) {
- SILC_LOG_WARNING(("Error (
type %d
) during Re-key (PFS)",
- s
tatus
));
+ SILC_LOG_WARNING(("Error (
%s
) during Re-key (PFS)",
+ s
ilc_ske_map_status(status)
));
protocol->state = SILC_PROTOCOL_STATE_ERROR;
protocol->state = SILC_PROTOCOL_STATE_ERROR;
- silc_protocol_execute(protocol, server->
timeout_queu
e, 0, 300000);
+ silc_protocol_execute(protocol, server->
schedul
e, 0, 300000);
return;
}
}
return;
}
}
@@
-1506,16
+1504,17
@@
SILC_TASK_CALLBACK(silc_server_protocol_rekey)
if (ctx->packet->type != SILC_PACKET_KEY_EXCHANGE_2) {
/* Error in protocol */
protocol->state = SILC_PROTOCOL_STATE_ERROR;
if (ctx->packet->type != SILC_PACKET_KEY_EXCHANGE_2) {
/* Error in protocol */
protocol->state = SILC_PROTOCOL_STATE_ERROR;
- silc_protocol_execute(protocol, server->timeout_queue, 0, 300000);
+ silc_protocol_execute(protocol, server->schedule, 0, 300000);
+ return;
}
status = silc_ske_initiator_finish(ctx->ske, ctx->packet->buffer);
if (status != SILC_SKE_STATUS_OK) {
}
status = silc_ske_initiator_finish(ctx->ske, ctx->packet->buffer);
if (status != SILC_SKE_STATUS_OK) {
- SILC_LOG_WARNING(("Error (
type %d
) during Re-key (PFS)",
- s
tatus
));
+ SILC_LOG_WARNING(("Error (
%s
) during Re-key (PFS)",
+ s
ilc_ske_map_status(status)
));
protocol->state = SILC_PROTOCOL_STATE_ERROR;
protocol->state = SILC_PROTOCOL_STATE_ERROR;
- silc_protocol_execute(protocol, server->
timeout_queu
e, 0, 300000);
+ silc_protocol_execute(protocol, server->
schedul
e, 0, 300000);
return;
}
}
return;
}
}
@@
-1543,7
+1542,8
@@
SILC_TASK_CALLBACK(silc_server_protocol_rekey)
if (ctx->packet->type != SILC_PACKET_REKEY_DONE) {
/* Error in protocol */
protocol->state = SILC_PROTOCOL_STATE_ERROR;
if (ctx->packet->type != SILC_PACKET_REKEY_DONE) {
/* Error in protocol */
protocol->state = SILC_PROTOCOL_STATE_ERROR;
- silc_protocol_execute(protocol, server->timeout_queue, 0, 0);
+ silc_protocol_execute(protocol, server->schedule, 0, 300000);
+ return;
}
/* We received the REKEY_DONE packet and all packets after this is
}
/* We received the REKEY_DONE packet and all packets after this is
@@
-1552,7
+1552,7
@@
SILC_TASK_CALLBACK(silc_server_protocol_rekey)
/* Protocol has ended, call the final callback */
if (protocol->final_callback)
/* Protocol has ended, call the final callback */
if (protocol->final_callback)
- silc_protocol_execute_final(protocol, server->
timeout_queu
e);
+ silc_protocol_execute_final(protocol, server->
schedul
e);
else
silc_protocol_free(protocol);
break;
else
silc_protocol_free(protocol);
break;
@@
-1569,7
+1569,7
@@
SILC_TASK_CALLBACK(silc_server_protocol_rekey)
/* On error the final callback is always called. */
if (protocol->final_callback)
/* On error the final callback is always called. */
if (protocol->final_callback)
- silc_protocol_execute_final(protocol, server->
timeout_queu
e);
+ silc_protocol_execute_final(protocol, server->
schedul
e);
else
silc_protocol_free(protocol);
break;
else
silc_protocol_free(protocol);
break;
@@
-1581,7
+1581,7
@@
SILC_TASK_CALLBACK(silc_server_protocol_rekey)
/* On error the final callback is always called. */
if (protocol->final_callback)
/* On error the final callback is always called. */
if (protocol->final_callback)
- silc_protocol_execute_final(protocol, server->
timeout_queu
e);
+ silc_protocol_execute_final(protocol, server->
schedul
e);
else
silc_protocol_free(protocol);
break;
else
silc_protocol_free(protocol);
break;
@@
-1602,6
+1602,8
@@
void silc_server_protocols_register(void)
silc_server_protocol_key_exchange);
silc_protocol_register(SILC_PROTOCOL_SERVER_REKEY,
silc_server_protocol_rekey);
silc_server_protocol_key_exchange);
silc_protocol_register(SILC_PROTOCOL_SERVER_REKEY,
silc_server_protocol_rekey);
+ silc_protocol_register(SILC_PROTOCOL_SERVER_BACKUP,
+ silc_server_protocol_backup);
}
/* Unregisters protocols */
}
/* Unregisters protocols */
@@
-1614,4
+1616,6
@@
void silc_server_protocols_unregister(void)
silc_server_protocol_key_exchange);
silc_protocol_unregister(SILC_PROTOCOL_SERVER_REKEY,
silc_server_protocol_rekey);
silc_server_protocol_key_exchange);
silc_protocol_unregister(SILC_PROTOCOL_SERVER_REKEY,
silc_server_protocol_rekey);
+ silc_protocol_unregister(SILC_PROTOCOL_SERVER_BACKUP,
+ silc_server_protocol_backup);
}
}