emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-24 r117311: * lisp/emacs-lisp/package.el (package--c


From: Stefan Monnier
Subject: [Emacs-diffs] emacs-24 r117311: * lisp/emacs-lisp/package.el (package--check-signature): (backport)
Date: Thu, 26 Jun 2014 13:47:42 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117311
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17625
author: Daiki Ueno <address@hidden>
committer: Stefan Monnier <address@hidden>
branch nick: emacs-24
timestamp: Thu 2014-06-26 09:47:37 -0400
message:
  * 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.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/emacs-lisp/package.el     package.el-20100617020707-ybavz666awsxwin6-2
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-06-26 13:40:49 +0000
+++ b/lisp/ChangeLog    2014-06-26 13:47:37 +0000
@@ -1,3 +1,10 @@
+2014-06-26  Daiki Ueno  <address@hidden>
+
+       * emacs-lisp/package.el (package--check-signature):
+       If package-check-signature is allow-unsigned, don't signal error when
+       we can't verify signature because of missing public key
+       (backport for bug#17625).
+
 2014-06-26  Stefan Monnier  <address@hidden>
 
        * progmodes/hideif.el: Undo last change which should only go to trunk
@@ -17,8 +24,8 @@
        * ruler-mode.el (ruler-mode-mouse-add-tab-stop)
        (ruler-mode-ruler): Fix to work with nil tab-stop-list.
 
-       * progmodes/asm-mode.el (asm-calculate-indentation): Use
-       indent-next-tab-stop.
+       * progmodes/asm-mode.el (asm-calculate-indentation):
+       Use indent-next-tab-stop.
 
        * indent.el (indent-accumulate-tab-stops): New function.
 

=== modified file 'lisp/emacs-lisp/package.el'
--- a/lisp/emacs-lisp/package.el        2014-06-25 17:20:08 +0000
+++ b/lisp/emacs-lisp/package.el        2014-06-26 13:47:37 +0000
@@ -815,16 +815,20 @@
                        (buffer-string))))
     (epg-context-set-home-directory context homedir)
     (epg-verify-string context sig-content (buffer-string))
-    ;; The .sig file may contain multiple signatures.  Success if one
-    ;; of the signatures is good.
-    (let ((good-signatures
-           (delq nil (mapcar (lambda (sig)
-                               (if (eq (epg-signature-status sig) 'good)
-                                   sig))
-                             (epg-context-result-for context 'verify)))))
-      (if (null good-signatures)
-          ;; FIXME: Only signal an error if the signature is invalid, not if we
-          ;; simply lack the key needed to check the sig!
+    (let (good-signatures had-fatal-error)
+      ;; The .sig file may contain multiple signatures.  Success if one
+      ;; of the signatures is good.
+      (dolist (sig (epg-context-result-for context 'verify))
+       (if (eq (epg-signature-status sig) 'good)
+           (push sig good-signatures)
+         ;; If package-check-signature is allow-unsigned, don't
+         ;; signal error when we can't verify signature because of
+         ;; missing public key.  Other errors are still treated as
+         ;; fatal (bug#17625).
+         (unless (and (eq package-check-signature 'allow-unsigned)
+                      (eq (epg-signature-status sig) 'no-pubkey))
+           (setq had-fatal-error t))))
+      (if (and (null good-signatures) had-fatal-error)
           (error "Failed to verify signature %s: %S"
                  sig-file
                  (mapcar #'epg-signature-to-string


reply via email to

[Prev in Thread] Current Thread [Next in Thread]