summaryrefslogtreecommitdiff
path: root/lisp/gnus/mml1991.el
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@unixuser.org>2011-10-17 04:29:19 +0000
committerKatsumi Yamaoka <yamaoka@jpl.org>2011-10-17 04:29:19 +0000
commit344465fd3b73502ea266e1009e99be93600d812f (patch)
treea9d82dfa751db2bc0813dfadb28a3f25d135394b /lisp/gnus/mml1991.el
parent21fedf28e5c59fd17e846f4b8abcbb223ae5ed90 (diff)
downloademacs-344465fd3b73502ea266e1009e99be93600d812f.tar.gz
Merge changes made in Gnus trunk.
mml2015.el (mml2015-epg-find-usable-key): Skip the whole key if the primary key is marked as disabled. mml1991.el (mml1991-epg-find-usable-key): Ditto. Thanks to Christian von Roques <roques@mti.ag>.
Diffstat (limited to 'lisp/gnus/mml1991.el')
-rw-r--r--lisp/gnus/mml1991.el17
1 files changed, 10 insertions, 7 deletions
diff --git a/lisp/gnus/mml1991.el b/lisp/gnus/mml1991.el
index ad9f95796fe..1777a660319 100644
--- a/lisp/gnus/mml1991.el
+++ b/lisp/gnus/mml1991.el
@@ -282,13 +282,16 @@ Whether the passphrase is cached at all is controlled by
(catch 'found
(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))))
+ ;; The primary key will be marked as disabled, when the entire
+ ;; key is disabled (see 12 Field, Format of colon listings, in
+ ;; gnupg/doc/DETAILS)
+ (unless (memq 'disabled (epg-sub-key-capability (car pointer)))
+ (while pointer
+ (if (and (memq usage (epg-sub-key-capability (car pointer)))
+ (not (memq (epg-sub-key-validity (car pointer))
+ '(revoked expired))))
+ (throw 'found (car keys)))
+ (setq pointer (cdr pointer)))))
(setq keys (cdr keys)))))
;; XXX: since gpg --list-secret-keys does not return validity of each