* epg.el (epg--status-NO_PUBKEY): Replace the previous signature's
authorueno <ueno>
Fri, 26 May 2006 22:33:32 +0000 (22:33 +0000)
committerueno <ueno>
Fri, 26 May 2006 22:33:32 +0000 (22:33 +0000)
status from 'error to 'no-pubkey.
(epg--status-ERRSIG): Just add 'error signature to the verify result.

ChangeLog
epg.el

index 13e3c91..1d77d3f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2006-05-26  Daiki Ueno  <ueno@unixuser.org>
 
+       * epg.el (epg--status-NO_PUBKEY): Replace the previous signature's
+       status from 'error to 'no-pubkey.
+       (epg--status-ERRSIG): Just add 'error signature to the verify result.
+
        * epa.el (epa-insert-keys): Renamed from epa-list-keys-1; don't
        disable inhibit-quit here; make text-properties nonsticky.
        (epa-popup-info-window): New user option.
diff --git a/epg.el b/epg.el
index e56d635..13156bc 100644 (file)
--- a/epg.el
+++ b/epg.el
@@ -1040,36 +1040,32 @@ This function is for internal use only."
   (epg--status-*SIG 'bad string))
 
 (defun epg--status-NO_PUBKEY (process string)
-  (epg-context-set-result-for
-     epg-context
-     'verify
-     (cons (epg-make-signature 'no-pubkey string)
-          (epg-context-result-for epg-context 'verify))))
+  (let ((signature (car (epg-context-result-for epg-context 'verify))))
+    (if (and signature
+            (eq (epg-signature-status signature) 'error))
+       (epg-signature-set-status signature 'no-pubkey))))
 
 (defun epg--status-ERRSIG (process string)
-  (let ((signatures (epg-context-result-for epg-context 'verify)))
-    (unless signatures
-      (setq signatures (list (epg-make-signature 'error)))
-      (epg-context-set-result-for epg-context 'verify signatures))
-    (when (and (not (eq (epg-signature-status (car signatures)) 'good))
-              (string-match "\\`\\([^ ]+\\) \\([0-9]+\\) \\([0-9]+\\) \
+  (if (string-match "\\`\\([^ ]+\\) \\([0-9]+\\) \\([0-9]+\\) \
 \\([0-9A-Fa-f][0-9A-Fa-f]\\) \\([^ ]+\\) \\([0-9]+\\)"
-                            string))
-      (epg-signature-set-key-id
-       (car signatures)
-       (match-string 1 string))
-      (epg-signature-set-pubkey-algorithm
-       (car signatures)
-       (string-to-number (match-string 2 string)))
-      (epg-signature-set-digest-algorithm
-       (car signatures)
-       (string-to-number (match-string 3 string)))
-      (epg-signature-set-class
-       (car signatures)
-       (string-to-number (match-string 4 string) 16))
-      (epg-signature-set-creation-time
-       (car signatures)
-       (match-string 5 string)))))
+                   string)
+      (let ((signature (epg-make-signature 'error)))
+       (epg-context-set-result-for epg-context 'verify (list signature))
+       (epg-signature-set-key-id
+        signature
+        (match-string 1 string))
+       (epg-signature-set-pubkey-algorithm
+        signature
+        (string-to-number (match-string 2 string)))
+       (epg-signature-set-digest-algorithm
+        signature
+        (string-to-number (match-string 3 string)))
+       (epg-signature-set-class
+        signature
+        (string-to-number (match-string 4 string) 16))
+       (epg-signature-set-creation-time
+        signature
+        (match-string 5 string)))))
 
 (defun epg--status-VALIDSIG (process string)
   (let ((signature (car (epg-context-result-for epg-context 'verify))))