Subject: Literal packets and canonicalization

From: "Hasnain Mujtaba" <[email-masked]>
Date: Thu, 6 May 2004 15:10:17 -0400

Hello,

I was reading section "5.9. Literal Data Packet" of RFC2440 and I had a
question: What are the concequences of not canonicalizing text data
before storing it in a literal packet and using the literal packet to
form either an encrypted packet or signature packet? 

What if the sender marks all literal data as binary 'b', even if the
literal data is text?   

Thanks
Hasnain. 

----
The information contained in this electronic mail and any attached
document is the confidential and proprietary business information of
Forum Systems, Inc. It is intended solely for the addressed recipient
listed above. It may not be distributed in any manner without the
express written consent of Forum Systems, Inc.

---

From: David Shaw <[email-masked]>
Date: Thu, 6 May 2004 15:56:18 -0400

> form either an encrypted packet or signature packet? 

The file should decrypt properly, and (at least in PGP and GnuPG)
signatures should verify properly regardless of the canonicalization.

> What if the sender marks all literal data as binary 'b', even if the

The bad thing that will happen is that recipients on platforms that
have a different text line ending convention than the sender will see
somewhat mangled text in the output.

For example: Macs generally end lines with CR.  Unix machines
generally end lines with LF.  Sending data from one to the other
without the benefit of canonicalization results in one very long
"line" with occasional CRs or LFs in there.  Some text editor/viewer
programs do heuristics to detect and fix this problem, but it's
generally better to canonicalize which lets the OpenPGP program handle
it automatically.

David