Partial body length encoding for Compressed packets

Hasnain Mujtaba hmujtaba at
Fri Aug 13 00:40:57 CEST 2004

Hi David,

If the encrypted data packet has an MDC packet at the end, then how is
the decrypting software to figure out where the indeterminate length
compressed data packet ends and the MDC begins? In this situation,
perhaps it would help if the enclosed literal data packet is not built
using indeterminate length. But what if even the literal is built using
indeterminate length? 

How does GPG handle such cases? RFC2440 is not too clear about such

Thanks much,

-----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