Subject: question about partial body lengths

From: [email-masked]
Date: Tue, 07 Dec 1999 17:10:58 +0900

hello-

  i have some questions about the use of and processing of partial body 
lengths that i was hoping to get answers to :-)

  section 4.2.2.1 says:

    Each Partial Body Length header is followed by a portion of the
    packet body data. The Partial Body Length header specifies this
    portion's length. Another length header (of one of the three types --
    one octet, two-octet, or partial) follows that portion. The last
    length header in the packet MUST NOT be a partial Body Length header.
    Partial Body Length headers may only be used for the non-final parts
    of the packet.

  section 4.2.3 says:

    ... This is just one possible encoding, and many
    variations are possible on the size of the Partial Body Length
    headers, as long as a regular Body Length header encodes the last
    portion of the data. Note also that the last Body Length header can
    be a zero-length header.

  while processing an openpgp packet w/ partial body length headers,
once a partial body length is encountered, is it safe to assume that
the subsequent appearance of a non-'partial body length' header allows the
computation of the end of a packet?

  if not, how does one tell where the packet ends?  (what am i missing?)

  if yes, i may have missed something, but i don't see anything in the
specification that says that this must be the case.  (what am i missing?)

  thanks for your attention.

p.s. i checked the archives earlier today but didn't find any mention
of this.

p.p.s. on a separate (purely historical) note, for signature
subpackets, were there specific reasons why the subpacket length was
defined to come before the subpacket type and not the other way
around?

---

From: Werner Koch <[email-masked]>
Date: Tue, 7 Dec 1999 11:46:59 +0100

> computation of the end of a packet?

Sure, simply because there is no other way to find the end of the packet.
If you see a non partial length header que get the length of the
packet from it and stop processinf the packet after reading that
amount of data.

-- 
Werner Koch at guug.de           www.gnupg.org           keyid 621CC013

---

From: [email-masked]
Date: Tue, 07 Dec 1999 23:25:24 +0900

thanks for the response!

wk>  On Tue, Dec 07, 1999 at 05:10:58PM +0900
wk>  [email-masked] wrote:

sen_ml>   while processing an openpgp packet w/ partial body length headers,
sen_ml> once a partial body length is encountered, is it safe to assume that
sen_ml> the subsequent appearance of a non-'partial body length' header allows 
sen_ml> the computation of the end of a packet?

wk> Sure, simply because there is no other way to find the end of the packet.
wk> If you see a non partial length header que get the length of the
wk> packet from it and stop processinf the packet after reading that
wk> amount of data.

great!  the conclusion seems quite reasonable to me :-)

may be it's a reading comprehension problem on my part, but i don't
think rfc 2440 (at least my local copy) actually says this explicitly.

i would appreciate it if someone would point me at the section or
sections which say so.  the closest thing i see has to do w/ not using
a partial body length as the final part (cf. my previous post).

imho, it would be a helpful thing to have mentioned in the rfc (if it
isn't already).