* pgg-gpg.el (pgg-gpg-verify-region): Filter out stuff into output
authorSimon Josefsson <jas@extundo.com>
Thu, 10 Oct 2002 02:14:03 +0000 (02:14 +0000)
committerSimon Josefsson <jas@extundo.com>
Thu, 10 Oct 2002 02:14:03 +0000 (02:14 +0000)
buffer and error buffer depending on type of information.

* mml2015.el (mml2015-gpg-extract-signature-details): Parse
--status-fd stuff even if gpg.el is not used (revert earlier
change).
(mml2015-pgg-{clear-,}verify): Store both output and errors as
gnus details.
(mml2015-pgg-{clear-,}verify): Extract signature info from errors
buffer.

lisp/ChangeLog
lisp/mml2015.el
lisp/pgg-gpg.el

index 005e8f5..ce73070 100644 (file)
@@ -1,5 +1,16 @@
 2002-10-10  Simon Josefsson  <jas@extundo.com>
 
+       * pgg-gpg.el (pgg-gpg-verify-region): Filter out stuff into output
+       buffer and error buffer depending on type of information.
+
+       * mml2015.el (mml2015-gpg-extract-signature-details): Parse
+       --status-fd stuff even if gpg.el is not used (revert earlier
+       change).
+       (mml2015-pgg-{clear-,}verify): Store both output and errors as
+       gnus details.
+       (mml2015-pgg-{clear-,}verify): Extract signature info from errors
+       buffer.
+
        * pgg.el (pgg-verify-region): Use it.
 
        * pgg-def.el (pgg-query-keyserver): New variable.
index 7e8cb28..885feb9 100644 (file)
@@ -427,8 +427,7 @@ by you.")
 
 (defun mml2015-gpg-extract-signature-details ()
   (goto-char (point-min))
-  (if (and (eq mml2015-use 'gpg)
-          (boundp 'gpg-unabbrev-trust-alist))
+  (if (boundp 'gpg-unabbrev-trust-alist)
       (let* ((expired (re-search-forward
                       "^\\[GNUPG:\\] SIGEXPIRED$"
                       nil t))
@@ -737,11 +736,14 @@ by you.")
          (mm-insert-part signature))
        (if (condition-case err
                (prog1
-                   (pgg-verify-region (point-min) (point-max) signature-file t)
+                   (pgg-verify-region (point-min) (point-max) 
+                                      signature-file t)
                  (mm-set-handle-multipart-parameter
                   mm-security-handle 'gnus-details
-                  (with-current-buffer pgg-output-buffer
-                    (buffer-string))))
+                  (concat (with-current-buffer pgg-output-buffer
+                            (buffer-string))
+                          (with-current-buffer pgg-errors-buffer
+                            (buffer-string)))))
              (error
               (mm-set-handle-multipart-parameter
                mm-security-handle 'gnus-details (mml2015-format-error err))
@@ -754,7 +756,7 @@ by you.")
              (delete-file signature-file)
              (mm-set-handle-multipart-parameter
               mm-security-handle 'gnus-info
-              (with-current-buffer pgg-output-buffer
+              (with-current-buffer pgg-errors-buffer
                 (mml2015-gpg-extract-signature-details))))
          (delete-file signature-file)
          (mm-set-handle-multipart-parameter
@@ -771,8 +773,10 @@ by you.")
                  (pgg-verify-region (point-min) (point-max) nil t))
              (mm-set-handle-multipart-parameter
               mm-security-handle 'gnus-details
-              (with-current-buffer mml2015-result-buffer
-                (buffer-string))))
+              (concat (with-current-buffer pgg-output-buffer
+                        (buffer-string))
+                      (with-current-buffer pgg-errors-buffer
+                        (buffer-string)))))
          (error
           (mm-set-handle-multipart-parameter
            mm-security-handle 'gnus-details (mml2015-format-error err))
@@ -783,7 +787,7 @@ by you.")
           nil))
        (mm-set-handle-multipart-parameter
         mm-security-handle 'gnus-info
-        (with-current-buffer pgg-output-buffer
+        (with-current-buffer pgg-errors-buffer
           (mml2015-gpg-extract-signature-details)))
       (mm-set-handle-multipart-parameter
        mm-security-handle 'gnus-info "Failed"))))
index be9f7cd..16c7a47 100644 (file)
@@ -192,14 +192,13 @@ If optional argument SIGN is non-nil, do a combined sign and encrypt."
     (pgg-gpg-process-region start end nil pgg-gpg-program args)
     (with-current-buffer pgg-errors-buffer
       (goto-char (point-min))
-      (while (re-search-forward "^gpg: " nil t)
-       (replace-match ""))
+      (while (re-search-forward "^gpg: \\(.*\\)\n" nil t)
+       (with-current-buffer pgg-output-buffer
+         (insert-buffer-substring pgg-errors-buffer
+                                  (match-beginning 1) (match-end 0)))
+       (delete-region (match-beginning 0) (match-end 0)))
       (goto-char (point-min))
-      (prog1 (re-search-forward "^\\[GNUPG:] GOODSIG\\>" nil t)
-       (goto-char (point-min))
-       (delete-matching-lines "^warning\\|\\[GNUPG:]")
-       (set-buffer pgg-output-buffer)
-       (insert-buffer-substring pgg-errors-buffer)))))
+      (re-search-forward "^\\[GNUPG:] GOODSIG\\>" nil t))))
 
 (defun pgg-gpg-insert-key ()
   "Insert public key at point."