emacs-pretest-bug
[Top][All Lists]
Advanced

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

[patch] pgg passphrase cache broken


From: David Smith
Subject: [patch] pgg passphrase cache broken
Date: Thu, 06 Jul 2006 00:05:45 +0900
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.0 (gnu/linux)

In GNU Emacs 23.0.0.3 (i686-pc-linux-gnu, GTK+ Version 2.8.18)
 of 2006-06-23 on exponent
X server distributor `The X.Org Foundation', version 11.0.70000000
configured using `configure 
'--prefix=/usr/local/stow/emacs-unicode-xft.20060623' '--with-xpm' 
'--with-jpeg' '--with-tiff' '--with-gif' '--with-png' '--with-freetype' 
'--with-xft' '--with-gtk' '--enable-font-backend''

The bug is that the passphrase cache works once but when the
expiration time is reached, the entry in the cache changes to
"____" (as many _ as the characters in the passphrase) and pgg
does not ask for the passphrase again.

The root of the bug is that when
pgg-remove-passphrase-from-cache calculates the key to lookup,
it has already been clipped when it was added as a timer by
pgg-add-passphrase-to-cache. That should be fine, but the macro
pgg-truncate-key-identifier, where the bug actually exists,
does not use the substring function correctly (I believe the
semantics of substring changed in emacs23?). Instead of calling
(substring ,key 8), it should call (substring ,key -8). You can
see the difference here:

(substring "0123456789" 8)
==> "89"

(substring "0123456789" -8)
==> "23456789"

That's all. Thanks, always yours,
-- 
  David D. Smith

Attachment: pgpKEAjDVqbxj.pgp
Description: PGP signature


reply via email to

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