chiark / gitweb /
Don't try to run bogus startup scripts.
[tripe] / keyexch.c
index be7b2a3535777249e39e85e29aa136f72d7df9f4..f2ea62b1c21817936171829ecbcfacbffc9b3955 100644 (file)
--- a/keyexch.c
+++ b/keyexch.c
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: keyexch.c,v 1.5 2002/01/13 14:54:40 mdw Exp $
+ * $Id: keyexch.c,v 1.7 2003/05/17 11:01:28 mdw Exp $
  *
  * Key exchange protocol
  *
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: keyexch.c,v $
+ * Revision 1.7  2003/05/17 11:01:28  mdw
+ * Handle flags on challenge timers correctly to prevent confusing the event
+ * list.
+ *
+ * Revision 1.6  2003/04/06 10:26:35  mdw
+ * Report peer name on decrypt errors.
+ *
  * Revision 1.5  2002/01/13 14:54:40  mdw
  * Patch up zero-knowledge property by passing an encrypted log with a
  * challenge, so that the prover can verify that the challenge is good.
@@ -53,8 +60,8 @@
 
 /*----- Tunable parameters ------------------------------------------------*/
 
-#define T_VALID MIN(2)
-#define T_RETRY SEC(10)
+#define T_VALID MIN(2)                 /* Challenge validity period */
+#define T_RETRY SEC(10)                        /* Challenge retransmit interval */
 
 #define ISVALID(kx, now) ((now) < (kx)->t_valid)
 
@@ -194,6 +201,7 @@ static void kxc_stoptimer(kxchal *kxc)
 {
   if (kxc->f & KXF_TIMER)
     sel_rmtimer(&kxc->t);
+  kxc->f &= ~KXF_TIMER;
 }
 
 /* --- @kxc_new@ --- *
@@ -545,7 +553,7 @@ static int dochallenge(keyexch *kx, unsigned msg, buf *b)
     buf_putmp(b, r); z = BLEN(b);
     assert(BOK(b));
 
-    kxc->ks = ks_gen(BBASE(b), x, y, z);
+    kxc->ks = ks_gen(BBASE(b), x, y, z, kx->p);
     mp_drop(r);
   }