GnuPG and trailing whitespace handling

Werner Koch wk at isil.d.shuttle.de
Tue Feb 9 12:46:44 CET 1999


Russ Allbery <rra at stanford.edu> writes:

> To add even more confusion to the mix, GnuPG takes the much saner but
> incompatible approach of always stripping whitespace regardless of whether
> the signature is attached or detached.  This means that if you're

See RFC2440:

   5.2.1. Signature Types

   There are a number of possible meanings for a signature, which are
   specified in a signature type octet in any given signature. These
   meanings are:

   0x00: Signature of a binary document.
         Typically, this means the signer owns it, created it, or
         certifies that it has not been modified.

   0x01: Signature of a canonical text document.
         Typically, this means the signer owns it, created it, or
         certifies that it has not been modified.  The signature is
         calculated over the text data with its line endings converted
         to <CR><LF> and trailing blanks removed.

and:
   
    7.1. Dash-Escaped Text

[...]
   Also, any trailing whitespace (spaces, and tabs, 0x09) at the end of
   any line is ignored when the cleartext signature is calculated.


Signature class 0x01 is only used with option "-t" and "--clearsign" ,
so this seems to be okay.  Detached signatures are not a special case
but simple the output of only the signature packet.

I noticed one problem: the RFC talks about "trailing blanks" and
"trailing whitespace" - maybe this is the reason for the problem. 
Please, can someone have a look at the PGP 2.6 source to check how
they actually implemented it.


  Werner

 





More information about the Gnupg-devel mailing list