Subject: Re: Parser abilities, and MDCs (Re: pointers to openpgp-interopknowledge base?)

From: [email-masked] (Peter Gutmann)
Date: Fri, 9 Nov 2001 07:02:39 +1300 (NZDT)

[email-masked] writes:

>rfc2440b03>4.2.1. Old-Format Packet Lengths
>rfc2440b03>[snip]
>rfc2440b03>   The meaning of the length-type in old-format packets is:
>rfc2440b03>   3 - The packet is of indeterminate length.  The header is 1 octet
>rfc2440b03>       long, and the implementation must determine how long the packet
>rfc2440b03>       is. If the packet is in a file, this means that the packet
>rfc2440b03>       extends until the end of the file. In general, an implementation
>rfc2440b03>       SHOULD NOT use indeterminate length packets except where theend
>rfc2440b03>       of the data will be clear from the context,
>
>it does not talks about compression, so I think it should be the same for any
>packet type

In general indefinite-length packets are a pain, you can avoid them in all
cases except compressed-data where you don't know the length in advance (and
maybe a few oddball streaming applications).  Although the standard doesn't say
it, common sense would dictate using the definite-length encoding for all but
compressed data.

>rfc2440b03>4.2.3. Packet Length Examples
>rfc2440b03>[snip]
>rfc2440b03>   An implementation MAY use Partial Body Lengths for data packets,be
>                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>rfc2440b03>   they literal, compressed, or encrypted. The first partial length
>                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>rfc2440b03>   MUST be at least 512 octets long. Partial Body Lengths MUST NOT be
>rfc2440b03>   used for any other packet types.
>
>so it is ok for all data packets..

Urgh, I hope no-one interprets it that way.  The partial-length encoding is
incredibly painful to use with its silly power-of-two restriction (you can't
just say "This is what I've got so far, the next lot starts here" but have to
chop it up into little power-of-two length pieces just to fit the *&#^$&#*
length-encoding mechanism).  GPG uses the definite-length format where it can
and 0xA3 where it can't (compressed data), something I agree with 
wholeheartedly.

Peter.

---

From: Derek Atkins <[email-masked]>
Date: 08 Nov 2001 13:30:28 -0500

> and 0xA3 where it can't (compressed data), something I agree with 

Come on, Peter...  If you have to buffer 4K-bytes, is that so horrible?
Besides, if you're doing a streaming application where you don't want
to buffer, you're better off packetizing anyways instead of making one
large stream.

> Peter.

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       [email-masked]                        PGP key available

---

From: John W Noerenberg II <[email-masked]>
Date: Thu, 8 Nov 2001 11:53:43 -0800

>and 0xA3 where it can't (compressed data), something I agree with

What I'm mainly concerned with as far as interoperability on this 
point is whether implementations support segmented packets, and the 
interpretation of of the data is consistent across implementations.
-- 

john noerenberg
[email-masked]
   ----------------------------------------------------------------------
   While the belief we  have found the Answer can separate us
   and make us forget our humanity, it is the seeking that continues
   to bring us together, the makes and keeps us human.
   -- Daniel J. Boorstin, "The Seekers", 1998
   ----------------------------------------------------------------------