Partial body length encoding for Compressed packets

Hasnain Mujtaba hmujtaba at
Mon Feb 7 23:09:49 CET 2005

Hi David,

I generated a PGP 2 style packet using GPG's --pgp2 option and tore it
apart to look inside its structure. I found that both the encrypted and
literal data packets are broken into RFC 2440 style partial body length
chunks. But, as you explained, the compressed packet was indeterminate
length encoded. 

I find this behavior perplexing. They made PGP 2 RFC2440 compliant only
for encrypted and literal packets. But why not for compressed packets as

Is this behavior found in PGP 5.x. PGP 6.x, and PGP 7.x as well, i.e RFC
2440 chunking for literal & encrypted packets, but indeterminate for
compressed packets? Or will PGP 5.x and above, understand chunking for
all three packets?

Not meaning to beat on a dead horse, but this forum is my only hope of
staying sane in a world of interoperability minefields.


-----Original Message-----
From: gnupg-users-bounces at
[mailto:gnupg-users-bounces at] On Behalf Of David Shaw
Sent: Monday, August 09, 2004 8:25 PM
To: gnupg-users at
Subject: Re: Partial body length encoding for Compressed packets

On Sat, Aug 07, 2004 at 06:11:59PM -0400, Hasnain Mujtaba wrote:
> Hi everyone,
> I am working with RFC2440 partial body length (PBL) encoding for my
> I have noticed that even though GPG's Encrypted Data Packets are cut
> into partial body length (PBL) chunks, the enclosed Compressed Data
> Packets are encoded using indeterminate lengths, rather than PBLs. Is
> this the default behavior for GPG and if so for what reasons?
> If possible, I would like GPG to create both compressed data packets
> enclosed literal data packets using PBL encoding. Is there some way to
> force enable this feature?

For PGP 2 compatibility reasons, GnuPG uses indeterminate lengths for
compressed packets.  There is no way to change this, but if you are
willing to compile a special GnuPG to test with, you can do something
like setting "new_ctb" to 1 in build_packet() when generating a
compressed data packet.


Gnupg-users mailing list
Gnupg-users at

More information about the Gnupg-users mailing list