Partial body length encoding for Compressed packets

Werner Koch wk at gnupg.org
Fri Aug 13 18:11:59 CEST 2004


On Thu, 12 Aug 2004 18:40:57 -0400, Hasnain Mujtaba said:

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

You need to do a read-ahead anyway.  For the rationale why we use this
scheme you need to look at the discussion in the OpenPGP WG back in
1999/2000.  It basically boils down to a compromise that the MDC
packet is both, a valid OpenPGP packet and also a fixed string
appended right before encryption.

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

gpg does not care about this.  When reading a byte from the input the
length handling has already been done and an EOF state is issued
correctly.  That means that the code consuming the messages does not
known about the actual encoding (partial of fixed length).

  Werner




More information about the Gnupg-users mailing list