From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/59918 Path: main.gmane.org!not-for-mail From: =?utf-8?Q?Arne_J=C3=B8rgensen?= Newsgroups: gmane.emacs.gnus.general Subject: Re: S/MIME verification/decryption of MIME parts (patch) Date: Sun, 27 Feb 2005 18:16:25 +0100 Organization: Arne Joergensen -- http://arnested.dk/ Message-ID: <87y8d9udna.fsf@seamus.arnested.dk> References: <87r7j4xmb6.fsf@seamus.arnested.dk> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1109524771 29418 80.91.229.2 (27 Feb 2005 17:19:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 27 Feb 2005 17:19:31 +0000 (UTC) Original-X-From: ding-owner+M8459@lists.math.uh.edu Sun Feb 27 18:19:31 2005 Original-Received: from malifon.math.uh.edu ([129.7.128.13] ident=mail) by ciao.gmane.org with esmtp (Exim 4.43) id 1D5S4h-0000d3-8B for ding-account@gmane.org; Sun, 27 Feb 2005 18:19:23 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1D5S2e-0001Ny-00; Sun, 27 Feb 2005 11:17:16 -0600 Original-Received: from util2.math.uh.edu ([129.7.128.23]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1D5S2Y-0001Nt-00 for ding@lists.math.uh.edu; Sun, 27 Feb 2005 11:17:10 -0600 Original-Received: from quimby.gnus.org ([80.91.224.244]) by util2.math.uh.edu with esmtp (Exim 4.30) id 1D5S2V-0007zx-LD for ding@lists.math.uh.edu; Sun, 27 Feb 2005 11:17:07 -0600 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1D5S2U-0007nb-00 for ; Sun, 27 Feb 2005 18:17:06 +0100 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1D5Ry9-0008Tq-3V for ding@gnus.org; Sun, 27 Feb 2005 18:12:37 +0100 Original-Received: from 213.237.94.152 ([213.237.94.152]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 27 Feb 2005 18:12:37 +0100 Original-Received: from arne by 213.237.94.152 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 27 Feb 2005 18:12:37 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: ding@gnus.org Original-Lines: 136 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 213.237.94.152 User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (gnu/linux) X-Face: 5t,7/Y$&<1A_t.$vC2{pWZ{m@3_06;kcm]no{hgEL/}Uz(>XV6cl4}xO\v?-h3%>znNaZtq `~rf,GY1T%r=a.zH`hOb(-]'x)nI088Z&|e;V^h;/TShou Cancel-Lock: sha1:6WqTn/CoPCfCNlQ1Mrt0iVVIOgI= X-Spam-Score: -4.9 (----) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu X-MailScanner-From: ding-owner+m8459@lists.math.uh.edu X-MailScanner-To: ding-account@gmane.org Xref: main.gmane.org gmane.emacs.gnus.general:59918 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:59918 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit [ this time with the patch ] Simon Josefsson writes: > Arne Jørgensen writes: > >> Hi, >> >> I think I mentioned earlier that there is a bug when you try to >> S/MIEM-verify/decrypt a signed/encrypted MIME part. >> >> I traced the bug to be that when `mm-dissect-buffer' is called on the >> MIME parts there is no longer a "From:" field to compare against. >> >> The attached patch fixes this by passing the from field on from >> `mm-dissect-buffer' to `mm-dissect-multipart' and then again to >> `mm-dissect-buffer'. > > Applied, thanks! Super! Maybe for the v5-10 branch too? (btw, what is the policy regarding which changes go into the v5-10 branch and which don't? This change I think should because it's more of a bugfix and it will get sync'ed with emacs cvs) >> Have a nice weekend. > > Likewise. Thanks. It's been so. Kind regards, -- Arne Jørgensen --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=mm-decode_v5-10.patch Content-Transfer-Encoding: 8bit Content-Description: Patch for v5-10 branch Index: lisp/ChangeLog =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/ChangeLog,v retrieving revision 6.2771.2.122 diff -u -p -r6.2771.2.122 ChangeLog --- lisp/ChangeLog 26 Feb 2005 07:09:32 -0000 6.2771.2.122 +++ lisp/ChangeLog 27 Feb 2005 17:08:28 -0000 @@ -1,3 +1,12 @@ +2005-02-27 Arne J,Ax(Brgensen + + * mm-decode.el (mm-dissect-buffer): Pass the from field on to + `mm-dissect-multipart' and receive the from field as an (optional) + argument from `mm-dissect-multipart'. + (mm-dissect-multipart): Receive the from field as an argument and + pass it on when we call `mm-dissect-buffer' on MIME parts. Fixes + verification/decryption of signed/encrypted MIME parts. + 2005-02-26 Stefan Monnier * gnus-sum.el (gnus-summary-exit): Move point after displaying the Index: lisp/mm-decode.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/mm-decode.el,v retrieving revision 6.104.2.11 diff -u -p -r6.104.2.11 mm-decode.el --- lisp/mm-decode.el 13 Feb 2005 04:46:01 -0000 6.104.2.11 +++ lisp/mm-decode.el 27 Feb 2005 17:08:30 -0000 @@ -509,10 +509,10 @@ Postpone undisplaying of viewers for typ (message "Destroying external MIME viewers") (mm-destroy-parts mm-postponed-undisplay-list))) -(defun mm-dissect-buffer (&optional no-strict-mime loose-mime) +(defun mm-dissect-buffer (&optional no-strict-mime loose-mime from) "Dissect the current buffer and return a list of MIME handles." (save-excursion - (let (ct ctl type subtype cte cd description id result from) + (let (ct ctl type subtype cte cd description id result) (save-restriction (mail-narrow-to-head) (when (or no-strict-mime @@ -523,8 +523,9 @@ Postpone undisplaying of viewers for typ cte (mail-fetch-field "content-transfer-encoding") cd (mail-fetch-field "content-disposition") description (mail-fetch-field "content-description") - from (mail-fetch-field "from") id (mail-fetch-field "content-id")) + (unless from + (setq from (mail-fetch-field "from"))) ;; FIXME: In some circumstances, this code is running within ;; an unibyte macro. mail-extract-address-components ;; creates unibyte buffers. This `if', though not a perfect @@ -567,7 +568,7 @@ Postpone undisplaying of viewers for typ 'from from 'start start) (car ctl)) - (cons (car ctl) (mm-dissect-multipart ctl)))) + (cons (car ctl) (mm-dissect-multipart ctl from)))) (t (mm-possibly-verify-or-decrypt (mm-dissect-singlepart @@ -594,7 +595,7 @@ Postpone undisplaying of viewers for typ (mm-make-handle (mm-copy-to-buffer) ctl cte nil cdl description nil id))) -(defun mm-dissect-multipart (ctl) +(defun mm-dissect-multipart (ctl from) (goto-char (point-min)) (let* ((boundary (concat "\n--" (mail-content-type-get ctl 'boundary))) (close-delimiter (concat (regexp-quote boundary) "--[ \t]*$")) @@ -611,7 +612,7 @@ Postpone undisplaying of viewers for typ (save-excursion (save-restriction (narrow-to-region start (point)) - (setq parts (nconc (list (mm-dissect-buffer t)) parts))))) + (setq parts (nconc (list (mm-dissect-buffer t nil from)) parts))))) (end-of-line 2) (or (looking-at boundary) (forward-line 1)) @@ -620,7 +621,7 @@ Postpone undisplaying of viewers for typ (save-excursion (save-restriction (narrow-to-region start end) - (setq parts (nconc (list (mm-dissect-buffer t)) parts))))) + (setq parts (nconc (list (mm-dissect-buffer t nil from)) parts))))) (mm-possibly-verify-or-decrypt (nreverse parts) ctl))) (defun mm-copy-to-buffer () --=-=-=--