aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaiki Ueno2014-06-26 09:47:37 -0400
committerStefan Monnier2014-06-26 09:47:37 -0400
commit2493e35c369caabf6a65e376fd0399e95b588bfd (patch)
treec652898af7eed009320bbbdd02da8a24d987b364
parent7d1fd42bd6480aa9ea1286dba3c730c2391fcc2b (diff)
downloademacs-2493e35c369caabf6a65e376fd0399e95b588bfd.tar.gz
emacs-2493e35c369caabf6a65e376fd0399e95b588bfd.zip
* lisp/emacs-lisp/package.el (package--check-signature): (backport)
If package-check-signature is allow-unsigned, don't signal error when we can't verify signature because of missing public key. Fixes: debbugs:17625
-rw-r--r--lisp/ChangeLog11
-rw-r--r--lisp/emacs-lisp/package.el24
2 files changed, 23 insertions, 12 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 8cc59d88615..6c8f118c8a3 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12014-06-26 Daiki Ueno <ueno@gnu.org>
2
3 * emacs-lisp/package.el (package--check-signature):
4 If package-check-signature is allow-unsigned, don't signal error when
5 we can't verify signature because of missing public key
6 (backport for bug#17625).
7
12014-06-26 Stefan Monnier <monnier@iro.umontreal.ca> 82014-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
2 9
3 * progmodes/hideif.el: Undo last change which should only go to trunk 10 * progmodes/hideif.el: Undo last change which should only go to trunk
@@ -17,8 +24,8 @@
17 * ruler-mode.el (ruler-mode-mouse-add-tab-stop) 24 * ruler-mode.el (ruler-mode-mouse-add-tab-stop)
18 (ruler-mode-ruler): Fix to work with nil tab-stop-list. 25 (ruler-mode-ruler): Fix to work with nil tab-stop-list.
19 26
20 * progmodes/asm-mode.el (asm-calculate-indentation): Use 27 * progmodes/asm-mode.el (asm-calculate-indentation):
21 indent-next-tab-stop. 28 Use indent-next-tab-stop.
22 29
23 * indent.el (indent-accumulate-tab-stops): New function. 30 * indent.el (indent-accumulate-tab-stops): New function.
24 31
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 6efe6c7135a..b70b478cd32 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -815,16 +815,20 @@ GnuPG keyring is located under \"gnupg\" in `package-user-dir'."
815 (buffer-string)))) 815 (buffer-string))))
816 (epg-context-set-home-directory context homedir) 816 (epg-context-set-home-directory context homedir)
817 (epg-verify-string context sig-content (buffer-string)) 817 (epg-verify-string context sig-content (buffer-string))
818 ;; The .sig file may contain multiple signatures. Success if one 818 (let (good-signatures had-fatal-error)
819 ;; of the signatures is good. 819 ;; The .sig file may contain multiple signatures. Success if one
820 (let ((good-signatures 820 ;; of the signatures is good.
821 (delq nil (mapcar (lambda (sig) 821 (dolist (sig (epg-context-result-for context 'verify))
822 (if (eq (epg-signature-status sig) 'good) 822 (if (eq (epg-signature-status sig) 'good)
823 sig)) 823 (push sig good-signatures)
824 (epg-context-result-for context 'verify))))) 824 ;; If package-check-signature is allow-unsigned, don't
825 (if (null good-signatures) 825 ;; signal error when we can't verify signature because of
826 ;; FIXME: Only signal an error if the signature is invalid, not if we 826 ;; missing public key. Other errors are still treated as
827 ;; simply lack the key needed to check the sig! 827 ;; fatal (bug#17625).
828 (unless (and (eq package-check-signature 'allow-unsigned)
829 (eq (epg-signature-status sig) 'no-pubkey))
830 (setq had-fatal-error t))))
831 (if (and (null good-signatures) had-fatal-error)
828 (error "Failed to verify signature %s: %S" 832 (error "Failed to verify signature %s: %S"
829 sig-file 833 sig-file
830 (mapcar #'epg-signature-to-string 834 (mapcar #'epg-signature-to-string