emacs-devel
[Top][All Lists]
Advanced

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

Please install this for me (2)


From: Richard Stallman
Subject: Please install this for me (2)
Date: Sat, 23 Feb 2019 23:45:02 -0500

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

Would someone please install this bug fix?

2019-02-23  Richard Stallman  <address@hidden>

        * lisp/mail/rmail.el (rmail-epa-decrypt): 
        Don't decrypt an armor that was copied into
        the message from a message it is a reply to.
        (rmail-epa-decrypt-1): Catch and ignore errors
        in epa-decrypt-region.
        Make armor-start and armor-end markers.

diff -u /home/rms/emacs-git/build-oct-4/lisp/mail/rmail.el.\~1\~ 
/home/rms/emacs-git/build-oct-4/lisp/mail/rmail.el
--- /home/rms/emacs-git/build-oct-4/lisp/mail/rmail.el.~1~      2018-11-17 
18:00:19.352983946 -0500
+++ /home/rms/emacs-git/build-oct-4/lisp/mail/rmail.el  2018-11-17 
18:05:37.168476414 -0500
@@ -4548,6 +4548,9 @@
 
     (unless armor-end
       (error "Encryption armor beginning has no matching end"))
+    (setq armor-start (move-marker (make-marker) armor-start))
+    (setq armor-end (move-marker (make-marker) armor-end))
+
     (goto-char armor-start)
 
     ;; Because epa--find-coding-system-for-mime-charset not autoloaded.
@@ -4580,16 +4583,17 @@
         (mail-unquote-printable-region armor-start
                                        (- (point-max) after-end))))
 
-    ;; Decrypt it, maybe in place, maybe making new buffer.
-    (epa-decrypt-region
-     armor-start (- (point-max) after-end)
-     ;; Call back this function to prepare the output.
-     (lambda ()
-       (let ((inhibit-read-only t))
-         (delete-region armor-start (- (point-max) after-end))
-         (goto-char armor-start)
-         (current-buffer))))
-
+    (condition-case nil
+        (epa-decrypt-region
+         armor-start (- (point-max) after-end)
+         ;; Call back this function to prepare the output.
+         (lambda ()
+           (let ((inhibit-read-only t))
+             (delete-region armor-start (- (point-max) after-end))
+             (goto-char armor-start)
+             (current-buffer))))
+      (error nil))
+ 
     (list armor-start (- (point-max) after-end) mime
           armor-end-regexp
           (buffer-substring armor-start (- (point-max) after-end)))))
@@ -4624,9 +4628,14 @@
       (goto-char (point-min))
       (while (re-search-forward "-----BEGIN PGP MESSAGE-----$" nil t)
        (let ((coding-system-for-read coding-system-for-read)
-             (case-fold-search t))
-
-          (push (rmail-epa-decrypt-1 mime) decrypts)))
+             (case-fold-search t)
+              (armor-start (match-beginning 0)))
+          ;; Don't decrypt an armor that was copied into
+          ;; the message from a message it is a reply to.
+          (or (equal (buffer-substring (line-beginning-position)
+                                       armor-start)
+                     "> ")
+              (push (rmail-epa-decrypt-1 mime) decrypts))))
 
       (when (and decrypts (eq major-mode 'rmail-mode))
         (rmail-add-label "decrypt"))

Diff finished.  Sat Feb 23 20:23:43 2019

-- 
Dr Richard Stallman
President, Free Software Foundation (https://gnu.org, https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





reply via email to

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