ietf-openpgp
[Top] [All Lists]

Line Breaks in OpenPGP ASCII armor

2000-01-11 02:29:40
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: wolfgang(_at_)redtenbacher(_dot_)de
---------------------------------------------------------------------


<Prev in Thread] Current Thread [Next in Thread>