aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2019-05-12 13:03:24 -0400
committerStefan Monnier2019-05-12 13:03:24 -0400
commit3c1967dbfe06b28ac074aee1e55a79bacfc36f8d (patch)
treea01ef5a8fd62984ecfd42f237dcda741544a317d
parent29531785a17acf519070b73b488ad87ddd94aff7 (diff)
downloademacs-3c1967dbfe06b28ac074aee1e55a79bacfc36f8d.tar.gz
emacs-3c1967dbfe06b28ac074aee1e55a79bacfc36f8d.zip
* lisp/emacs-lisp/packages.el: Add `all` to package-check-signature
(package-check-signature): Add `all` option. (package--check-signature-content): Adjust accordingly.
-rw-r--r--etc/NEWS6
-rw-r--r--lisp/emacs-lisp/package.el18
2 files changed, 19 insertions, 5 deletions
diff --git a/etc/NEWS b/etc/NEWS
index d10a5532447..43ad8be1cc1 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -718,6 +718,12 @@ it can't find the config file.
718 718
719** Package 719** Package
720 720
721*** Change of 'package-check-signature' for packages with multiple sigs
722In previous Emacsen, 't' checked that all signatures are valid.
723Now 't' only checks that at least one signature is valid and the new 'all'
724value needs to be used if you want to enforce that all signatures
725are valid. This only affects packages with multiple signatures.
726
721*** New function 'package-get-version' lets packages query their own version. 727*** New function 'package-get-version' lets packages query their own version.
722Example use in auctex.el: '(defconst auctex-version (package-get-version))' 728Example use in auctex.el: '(defconst auctex-version (package-get-version))'
723 729
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 61cf6906971..949ad711ae3 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -334,16 +334,22 @@ default directory."
334 (epg-find-configuration 'OpenPGP)) 334 (epg-find-configuration 'OpenPGP))
335 'allow-unsigned) 335 'allow-unsigned)
336 "Non-nil means to check package signatures when installing. 336 "Non-nil means to check package signatures when installing.
337The value `allow-unsigned' means to still install a package even if 337More specifically the value can be:
338it is unsigned. 338- nil: package signatures are ignored.
339- `allow-unsigned': install a package even if it is unsigned,
340 but if it is signed and we have the key for it, verify the signature.
341- t: accept a package only if it comes with at least one verified signature.
342- `all': same as t, except when the package has several signatures,
343 in which case we verify all the signatures.
339 344
340This also applies to the \"archive-contents\" file that lists the 345This also applies to the \"archive-contents\" file that lists the
341contents of the archive." 346contents of the archive."
342 :type '(choice (const nil :tag "Never") 347 :type '(choice (const nil :tag "Never")
343 (const allow-unsigned :tag "Allow unsigned") 348 (const allow-unsigned :tag "Allow unsigned")
344 (const t :tag "Check always")) 349 (const t :tag "Check always")
350 (const all :tag "Check all signatures"))
345 :risky t 351 :risky t
346 :version "24.4") 352 :version "27.1")
347 353
348(defcustom package-unsigned-archives nil 354(defcustom package-unsigned-archives nil
349 "List of archives where we do not check for package signatures." 355 "List of archives where we do not check for package signatures."
@@ -1257,7 +1263,9 @@ errors."
1257 (unless (and (eq package-check-signature 'allow-unsigned) 1263 (unless (and (eq package-check-signature 'allow-unsigned)
1258 (eq (epg-signature-status sig) 'no-pubkey)) 1264 (eq (epg-signature-status sig) 'no-pubkey))
1259 (setq had-fatal-error t)))) 1265 (setq had-fatal-error t))))
1260 (when (or (null good-signatures) had-fatal-error) 1266 (when (or (null good-signatures)
1267 (and (eq package-check-signature 'all)
1268 had-fatal-error))
1261 (package--display-verify-error context sig-file) 1269 (package--display-verify-error context sig-file)
1262 (signal 'bad-signature (list sig-file))) 1270 (signal 'bad-signature (list sig-file)))
1263 good-signatures))) 1271 good-signatures)))