Subject: Line Breaks in OpenPGP ASCII armor

From: [email-masked]
Date: Tue, 11 Jan 2000 04:29:33 -0500 (EST)

When doing interoperability tests for the revision of my "OpenPGP
Tutorial" (which should be finished within the next 2 days and will be
uploaded to "http://www.redtenbacher.de/signatur/index.htm" then), I
noticed some variations in handling line breaks in ASCII armored
files:

1. RFC 2440 and its newest draft revision specify in section 6 that
   Radix-64 encoding is identical to MIME Base64 encoding per RFC
   2045. RFC 2045 (and RFC 822) explicitely specify that the line
   break character(s) to be used is/are CRLF.

2. An empirical review of PGP implementations regarding ASCII armor
   output shows a different picture, however:

   (a) PGP 5.0i for DOS and PGP 6.5.1i for Windows use the line break
       CRLF.

   (b) PGP 5.0i for Linux and GnuPG 1.0.1 for Linux use LF alone as
       line break.

   (c) GnuPG 1.0.1 for Windows uses a mixture: All line breaks except
       the one preceding the "END PGP MESSAGE" line are CRLF (= DOS
       style), and the line break preceding "END PGP MESSAGE" is LF
       alone (= Unix style).

I am aware that under Unix, the normal line break in ASCII files is LF
alone and that it is usually considered to be the job of the email
software to convert this into canonical CRLF format. (My mailer
software KT-MAIL does this.) I also found that the result of 2b and 2c
above didn't cause any decoding problems even when directly
transferring the ASCII armored files between Linux and a DOS/Windows
machine, as apparently all the above programs accept both versions
(CRLF or LF) without any problems.

I think, however, that something should be said about this in the
revision of RFC 2440, as for the programs listed in 2b and 2c above,
there is obviously _no_ 100% equivalence between ASCII armor and MIME
encoding regarding the line breaks. And I wonder whether the output of
GnuPG 1.0.1 for Windows is really intended to be this mixture between
CRLF line breaks and one LF line break, which causes a GnuPG result
file to appear wrongly when loaded e.g. into the Win95 editor.

- Wolfgang Redtenbacher

---------------------------------------------------------------------
Redtenbacher Software                Tel.:   +49 7159 17046
Roemerstr. 11/1                      Fax:    +49 7159 17047
D-71272 Renningen                    e-mail: [email-masked]
---------------------------------------------------------------------

---

From: Werner Koch <[email-masked]>
Date: Tue, 11 Jan 2000 19:38:23 +0100

>    break character(s) to be used is/are CRLF.

It is the task of a a MUA to convert line endings to network standard
format.  OpenPGP is not a protocol designed with only mail in mind.

>    (a) PGP 5.0i for DOS and PGP 6.5.1i for Windows use the line break

Because that is the (ugly) DOS convention.

>    (b) PGP 5.0i for Linux and GnuPG 1.0.1 for Linux use LF alone as

GNU/Linux is based on Unix and therefore we have these lineendings
here.

>        style), and the line break preceding "END PGP MESSAGE" is LF

This should go as a bug report to the GnuPG developers :-)
BTW, didn't you noticed these big fat letters saying that this is
an alpha version and that it may work or not.  It is not good to take 
such software for your tests.

I'll fix it,

  Werner

-- 
Werner Koch at guug.de           www.gnupg.org           keyid 621CC013
  
     Boycott Amazon!  -  http://www.gnu.org/philosophy/amazon.html