From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/61895 Path: news.gmane.org!not-for-mail From: Daiki Ueno Newsgroups: gmane.emacs.gnus.general,gmane.mail.mh-e.devel Subject: Re: Gnus 5.10.6 problems with PGP/MIME (test cases) Date: Wed, 08 Feb 2006 17:09:51 +0900 Message-ID: <7334ab51-5c86-4d97-92cb-21f2e7debd8d@well-done.deisui.org> References: <19643.1137028354@juniper.net> <26554.1137393402@juniper.net> <25107.1137439020@olgas.newt.com> <73630.1137440939@juniper.net> <31430.1137488443@juniper.net> <85906.1137521874@juniper.net> <53032.1137578648@juniper.net> <8b63142a-b090-4783-a3a5-0832d7289f38@well-done.deisui.org> <26653.1139305204@juniper.net> <9bda6607-510b-468c-bd1e-ec9b8865cdd2@well-done.deisui.org> <15566.1139355525@juniper.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Wed_Feb__8_17:09:51_2006-1" X-Trace: sea.gmane.org 1139386438 15259 80.91.229.2 (8 Feb 2006 08:13:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 8 Feb 2006 08:13:58 +0000 (UTC) Cc: ding@gnus.org, mh-e-devel@lists.sourceforge.net Original-X-From: ding-owner+m10424@lists.math.uh.edu Wed Feb 08 09:13:55 2006 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1F6kSW-0002LJ-To for ding-account@gmane.org; Wed, 08 Feb 2006 09:13:53 +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 1F6kSR-00070N-00; Wed, 08 Feb 2006 02:13:47 -0600 Original-Received: from nas01.math.uh.edu ([129.7.128.39]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1F6kOo-00070H-00 for ding@lists.math.uh.edu; Wed, 08 Feb 2006 02:10:02 -0600 Original-Received: from quimby.gnus.org ([80.91.224.244]) by nas01.math.uh.edu with esmtp (Exim 4.52) id 1F6kOl-0004is-NV for ding@lists.math.uh.edu; Wed, 08 Feb 2006 02:10:02 -0600 Original-Received: from g96069.scn-net.ne.jp ([210.231.96.69] helo=well-done.deisui.org) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1F6kOk-00070T-00 for ; Wed, 08 Feb 2006 09:09:58 +0100 Original-Received: from [150.82.173.221] (helo=well-done.deisui.org) by well-done.deisui.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1F6kOg-00064P-3h; Wed, 08 Feb 2006 17:09:54 +0900 Original-To: "Mark D. Baushke" , yamaoka@jpl.org X-Attribution: DU In-Reply-To: <15566.1139355525@juniper.net> (Mark D. Baushke's message of "Tue, 07 Feb 2006 15:38:45 -0800") User-Agent: T-gnus/6.17.2 (based on No Gnus v0.2) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 MULE XEmacs/21.4 (patch 17) (Jumbo Shrimp) (i686-pc-linux) X-Spam-Score: -2.5 (--) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:61895 gmane.mail.mh-e.devel:11601 Archived-At: --Multipart_Wed_Feb__8_17:09:51_2006-1 Content-Type: text/plain; charset=US-ASCII >>>>> In <15566.1139355525@juniper.net> >>>>> "Mark D. Baushke" wrote: > > See RFC3156, section 4: > > > > 4. OpenPGP encrypted data > > > > Before OpenPGP encryption, the data is written in MIME canonical > > format (body and headers). > > > > Though I couldn't find the definition of "MIME canonical format", I > > believe that it was intended to have CRLF line-ending. > Hmmm... I also do not see the definition for "MIME canonical format" > so I am not sure. I found a clue in sylpheed-claws-users ML. http://sourceforge.net/mailarchive/message.php?msg_id=1636575 RFC 2045 (MIME) clearly says that CRLF is the normal line separator for MIME header fields. For body text, see RFC 2046 : The canonical form of any MIME "text" subtype MUST always represent a line break as a CRLF sequence. Similarly, any occurrence of CRLF in MIME "text" MUST represent a line break. Use of CR and LF outside of line break sequences is also forbidden. > > > > For non-MIME encryption, line-ending conversion is not needed at all. > > > > > I disagree. This is what started the debate in the first place. > > > > > If I am sending a text message, then changing the line endings to CRLF > > > as is done in pgg-gpg-encrypt-region should also tell the remote end > > > that a text packet is coming rather than arbitrary binary data. > > > > I doubt that it is really necessary to be a text packet. Sorry, I misunderstood the problem. Now my understanding is that, the problem is, unless --textmode is specified, a sender and a receiver using non-MIME encryption have to make an out-of-band agreement to specify line endings. Right? If so, --textmode is still needed for non-MIME encryption. And also, if "MIME canonical format" in RFC3156 is intended to have CRLF line endings, specifying --textmode in PGP/MIME is harmless. However, always specifying --textmode might not be a good idea. Because applications other than MUA will need encryption of raw binary data. I attach a patch which allows users to select text-mode or binary-mode by setting pgg-text-mode. --Multipart_Wed_Feb__8_17:09:51_2006-1 Content-Type: application/octet-stream; type=patch Content-Disposition: attachment; filename="pgg-text-mode.diff" Content-Transfer-Encoding: 7bit Index: lisp/pgg-def.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/pgg-def.el,v retrieving revision 7.9 diff -u -r7.9 pgg-def.el --- lisp/pgg-def.el 8 Feb 2006 04:17:15 -0000 7.9 +++ lisp/pgg-def.el 8 Feb 2006 07:54:38 -0000 @@ -83,6 +83,9 @@ (defvar pgg-scheme nil "Current scheme of PGP implementation.") +(defvar pgg-text-mode nil + "If t, inform the recipient that the input is text.") + (defmacro pgg-truncate-key-identifier (key) `(if (> (length ,key) 8) (substring ,key 8) ,key)) Index: lisp/pgg-gpg.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/pgg-gpg.el,v retrieving revision 7.10 diff -u -r7.10 pgg-gpg.el --- lisp/pgg-gpg.el 19 Jan 2006 11:53:12 -0000 7.10 +++ lisp/pgg-gpg.el 8 Feb 2006 07:54:38 -0000 @@ -185,7 +185,8 @@ pgg-gpg-user-id)))) (args (append - (list "--batch" "--textmode" "--armor" "--always-trust" "--encrypt") + (list "--batch" "--armor" "--always-trust" "--encrypt") + (if pgg-text-mode (list "--textmode")) (if sign (list "--sign" "--local-user" pgg-gpg-user-id)) (if recipients (apply #'nconc @@ -213,7 +214,8 @@ (pgg-read-passphrase "GnuPG passphrase for symmetric encryption: "))) (args - (append (list "--batch" "--textmode" "--armor" "--symmetric" )))) + (append (list "--batch" "--armor" "--symmetric" ) + (if pgg-text-mode (list "--textmode"))))) (pgg-as-lbt start end 'CRLF (pgg-gpg-process-region start end passphrase pgg-gpg-program args)) (pgg-process-when-success))) @@ -277,9 +279,10 @@ (format "GnuPG passphrase for %s: " pgg-gpg-user-id) pgg-gpg-user-id))) (args - (list (if cleartext "--clearsign" "--detach-sign") - "--armor" "--batch" "--verbose" - "--local-user" pgg-gpg-user-id)) + (append (list (if cleartext "--clearsign" "--detach-sign") + "--armor" "--batch" "--verbose" + "--local-user" pgg-gpg-user-id) + (if pgg-text-mode (list "--textmode")))) (inhibit-read-only t) buffer-read-only) (pgg-as-lbt start end 'CRLF --Multipart_Wed_Feb__8_17:09:51_2006-1 Content-Type: text/plain; charset=US-ASCII Regards, -- Daiki Ueno --Multipart_Wed_Feb__8_17:09:51_2006-1--