diff options
| author | Stefan Monnier | 2019-05-12 13:03:24 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2019-05-12 13:03:24 -0400 |
| commit | 3c1967dbfe06b28ac074aee1e55a79bacfc36f8d (patch) | |
| tree | a01ef5a8fd62984ecfd42f237dcda741544a317d | |
| parent | 29531785a17acf519070b73b488ad87ddd94aff7 (diff) | |
| download | emacs-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/NEWS | 6 | ||||
| -rw-r--r-- | lisp/emacs-lisp/package.el | 18 |
2 files changed, 19 insertions, 5 deletions
| @@ -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 | ||
| 722 | In previous Emacsen, 't' checked that all signatures are valid. | ||
| 723 | Now 't' only checks that at least one signature is valid and the new 'all' | ||
| 724 | value needs to be used if you want to enforce that all signatures | ||
| 725 | are 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. |
| 722 | Example use in auctex.el: '(defconst auctex-version (package-get-version))' | 728 | Example 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. |
| 337 | The value `allow-unsigned' means to still install a package even if | 337 | More specifically the value can be: |
| 338 | it 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 | ||
| 340 | This also applies to the \"archive-contents\" file that lists the | 345 | This also applies to the \"archive-contents\" file that lists the |
| 341 | contents of the archive." | 346 | contents 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))) |