updates
authorPekka Riikonen <priikone@silcnet.org>
Mon, 26 Nov 2001 14:01:35 +0000 (14:01 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Mon, 26 Nov 2001 14:01:35 +0000 (14:01 +0000)
CHANGES
lib/silcclient/client_keyagr.c
lib/silcclient/idlist.c
lib/silcclient/silcapi.h

diff --git a/CHANGES b/CHANGES
index e90f9225eabdd8bdfea72a741e9014ba31f18c56..12fa4ae564218e9b5b1681dd25a710289f57a545 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,14 @@
+Mon Nov 26 15:01:53 CET 2001  Pekka Riikonen <priikone@silcnet.org>
+
+       * If client entry is deleted with active key agreement
+         session, abort the session.
+
+         The silc_client_abort_key_agreement now calls the completion
+         callback with new SILC_KEY_AGREEMENT_ABORTED status.
+
+         Affected file lib/silcclient/silcapi.h, client_keyagr.c and
+         idlist.c.
+
 Sun Nov 25 18:01:45 EET 2001  Pekka Riikonen <priikone@silcnet.org>
 
        * Don't use __restrict in older GCC's.  Affected file is
index 20bb4b347e417ab92a8ed31fb7b6e1176ee99325..b21a7dc737af22d7f228d827d67adfd70f5226a1 100644 (file)
@@ -616,16 +616,21 @@ void silc_client_abort_key_agreement(SilcClient client,
   assert(client_entry);
 
   if (client_entry->ke) {
+    SilcClientKeyAgreement ke;
+
     if (client_entry->ke->sock) {
       silc_client_del_socket(client_entry->ke->client, client_entry->ke->sock);
       silc_socket_free(client_entry->ke->sock);
     }
-    client_entry->ke = NULL;
     silc_schedule_task_del_by_fd(client->schedule, client_entry->ke->fd);
     if (client_entry->ke->timeout)
       silc_schedule_task_del(client->schedule, 
-                          client_entry->ke->timeout);
-    silc_free(client_entry->ke);
+                            client_entry->ke->timeout);
+    ke = client_entry->ke;
+    client_entry->ke = NULL;
+    ke->completion(client, conn, client_entry, 
+                  SILC_KEY_AGREEMENT_ABORTED, NULL, ke->context);
+    silc_free(ke);
   }
 }
 
index 8ec66929aaea090d5f666ae26e1a251d04fbfaef..02f54cee95627797636b7fcd427ee1acaab94796 100644 (file)
@@ -653,6 +653,8 @@ void silc_client_del_client_entry(SilcClient client,
     silc_cipher_free(client_entry->receive_key);
   silc_free(client_entry->key);
   silc_client_ftp_session_free_client(conn, client_entry);
+  if (client_entry->ke)
+    silc_client_abort_key_agreement(client, conn, client_entry);
   silc_free(client_entry);
 }
 
index 61587e3d118f50fc17250c2539d0328d64ff8ad2..03387ebfc8818f64a8489d6a05a1d6b92e03e544 100644 (file)
@@ -74,6 +74,7 @@ typedef enum {
   SILC_KEY_AGREEMENT_ERROR,           /* Unknown error occurred */
   SILC_KEY_AGREEMENT_FAILURE,         /* The protocol failed */
   SILC_KEY_AGREEMENT_TIMEOUT,         /* The protocol timeout */
+  SILC_KEY_AGREEMENT_ABORTED,         /* The protocol aborted */
 } SilcKeyAgreementStatus;
 /***/
 
@@ -1702,7 +1703,8 @@ void silc_client_perform_key_agreement_fd(SilcClient client,
  *    before the key agreement protocol has been performed. After it has
  *    been performed the library will automatically unbind the port. The 
  *    `client_entry' is the client to which we sent the key agreement 
- *    request. 
+ *    request.  The key agreement completion callback will be called
+ *    with SILC_KEY_AGREEMENT_ABORTED status.
  *
  ***/
 void silc_client_abort_key_agreement(SilcClient client,