GNU bug report logs -
#5592
gnus mml2015 epg: Trying and failing to encrypt email to disabled pgp-key
Previous Next
Reported by: Christian von Roques <roques <at> mti.ag>
Date: Wed, 17 Feb 2010 20:44:02 UTC
Severity: minor
Tags: patch
Found in version 23.1.1
Done: Daiki Ueno <ueno <at> unixuser.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#5592: gnus mml2015 epg: Trying and failing to encrypt email to disabled pgp-key
which was filed against the emacs,gnus package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 5592 <at> debbugs.gnu.org.
--
5592: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=5592
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
Christian von Roques <roques <at> mti.ag> writes:
> The patch below (relative to revno 99512 of emacs/trunk) adds 'disabled'
> to epg-key-capability-alist for disabled keys and uses it in
> mml2015-epg-find-usable-key to skip disabled keys.
Thanks! I just applied your patch to the trunk.
Regards,
--
Daiki Ueno
[Message part 3 (message/rfc822, inline)]
Package: emacs,gnus
Version: 23.1.1
Severity: minor
Tags: patch
"GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.12.12) of
2009-10-19 on debian-build.int-office-er.priv, modified by Debian"
When trying to send a pgp-encrypted email to a friend, using gnus,
mml2015, and epg, sending the email fails with the error message:
"Encrypt failed: exit"
My friend has two pgp-keys, of which the first has been disabled from
within "gpg --edit-key friend <at> example.com". mml2015 picks this disabled
key, tries to encrypt to it and fails.
I expected mml2015 to choose the second, not disabled, key.
The patch below (relative to revno 99512 of emacs/trunk) adds 'disabled'
to epg-key-capability-alist for disabled keys and uses it in
mml2015-epg-find-usable-key to skip disabled keys.
Note: epg already tries to determine which key is disabled using the 'd'
flag in field 2 of lines from the output of "gpg --list-keys
--with-colons". But this is not used by mml2015, does not work with
version 1.4.9 of gnupg and according to doc/DETAILS of gnupg-1.4.9 the
'd' flag in field 2 is deprecated and the 'D' in field 12 should be used
instead, which is exactly what my patch is doing. My changes should be
safe with older versions of gnupg because they just don't put 'D' in
field 12.
Christian.
=== modified file 'lisp/epg.el'
--- old/lisp/epg.el 2010-01-13 08:35:10 +0000
+++ new/lisp/epg.el 2010-02-17 19:18:09 +0000
@@ -136,9 +136,10 @@
(defvar epg-key-capablity-alist
'((?e . encrypt)
(?s . sign)
(?c . certify)
- (?a . authentication)))
+ (?a . authentication)
+ (?D . disabled)))
(defvar epg-new-signature-type-alist
'((?D . detached)
(?C . clear)
=== modified file 'lisp/gnus/mml2015.el'
--- old/lisp/gnus/mml2015.el 2010-01-13 08:35:10 +0000
+++ new/lisp/gnus/mml2015.el 2010-02-17 19:18:09 +0000
@@ -1018,8 +1018,9 @@
(while keys
(let ((pointer (epg-key-sub-key-list (car keys))))
(while pointer
(if (and (memq usage (epg-sub-key-capability (car pointer)))
+ (not (memq 'disabled (epg-sub-key-capability (car pointer))))
(not (memq (epg-sub-key-validity (car pointer))
'(revoked expired))))
(throw 'found (car keys)))
(setq pointer (cdr pointer))))
This bug report was last modified 15 years and 21 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.