From: Daiki Ueno <ueno@unixuser.org>
Cc: ding@gnus.org, mh-e-devel@lists.sourceforge.net
Subject: Re: Gnus 5.10.6 problems with PGP/MIME (test cases)
Date: Wed, 08 Feb 2006 17:09:51 +0900 [thread overview]
Message-ID: <7334ab51-5c86-4d97-92cb-21f2e7debd8d@well-done.deisui.org> (raw)
In-Reply-To: <15566.1139355525@juniper.net> (Mark D. Baushke's message of "Tue, 07 Feb 2006 15:38:45 -0800")
[-- Attachment #1: Type: text/plain, Size: 2120 bytes --]
>>>>> In <15566.1139355525@juniper.net>
>>>>> "Mark D. Baushke" <mdb@gnu.org> 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.
[-- Attachment #2: pgg-text-mode.diff --]
[-- Type: application/octet-stream, Size: 2132 bytes --]
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
[-- Attachment #3: Type: text/plain, Size: 25 bytes --]
Regards,
--
Daiki Ueno
next prev parent reply other threads:[~2006-02-08 8:09 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-12 1:12 Mark D. Baushke
2006-01-13 23:24 ` Reiner Steib
2006-01-14 2:58 ` Mark D. Baushke
2006-01-14 14:58 ` Katsumi Yamaoka
2006-01-16 0:39 ` Katsumi Yamaoka
2006-01-16 6:36 ` Mark D. Baushke
2006-01-16 7:58 ` Katsumi Yamaoka
2006-01-16 8:41 ` Katsumi Yamaoka
2006-01-16 9:00 ` Katsumi Yamaoka
2006-01-16 19:17 ` Bill Wohler
2006-01-16 19:48 ` Mark D. Baushke
2006-01-17 7:35 ` Katsumi Yamaoka
2006-01-17 9:00 ` Mark D. Baushke
2006-01-17 10:53 ` Katsumi Yamaoka
2006-01-17 18:17 ` Mark D. Baushke
2006-01-18 5:33 ` Katsumi Yamaoka
2006-01-18 10:04 ` Mark D. Baushke
2006-01-18 12:40 ` Katsumi Yamaoka
2006-01-18 17:25 ` Mark D. Baushke
2006-01-18 17:29 ` Mark D. Baushke
2006-01-19 6:01 ` Katsumi Yamaoka
2006-01-19 9:13 ` Mark D. Baushke
2006-01-19 6:01 ` Synch of PGG (was Re: Gnus 5.10.6 problems with PGP/MIME (test cases)) Katsumi Yamaoka
2006-01-19 11:53 ` Synch of PGG Katsumi Yamaoka
2006-01-19 13:01 ` Simon Josefsson
2006-01-19 13:38 ` Reiner Steib
2006-01-19 13:47 ` Miles Bader
2006-01-19 14:48 ` Katsumi Yamaoka
2006-02-07 4:53 ` Gnus 5.10.6 problems with PGP/MIME (test cases) Daiki Ueno
2006-02-07 7:12 ` Mark D. Baushke
2006-02-07 7:46 ` Katsumi Yamaoka
2006-02-07 8:57 ` Daiki Ueno
2006-02-07 9:40 ` Mark D. Baushke
[not found] ` <9bda6607-510b-468c-bd1e-ec9b8865cdd2@well-done.deisui.org>
[not found] ` <15566.1139355525@juniper.net>
2006-02-08 8:09 ` Daiki Ueno [this message]
2006-02-08 8:30 ` Katsumi Yamaoka
2006-02-08 9:06 ` Daiki Ueno
2006-02-08 9:55 ` Katsumi Yamaoka
2006-02-09 5:24 ` Daiki Ueno
2006-02-09 5:29 ` Daiki Ueno
2006-02-09 5:48 ` Katsumi Yamaoka
2006-02-09 6:40 ` Mark D. Baushke
2006-02-09 6:44 ` Mark D. Baushke
2006-02-09 7:31 ` Katsumi Yamaoka
2006-02-09 7:42 ` Mark D. Baushke
[not found] ` <82857.1139467447-3r7Miqu9kMnR7s880joybQ@public.gmane.org>
2006-02-09 8:27 ` refered article lookup (was: Gnus 5.10.6 problems with PGP/MIME (test cases)) Jochen Küpper
2006-02-09 9:19 ` refered article lookup Katsumi Yamaoka
2006-02-08 15:27 ` Gnus 5.10.6 problems with PGP/MIME (test cases) Mark D. Baushke
2006-02-07 10:02 ` Katsumi Yamaoka
2006-02-07 23:40 ` Daiki Ueno
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7334ab51-5c86-4d97-92cb-21f2e7debd8d@well-done.deisui.org \
--to=ueno@unixuser.org \
--cc=ding@gnus.org \
--cc=mh-e-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).