From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: [andreas@altroot.de: keys are sometimes not removed from pgg's password cache] Date: Mon, 17 Jul 2006 12:06:59 -0400 Message-ID: Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1153152617 16300 80.91.229.2 (17 Jul 2006 16:10:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 17 Jul 2006 16:10:17 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 17 18:10:14 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1G2Vf8-0003qH-9e for ged-emacs-devel@m.gmane.org; Mon, 17 Jul 2006 18:09:39 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G2Vf7-0008JJ-N5 for ged-emacs-devel@m.gmane.org; Mon, 17 Jul 2006 12:09:37 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1G2Vcb-0006RO-5e for emacs-devel@gnu.org; Mon, 17 Jul 2006 12:07:01 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1G2Vca-0006R1-Hy for emacs-devel@gnu.org; Mon, 17 Jul 2006 12:07:00 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G2Vca-0006Qw-9r for emacs-devel@gnu.org; Mon, 17 Jul 2006 12:07:00 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1G2VfH-0000QH-D5 for emacs-devel@gnu.org; Mon, 17 Jul 2006 12:09:47 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1G2VcZ-0006iM-67; Mon, 17 Jul 2006 12:06:59 -0400 Original-To: Sascha Wilde , Daiki Ueno X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:57190 Archived-At: Would someone please fix this and ack? ------- Start of forwarded message ------- To: emacs-pretest-bug@gnu.org From: andreas@altroot.de (Andreas =?iso-8859-1?Q?V=F6gele?=) Date: Sat, 15 Jul 2006 21:31:39 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: bugs@gnus.org Subject: keys are sometimes not removed from pgg's password cache X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=failed version=3.0.4 Keys, e.g. email addresses, that are longer than 16 characters will not be properly removed from pgg's password cache. You can verify this problem by evaluating the following expressions: (require 'pgg) (setq pgg-cache-passphrase t pgg-passphrase-cache-expiry 4) (pgg-add-passphrase-to-cache "xxxxxxxx123456789" "foo") pgg-pending-timers ; -> [0 \123456789 0 0 0 0 0] If you check pgg-pending-timers repeatedly you'll see that the timer won't be removed and that the password can still be retrieved from the cache after 4 seconds: (pgg-read-passphrase-from-cache "xxxxxxxx123456789") ; -> "foo" The key can be deleted manually though: (pgg-remove-passphrase-from-cache "xxxxxxxx123456789") According to pgg.el "keys are truncated to 8 trailing characters unless NOTRUNCATE is true". But actually the macro pgp-truncate-key-identifier in pgg-def.el doesn't truncate keys. Instead the first eight characters are removed from the key: (pgg-truncate-key-identifier "xxxxxxxx123456789") ; -> "123456789" The macro is defined as follows: (defmacro pgg-truncate-key-identifier (key) `(if (> (length ,key) 8) (substring ,key 8) ,key)) I think the second argument to substring should be -8 instead of 8: (defmacro pgg-truncate-key-identifier (key) `(if (> (length ,key) 8) (substring ,key -8) ,key)) I don't know why keys mustn't be longer than 8 characters. But the fix above solved my problem. Kind regards, Andreas In GNU Emacs 22.0.50.2 (i386-unknown-openbsd3.9, X toolkit) of 2006-07-09 on hermes.voegele.dyndns.org X server distributor `The X.Org Foundation', version 11.0.60900000 configured using `configure '--localstatedir=/var' '--without-gif' '--prefix=/usr/local' '--sysconfdir=/etc' 'CC=cc' 'CFLAGS=-O2 -pipe' 'LDFLAGS=-L/usr/local/lib'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: nil locale-coding-system: nil default-enable-multibyte-characters: t Major mode: Emacs-Lisp Minor modes in effect: desktop-save-mode: t show-paren-mode: t tooltip-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t unify-8859-on-encoding-mode: t utf-translate-cjk-mode: t auto-compression-mode: t line-number-mode: t Recent input: C-x C-e $ C-x C-e $ C-x C-e C-x C-e C-x C-e M-x r e p o r t Recent messages: Loading dired...done Desktop: 7 buffers restored. For information about the GNU Project and its goals, type C-h C-p. pgg "123456789" [nil 17593 14785 292644 nil pgg-remove-passphrase-from-cache ("123456789" nil) nil] [0 \123456789 0 0 0 0 0] [0 \123456789 0 0 0 0 0] Making completion list... [2 times] Loading emacsbug...done _______________________________________________ emacs-pretest-bug mailing list emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug ------- End of forwarded message -------