From: Pekka Riikonen Date: Tue, 26 Jun 2001 19:38:20 +0000 (+0000) Subject: updates. X-Git-Tag: robodoc-323~124 X-Git-Url: http://git.silcnet.org/gitweb/?a=commitdiff_plain;h=f3c997c2d8327717f13a868ce4a1a9548ef08ce4;p=silc.git updates. --- diff --git a/CHANGES b/CHANGES index 9f08f765..9c06a577 100644 --- a/CHANGES +++ b/CHANGES @@ -15,6 +15,11 @@ Tue Jun 26 19:23:07 EEST 2001 Pekka Riikonen against the remote host's (usually a server) version string. Affected file lib/silcclient/silcapi.h + * Added the KE protocol context to Key Agreement context + in client library so that we can abort the SKE if it + is in process when we get timeout. Affected file is + lib/silcclient/client_keyagr.c. + Mon Jun 25 21:42:51 EEST 2001 Pekka Riikonen * Do not add regex.h for WIN32. The affected file diff --git a/apps/irssi/src/silc/core/client_ops.c b/apps/irssi/src/silc/core/client_ops.c index bb95f116..0b95e988 100644 --- a/apps/irssi/src/silc/core/client_ops.c +++ b/apps/irssi/src/silc/core/client_ops.c @@ -1052,7 +1052,7 @@ int silc_key_agreement(SilcClient client, SilcClientConnection conn, SilcKeyAgreementCallback *completion, void **context) { - char portstr[6]; + char portstr[12]; /* We will just display the info on the screen and return FALSE and user will have to start the key agreement with a command. */ diff --git a/lib/silcclient/client_keyagr.c b/lib/silcclient/client_keyagr.c index 6ceb851f..1540b9dc 100644 --- a/lib/silcclient/client_keyagr.c +++ b/lib/silcclient/client_keyagr.c @@ -36,12 +36,13 @@ SILC_TASK_CALLBACK(silc_client_perform_key_agreement_start); struct SilcClientKeyAgreementStruct { SilcClient client; SilcClientConnection conn; - int fd; /* Listening/connection socket */ - SilcSocketConnection sock; /* Remote socket connection */ - SilcClientEntry client_entry; /* Destination client */ - SilcKeyAgreementCallback completion; /* Key agreement completion */ - void *context; /* User context */ - SilcTask timeout; /* Timeout task */ + int fd; /* Listening/connection socket */ + SilcSocketConnection sock; /* Remote socket connection */ + SilcClientEntry client_entry; /* Destination client */ + SilcKeyAgreementCallback completion; /* Key agreement completion */ + void *context; /* User context */ + SilcTask timeout; /* Timeout task */ + SilcClientKEInternalContext *proto_ctx; /* Key Exchange protocol context */ }; /* Packet sending function used by the SKE in the key agreement process. */ @@ -201,12 +202,13 @@ SILC_TASK_CALLBACK(silc_client_process_key_agreement) sent as context for the protocol. */ proto_ctx = silc_calloc(1, sizeof(*proto_ctx)); proto_ctx->client = client; - proto_ctx->sock = newsocket; + proto_ctx->sock = silc_socket_dup(newsocket); proto_ctx->rng = client->rng; proto_ctx->responder = TRUE; proto_ctx->context = context; proto_ctx->send_packet = silc_client_key_agreement_send_packet; proto_ctx->verify = silc_client_protocol_ke_verify_key; + ke->proto_ctx = proto_ctx; /* Prepare the connection for key exchange protocol. We allocate the protocol but will not start it yet. The connector will be the @@ -242,6 +244,8 @@ SILC_TASK_CALLBACK(silc_client_key_agreement_timeout) silc_client_del_socket(ke->client, ke->sock); silc_socket_free(ke->sock); } + if (ke->proto_ctx && ke->proto_ctx->ske) + silc_ske_free(ke->proto_ctx->ske); ke->client_entry->ke = NULL; if (ke->fd) silc_task_unregister_by_fd(ke->client->io_queue, ke->fd); @@ -556,12 +560,13 @@ void silc_client_perform_key_agreement_fd(SilcClient client, sent as context for the protocol. */ proto_ctx = silc_calloc(1, sizeof(*proto_ctx)); proto_ctx->client = client; - proto_ctx->sock = ke->sock; + proto_ctx->sock = silc_socket_dup(ke->sock); proto_ctx->rng = client->rng; proto_ctx->responder = FALSE; proto_ctx->context = ke; proto_ctx->send_packet = silc_client_key_agreement_send_packet; proto_ctx->verify = silc_client_protocol_ke_verify_key; + ke->proto_ctx = proto_ctx; /* Perform key exchange protocol. */ silc_protocol_alloc(SILC_PROTOCOL_CLIENT_KEY_EXCHANGE,