From 5146e84c0337eb8d9b207931fd41c692bd57f6b0 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Fri, 7 May 2010 17:10:28 +0900 Subject: [PATCH] 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). --- lisp/ChangeLog | 4 ++++ lisp/epg.el | 3 ++- lisp/gnus/ChangeLog | 5 +++++ lisp/gnus/mml2015.el | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3d28a4ffda7..df7d21c6124 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2010-05-07 Christian von Roques (tiny change) + + * lisp/epg.el (epg-key-capablity-alist): Add "D" flag (Bug#5592). + 2010-05-07 Katsumi Yamaoka * mail/binhex.el (binhex-decode-region-internal) diff --git a/lisp/epg.el b/lisp/epg.el index 7791c1865a7..6e69ae09da4 100644 --- a/lisp/epg.el +++ b/lisp/epg.el @@ -137,7 +137,8 @@ '((?e . encrypt) (?s . sign) (?c . certify) - (?a . authentication))) + (?a . authentication) + (?D . disabled))) (defvar epg-new-signature-type-alist '((?D . detached) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index d429c0e319f..d78e07037b4 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,8 @@ +2010-05-07 Christian von Roques (tiny change) + + * mml2015.el (mml2015-epg-find-usable-key): Skip disabled key + (Bug#5592). + 2010-05-07 Julien Danjou * gnus-art.el (gnus-mime-pipe-part): Add optional argument `cmd'; pass diff --git a/lisp/gnus/mml2015.el b/lisp/gnus/mml2015.el index 6725709c044..130a3ca86a5 100644 --- a/lisp/gnus/mml2015.el +++ b/lisp/gnus/mml2015.el @@ -1021,6 +1021,7 @@ Whether the passphrase is cached at all is controlled by (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))) -- 2.39.2