GPG cannot evaluate the length of text file.

Sieu Truc sieutruc at gmail.com
Wed Dec 3 22:59:14 CET 2014


I read some articles about partial length encoding.

But i don't really understand how gpg can determine when to use partial
length encoding or other methods (one octet, 2 octets, 4 octets)

To be clear, in the file attached above, if i remove one line or reduce the
length of data just a bit, i get the section ":signature packet: algo
1, keyed F1B3EC4859B360A7' and gpg is able to detect data length.

So how can i deactivate  "partial length encoding" because i want to get
the information in "signature packet" for my application.

Regards,

Truc

On Wed, Dec 3, 2014 at 8:12 PM, Werner Koch <wk at gnupg.org> wrote:

> On Wed,  3 Dec 2014 16:31, sieutruc at gmail.com said:
>
> > gpg2 --verbose --no-mdc-warning --verbose --y --batch --passphrase
> > :literal data packet:
> >     mode t (74), created 1417110768, name="4481110.txt",
> >     raw data: unknown length  ( THE PROBLEM HERE )
>
> Unknown length means that this packet uses partial length encoding
> because it does not know the length in advance and gpg always works in
> stream mode.
>
> > As i know, if the file length is more than 5Gb, that problem appears.
>
> It is not a problem, it is just a standard encoding.
>
> > But this file has only 499b. Its weird.
>
> You used the --textmode option to create the file and thus we hit this
> condition:
>
>         /* Because the text_filter modifies the length of the
>          * data, it is not possible to know the used length
>          * without a double read of the file - to avoid that
>          * we simple use partial length packets. */
>         if ( ptmode == 't' )
>           filesize = 0;
>
>
> Shalom-Salam,
>
>    Werner
>
>
> --
> Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/attachments/20141203/74beb832/attachment.html>


More information about the Gnupg-users mailing list