aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier2019-05-12 13:03:24 -0400
committerStefan Monnier2019-05-12 13:03:24 -0400
commit3c1967dbfe06b28ac074aee1e55a79bacfc36f8d (patch)
treea01ef5a8fd62984ecfd42f237dcda741544a317d /lisp
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.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/emacs-lisp/package.el18
1 files changed, 13 insertions, 5 deletions
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)))