gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r33684 - gnunet/src/cadet


From: gnunet
Subject: [GNUnet-SVN] r33684 - gnunet/src/cadet
Date: Tue, 17 Jun 2014 14:13:24 +0200

Author: bartpolot
Date: 2014-06-17 14:13:23 +0200 (Tue, 17 Jun 2014)
New Revision: 33684

Modified:
   gnunet/src/cadet/gnunet-service-cadet_tunnel.c
Log:
- expire old keys adaptively

Modified: gnunet/src/cadet/gnunet-service-cadet_tunnel.c
===================================================================
--- gnunet/src/cadet/gnunet-service-cadet_tunnel.c      2014-06-17 12:13:22 UTC 
(rev 33683)
+++ gnunet/src/cadet/gnunet-service-cadet_tunnel.c      2014-06-17 12:13:23 UTC 
(rev 33684)
@@ -1792,11 +1792,16 @@
    * Rationale: the KX could have happened over a very fast connection,
    * with payload traffic still signed with the old key stuck in a slower
    * connection.
+   * Don't keep the keys longer than 1/4 the rekey period, and no longer than
+   * one minute.
    */
   if (GNUNET_SCHEDULER_NO_TASK == t->kx_ctx->finish_task)
   {
-    t->kx_ctx->finish_task =
-      GNUNET_SCHEDULER_add_delayed(GNUNET_TIME_UNIT_MINUTES, finish_kx, t);
+    struct GNUNET_TIME_Relative delay;
+
+    delay = GNUNET_TIME_relative_divide (rekey_period, 4);
+    delay = GNUNET_TIME_relative_min (delay, GNUNET_TIME_UNIT_MINUTES);
+    t->kx_ctx->finish_task = GNUNET_SCHEDULER_add_delayed(delay, finish_kx, t);
   }
   GCT_change_estate (t, CADET_TUNNEL3_KEY_OK);
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]