diff options
| -rw-r--r-- | lisp/epg-config.el | 9 | ||||
| -rw-r--r-- | lisp/epg.el | 10 | ||||
| -rw-r--r-- | lisp/gnus/mml-sec.el | 8 |
3 files changed, 20 insertions, 7 deletions
diff --git a/lisp/epg-config.el b/lisp/epg-config.el index 55490681698..54328290c8f 100644 --- a/lisp/epg-config.el +++ b/lisp/epg-config.el | |||
| @@ -262,6 +262,15 @@ a single minimum version string." | |||
| 262 | (throw 'version-ok t))) | 262 | (throw 'version-ok t))) |
| 263 | (error "Unsupported version: %s" version)))) | 263 | (error "Unsupported version: %s" version)))) |
| 264 | 264 | ||
| 265 | (defun epg-required-version-p (protocol required-version) | ||
| 266 | "Verify a sufficient version of GnuPG for specific protocol. | ||
| 267 | PROTOCOL is symbol, either `OpenPGP' or `CMS'. REQUIRED-VERSION | ||
| 268 | is a string containing the required version number. Return | ||
| 269 | non-nil if that version or higher is installed." | ||
| 270 | (let ((version (cdr (assq 'version (epg-find-configuration protocol))))) | ||
| 271 | (and (stringp version) | ||
| 272 | (version<= required-version version)))) | ||
| 273 | |||
| 265 | ;;;###autoload | 274 | ;;;###autoload |
| 266 | (defun epg-expand-group (config group) | 275 | (defun epg-expand-group (config group) |
| 267 | "Look at CONFIG and try to expand GROUP." | 276 | "Look at CONFIG and try to expand GROUP." |
diff --git a/lisp/epg.el b/lisp/epg.el index ce58c520f17..6d377d07e29 100644 --- a/lisp/epg.el +++ b/lisp/epg.el | |||
| @@ -1618,7 +1618,9 @@ If you are unsure, use synchronous version of this function | |||
| 1618 | (car (epg-key-sub-key-list signer))))) | 1618 | (car (epg-key-sub-key-list signer))))) |
| 1619 | (epg-context-signers context))) | 1619 | (epg-context-signers context))) |
| 1620 | (let ((sender (epg-context-sender context))) | 1620 | (let ((sender (epg-context-sender context))) |
| 1621 | (when (stringp sender) | 1621 | (when (and (eql 'OpenPGP (epg-context-protocol context)) |
| 1622 | (epg-required-version-p 'OpenPGP "2.1.15") | ||
| 1623 | (stringp sender)) | ||
| 1622 | (list "--sender" sender))) | 1624 | (list "--sender" sender))) |
| 1623 | (epg--args-from-sig-notations | 1625 | (epg--args-from-sig-notations |
| 1624 | (epg-context-sig-notations context)) | 1626 | (epg-context-sig-notations context)) |
| @@ -1714,9 +1716,11 @@ If you are unsure, use synchronous version of this function | |||
| 1714 | (car (epg-key-sub-key-list | 1716 | (car (epg-key-sub-key-list |
| 1715 | signer))))) | 1717 | signer))))) |
| 1716 | (epg-context-signers context)))) | 1718 | (epg-context-signers context)))) |
| 1717 | (if sign | 1719 | (if (and sign |
| 1720 | (eql 'OpenPGP (epg-context-protocol context))) | ||
| 1718 | (let ((sender (epg-context-sender context))) | 1721 | (let ((sender (epg-context-sender context))) |
| 1719 | (when (stringp sender) | 1722 | (when (and (epg-required-version-p 'OpenPGP "2.1.15") |
| 1723 | (stringp sender)) | ||
| 1720 | (list "--sender" sender)))) | 1724 | (list "--sender" sender)))) |
| 1721 | (if sign | 1725 | (if sign |
| 1722 | (epg--args-from-sig-notations | 1726 | (epg--args-from-sig-notations |
diff --git a/lisp/gnus/mml-sec.el b/lisp/gnus/mml-sec.el index 07d20285343..e0ec829617f 100644 --- a/lisp/gnus/mml-sec.el +++ b/lisp/gnus/mml-sec.el | |||
| @@ -915,7 +915,7 @@ If no one is selected, symmetric encryption will be performed. " | |||
| 915 | (when sign | 915 | (when sign |
| 916 | (setq signers (mml-secure-signers context signer-names)) | 916 | (setq signers (mml-secure-signers context signer-names)) |
| 917 | (setf (epg-context-signers context) signers) | 917 | (setf (epg-context-signers context) signers) |
| 918 | (when mml-secure-openpgp-sign-with-sender | 918 | (when (and (eq 'OpenPGP protocol) mml-secure-openpgp-sign-with-sender) |
| 919 | (setf (epg-context-sender context) sender))) | 919 | (setf (epg-context-sender context) sender))) |
| 920 | (when (eq 'OpenPGP protocol) | 920 | (when (eq 'OpenPGP protocol) |
| 921 | (setf (epg-context-armor context) t) | 921 | (setf (epg-context-armor context) t) |
| @@ -945,10 +945,10 @@ If no one is selected, symmetric encryption will be performed. " | |||
| 945 | signature micalg) | 945 | signature micalg) |
| 946 | (when (eq 'OpenPGP protocol) | 946 | (when (eq 'OpenPGP protocol) |
| 947 | (setf (epg-context-armor context) t) | 947 | (setf (epg-context-armor context) t) |
| 948 | (setf (epg-context-textmode context) t)) | 948 | (setf (epg-context-textmode context) t) |
| 949 | (when mml-secure-openpgp-sign-with-sender | ||
| 950 | (setf (epg-context-sender context) sender))) | ||
| 949 | (setf (epg-context-signers context) signers) | 951 | (setf (epg-context-signers context) signers) |
| 950 | (when mml-secure-openpgp-sign-with-sender | ||
| 951 | (setf (epg-context-sender context) sender)) | ||
| 952 | (when (mml-secure-cache-passphrase-p protocol) | 952 | (when (mml-secure-cache-passphrase-p protocol) |
| 953 | (epg-context-set-passphrase-callback | 953 | (epg-context-set-passphrase-callback |
| 954 | context | 954 | context |