ietf-dkim
[Top] [All Lists]

Re: [ietf-dkim] Possible problem with "simple" body canonicalization -- trailing CRLFs

2006-07-13 07:31:57
This not a problem when using DATA. Check 2821 section 4.1.1.4; the
ending crlf.crlf was clarified as being the trailing crlf of the last
line of the message followed by the terminator sequence.

   Note that the first <CRLF> of this terminating sequence is also the
   <CRLF> that ends the final line of the data (message text) or, if
   there was no data, ends the DATA command itself.

You are correct that the problem exists when using BDAT.

My implementation uses the last CRLF in if it's there. If there is no
last CRLF, it does *not* add one.

        Tony Hansen
        tony(_at_)att(_dot_)com

Eric Allman wrote:
In doing an end-to-end read on -base this morning I came up with a
possible difficulty with simple body canonicalization.

The description says that simple reduces CRLF 0*CRLF at the end of a
message to a single CRLF.  But what if the message has no trailing CRLF
at all?

Remember that in the sequence CRLF . CRLF, both CRLFs are part of the
terminator, not part of the message.  Thus, a message reading:

       thanks <CRLF>
       . <CRLF>

in fact has no trailing CRLF on the message.  (This could also happen
with BDAT, but that's not widely implemented.)

An approach to this might be to say that simple reduces 0*CRLF to a
single CRLF (which is quite possibly what the current implementations
actually do).
_______________________________________________
NOTE WELL: This list operates according to 
http://mipassoc.org/dkim/ietf-list-rules.html