unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [andreas@altroot.de: keys are sometimes not removed from pgg's password cache]
@ 2006-07-17 16:06 Richard Stallman
  2006-07-24  1:23 ` Daiki Ueno
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Stallman @ 2006-07-17 16:06 UTC (permalink / raw)
  Cc: emacs-devel

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:
<up> <up> C-x C-e <down> <down> $ <right> C-x C-e <down> 
<down> <down> <down> <down> <down> <down> $ <right> 
C-x C-e <down> C-x C-e C-x C-e M-x r e p <tab> o <tab> 
r t <tab> <return>

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 -------

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [andreas@altroot.de: keys are sometimes not removed from pgg's password cache]
  2006-07-17 16:06 [andreas@altroot.de: keys are sometimes not removed from pgg's password cache] Richard Stallman
@ 2006-07-24  1:23 ` Daiki Ueno
  2006-07-24  7:33   ` Reiner Steib
  0 siblings, 1 reply; 3+ messages in thread
From: Daiki Ueno @ 2006-07-24  1:23 UTC (permalink / raw)
  Cc: davidsmith, rms, andreas

>>>>> In <E1G2VcZ-0006iM-67@fencepost.gnu.org> 
>>>>>	Richard Stallman <rms@gnu.org> wrote:
> 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

> 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.

I probably recalled the intent of that function; it is used to truncate
the long key ID (i.e. fingerprint) to the last 8 letters.

The above fix is reasonable.  I just installed the following patch in
Gnus.  Could someone install it to Emacs?

2006-07-24  Daiki Ueno  <ueno@unixuser.org>

	* pgg-def.el (pgg-truncate-key-identifier): Truncate the key ID to 8
	letters from the end.  Thanks to "David Smith" <davidsmith@acm.org> and
	andreas@altroot.de (Andreas Vögele)

--- pgg-def.el	9 Feb 2006 05:47:53 -0000	7.10
+++ pgg-def.el	24 Jul 2006 00:54:44 -0000	7.11
@@ -87,7 +87,7 @@
   "If t, inform the recipient that the input is text.")
 
 (defmacro pgg-truncate-key-identifier (key)
-  `(if (> (length ,key) 8) (substring ,key 8) ,key))
+  `(if (> (length ,key) 8) (substring ,key -8) ,key))
 
 (provide 'pgg-def)

Regards,
-- 
Daiki Ueno

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [andreas@altroot.de: keys are sometimes not removed from pgg's password cache]
  2006-07-24  1:23 ` Daiki Ueno
@ 2006-07-24  7:33   ` Reiner Steib
  0 siblings, 0 replies; 3+ messages in thread
From: Reiner Steib @ 2006-07-24  7:33 UTC (permalink / raw)
  Cc: Richard Stallman, emacs-devel

On Mon, Jul 24 2006, Daiki Ueno wrote:

> The above fix is reasonable.  I just installed the following patch in
> Gnus.  Could someone install it to Emacs?

Done (installed in Gnus v5-10 and Emacs).

BTW, it's sufficient to install changes that should go into Gnus
trunk, Gnus 5.10.* (v5-10 branch) and Emacs CVS only in Gnus v5-10
branch.  The arch magic (aka Miles Bader) will sync it (see
texi/gnus-coding.texi in Gnus trunk).

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-07-24  7:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-17 16:06 [andreas@altroot.de: keys are sometimes not removed from pgg's password cache] Richard Stallman
2006-07-24  1:23 ` Daiki Ueno
2006-07-24  7:33   ` Reiner Steib

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).