From xemacs-m  Sat Aug 23 16:10:30 1997
Received: from cs.utah.edu (cs.utah.edu [128.110.4.21])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id QAA26544
	for <xemacs-beta@xemacs.org>; Sat, 23 Aug 1997 16:10:30 -0500 (CDT)
Received: from fast.cs.utah.edu by cs.utah.edu (8.8.4/utah-2.21-cs)
	id PAA11121; Sat, 23 Aug 1997 15:10:25 -0600 (MDT)
Received: by fast.cs.utah.edu (8.6.10/utah-2.15-leaf)
	id PAA06097; Sat, 23 Aug 1997 15:10:24 -0600
Date: Sat, 23 Aug 1997 15:10:24 -0600
Message-Id: <199708232110.PAA06097@fast.cs.utah.edu>
X-Mailer: VM 5.96 (beta)/19.15 XEmacs Lucid
From: Bart Robinson <lomew@cs.utah.edu>
To: <jari.aalto@poboxes.com> (pgp preferred ssjaaa@uta.fi | pgp -fka)
Cc: xemacs-beta@xemacs.org
Subject: Re: PGP security threat alert
In-Reply-To: <199708231915.WAA12684@pegasus.tele.nokia.fi>
References: <199708231915.WAA12684@pegasus.tele.nokia.fi>

On 1997-8-23 Jari Aalto <jaalto@tre.tele.nokia.fi> wrote:
 >         is a very serious threat. I'm very much afraid that
 >         my PGP passwords are directly available and that
 >         there is no lisp way to wipe the C-h l log.

Here's a subr that clears the lossage log (maybe it should be
called clear-lossage).  The diff is against 19.15 but should be
simple enough to add to newer versions.

BTW, a way to clear the lossage log in elisp is to call
execute-kbd-macro with something innocuous like ^A 100 times.
That kludge doesn't work in FSF Emacs, which doesn't log events
from macros.

-- bart

- - - - - - - - - - - - - - - - tear off - - - - - - - - - - - - - - - -

--- event-stream.c	1997-08-23 14:35:41-06	1.1
+++ event-stream.c	1997-08-23 14:48:44-06
@@ -3233,6 +3233,21 @@
   return (val);
 }
 
+DEFUN ("clear-recent-keys", Fclear_recent_keys, 0, 0, 0, /*
+Clear the recent-keys vector, which records the last 100 or so keyboard
+or mouse events read.
+*/
+       ())
+{ 
+  int i;
+
+  for (i = 0; i < XVECTOR (recent_keys_ring)->size; i++)
+    vector_data (XVECTOR (recent_keys_ring))[i] = Qnil;
+  recent_keys_ring_index = 0;
+
+  return Qnil;
+}
+
 /* Vthis_command_keys having value Qnil means that the next time
    push_this_command_keys is called, it should start over.
    The times at which the command-keys are reset
@@ -4116,6 +4131,7 @@
   defsymbol (&Qcommand_execute, "command-execute");
 
   DEFSUBR (Frecent_keys);
+  DEFSUBR (Fclear_recent_keys);
   DEFSUBR (Finput_pending_p);
   DEFSUBR (Fenqueue_eval_event);
   DEFSUBR (Fnext_event);

