;;; mml2015.el --- MIME Security with Pretty Good Privacy (PGP)
-;; Copyright (C) 2000-2011 Free Software Foundation, Inc.
+;; Copyright (C) 2000-2012 Free Software Foundation, Inc.
;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
;; Keywords: PGP MIME MML
'epg)
(error))
(progn
- (ignore-errors (require 'pgg))
- (and (fboundp 'pgg-sign-region)
- 'pgg))
+ (let ((abs-file (locate-library "pgg")))
+ ;; Don't load PGG if it is marked as obsolete
+ ;; (Emacs 24).
+ (when (and abs-file
+ (not (string-match "/obsolete/[^/]*\\'"
+ abs-file)))
+ (ignore-errors (require 'pgg))
+ (and (fboundp 'pgg-sign-region)
+ 'pgg))))
(progn (ignore-errors
(load "mc-toplev"))
(and (fboundp 'mc-encrypt-generic)
:type 'integer)
(defcustom mml2015-signers nil
- "A list of your own key ID which will be used to sign a message.
+ "A list of your own key ID(s) which will be used to sign a message.
If set, it overrides the setting of `mml2015-sign-with-sender'."
:group 'mime-security
:type '(repeat (string :tag "Key ID")))
(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
(mm-set-handle-multipart-parameter
mm-security-handle 'gnus-info "Corrupted")
(throw 'error handle))
- (setq part (mm-replace-in-string part "\n" "\r\n" t)
+ (setq part (mm-replace-in-string part "\n" "\r\n")
signature (mm-get-part signature)
context (epg-make-context))
(condition-case error