<<< Date Index >>>     <<< Thread Index >>>

PGP timeout patch



The following (rough) patch refines the PGP passphrase timeout
mechanism, such that sending a message with a cached passphrase will
restart the expiry timer.  This has the advantage that:

  * sending a continuous stream of messages will prevent Mutt
    from repeatedly asking for the passphrase, irritating the user;

  * the user can choose a much lower timeout value as a result.

If the idea of this patch is acceptable, I will tidy it up, make sure
that the patch applies cleanly to CVS head and test it.

Cheers, Ben

--- pgp.c.orig  2002-01-10 02:39:28.000000000 +1100
+++ pgp.c
@@ -55,7 +55,7 @@
 
 
 char PgpPass[STRING];
-static time_t PgpExptime = 0; /* when does the cached passphrase expire? */
+time_t PgpExptime = 0; /* when does the cached passphrase expire? */
 
 void pgp_void_passphrase (void)
 {

--- send.c.orig 2002-01-31 09:50:59.000000000 +1100
+++ send.c
@@ -1611,6 +1611,13 @@ full_fcc:
     }
   }
 
+#ifdef HAVE_PGP
+  {
+    /* Extend the expiry time while messages keep getting sent.  */
+    extern time_t PgpExptime;
+    PgpExptime = time (NULL) + PgpTimeout;
+  }
+#endif /* HAVE_PGP */
 
   rv = 0;

Attachment: pgpspCNENlgix.pgp
Description: PGP signature