changeset 108294:023a01688e8b

Skip disabled PGP key when encrypting mail with Gnus. * lisp/epg.el (epg-key-capablity-alist): Add "D" flag (Bug#5592). * lisp/gnus/mml2015.el (mml2015-epg-find-usable-key): Skip disabled key (Bug#5592).
author Daiki Ueno <ueno@unixuser.org>
date Fri, 07 May 2010 17:10:28 +0900
parents 0930523ce0d9
children 47521399f06e
files lisp/ChangeLog lisp/epg.el lisp/gnus/ChangeLog lisp/gnus/mml2015.el
diffstat 4 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri May 07 07:43:41 2010 +0000
+++ b/lisp/ChangeLog	Fri May 07 17:10:28 2010 +0900
@@ -1,3 +1,7 @@
+2010-05-07  Christian von Roques <roques@mti.ag> (tiny change)
+
+	* lisp/epg.el (epg-key-capablity-alist): Add "D" flag (Bug#5592).
+
 2010-05-07  Katsumi Yamaoka  <yamaoka@jpl.org>
 
 	* mail/binhex.el (binhex-decode-region-internal)
--- a/lisp/epg.el	Fri May 07 07:43:41 2010 +0000
+++ b/lisp/epg.el	Fri May 07 17:10:28 2010 +0900
@@ -137,7 +137,8 @@
   '((?e . encrypt)
     (?s . sign)
     (?c . certify)
-    (?a . authentication)))
+    (?a . authentication)
+    (?D . disabled)))
 
 (defvar epg-new-signature-type-alist
   '((?D . detached)
--- a/lisp/gnus/ChangeLog	Fri May 07 07:43:41 2010 +0000
+++ b/lisp/gnus/ChangeLog	Fri May 07 17:10:28 2010 +0900
@@ -1,3 +1,8 @@
+2010-05-07  Christian von Roques <roques@mti.ag> (tiny change)
+
+	* mml2015.el (mml2015-epg-find-usable-key): Skip disabled key
+	(Bug#5592).
+
 2010-05-07  Julien Danjou  <julien@danjou.info>
 
 	* gnus-art.el (gnus-mime-pipe-part): Add optional argument `cmd'; pass
--- a/lisp/gnus/mml2015.el	Fri May 07 07:43:41 2010 +0000
+++ b/lisp/gnus/mml2015.el	Fri May 07 17:10:28 2010 +0900
@@ -1021,6 +1021,7 @@
       (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)))