textmode nit (\r\n lines)

brian moore bem at cmc.net
Tue Oct 27 07:05:43 CET 1998


On Tue, Oct 27, 1998 at 09:37:41AM +0100, Werner Koch wrote:
> brian moore <bem at cmc.net> writes:
> 
> > Shouldn't gpg output '\n' terminated lines after using --clearsign?
> 
> Didn't I fix this?  Some HAMs (radio amateurs) complained that they
> need CR,LF - right?  [dg9ep: please help]

Not as of the current cvs.

The problem is that OpenPGP specifies that line termination is to be
converted to \r\n before verification/signing.  (Which makes sense since
it will sign differently based on the end of line, so the receiever
would have to know the sender's OS to verify things.)

Since it's done at both the verification and sign stage, it allows for
local end-of-line to be stuck on the armored file so that it can be
handled like any other text file.

So the \n needs to be converted to \r\n on input (which it does), but on
output it can be converted back to \n (on Unix anyway, on DOS its should
be \r\n still, and I think MacOS wants just \r).

Try clearsigning a file and then looking at the results in vi.  The
signed section will have \r\n for a line terminator.

-- 
Brian Moore                       | "The Zen nature of a spammer resembles
      Sysadmin, C/Perl Hacker     |  a cockroach, except that the cockroach
      Usenet Vandal               |  is higher up on the evolutionary chain."
      Netscum, Bane of Elves.                 Peter Olson, Delphi Postmaster




More information about the Gnupg-devel mailing list