summaryrefslogtreecommitdiff
path: root/lisp/epg-config.el
diff options
context:
space:
mode:
authorTeemu Likonen <tlikonen@iki.fi>2019-08-26 07:52:54 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2019-08-26 07:52:54 +0200
commitf5fa0c9062d065dc61fdff92b56b9f5da439a83d (patch)
tree36daec6a8f472c1bc66b8170171b15dc86deaeb5 /lisp/epg-config.el
parent8056d39c1d3f5e7afcc921932db04f7d1f9accf9 (diff)
downloademacs-f5fa0c9062d065dc61fdff92b56b9f5da439a83d.tar.gz
emacs-f5fa0c9062d065dc61fdff92b56b9f5da439a83d.tar.bz2
emacs-f5fa0c9062d065dc61fdff92b56b9f5da439a83d.zip
Only use --sender for gpg when gpg supports it
* lisp/epg-config.el (epg-required-version-p): New function (bug#37025). * lisp/gnus/mml-sec.el (mml-secure-epg-sign): * lisp/epg.el (epg-start-sign): (epg-start-encrypt): Use it to only use --sender when the gpg binary supports it.
Diffstat (limited to 'lisp/epg-config.el')
-rw-r--r--lisp/epg-config.el9
1 files changed, 9 insertions, 0 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."
(throw 'version-ok t)))
(error "Unsupported version: %s" version))))
+(defun epg-required-version-p (protocol required-version)
+ "Verify a sufficient version of GnuPG for specific protocol.
+PROTOCOL is symbol, either `OpenPGP' or `CMS'. REQUIRED-VERSION
+is a string containing the required version number. Return
+non-nil if that version or higher is installed."
+ (let ((version (cdr (assq 'version (epg-find-configuration protocol)))))
+ (and (stringp version)
+ (version<= required-version version))))
+
;;;###autoload
(defun epg-expand-group (config group)
"Look at CONFIG and try to expand GROUP."