ietf-openpgp
[Top] [All Lists]

Re: Compression and partial length chunks

2003-12-23 15:53:48

Hasnain Mujtaba writes:
I was wondering if someone could help clarify some issues for me.  It is
not clear to me from the RFC2440 how compression works when using
partial body length headers.  
...
Are the chunks independent in that can they be decrypted and
decompressed by the receiver without buffering them with other chunks?
E.g, if a 8192 bytes chunk is received enclosed within a partial body
length header, can the receiver take the chunk's payload and decrypt it
and then decompress it independently of the chunks already received and
those coming in?

No.  The partial body length headers have no implications for the data
stream into which they are inserted.  Their only purpose is to tell you
(eventually) when you get to the end of the data.  So your decompression
must be done on the data stream taken as a whole, without regard to the
presence of any partial body length headers.

Two other points.  First, within the encrypted packet is a compression
packet, as you said; but within the compression packet is typically a
literal data packet.  Three layers of packets typically exist for this
usage, not two.

Second, each packet (encryption, compression, literal) needs some kind
of length specification associated with it.  You can put the full packet
length in the header, if you know it in advance (which will not be the
case if you are streaming).  You can use partial body length.  Or You
can use the indefinite length type, which means that the packet goes
all the way to the end of the data.

The point is that this has to be done at each of the three layers.  If you
are using partial body lengths (PBLs), this must be done at each level.
The literal packet will use PBLs; then this data is compressed, and
the output of the compression gets PBLs inserted; and then the data is
encrypted, and the output of the encryption gets PBLs inserted.  There is
no logical connection between the packetizing at the different levels.
They could use different size partial body packets and insert their
PBLs at different points.  The PBLs are logically separate from the data
stream in which they are inserted.

Hal Finney

<Prev in Thread] Current Thread [Next in Thread>