Skip Menu |

This queue is for tickets about the Mail-GnuPG CPAN distribution.

Report information
The Basics
Id: 21302
Status: resolved
Priority: 0/
Queue: Mail-GnuPG

People
Owner: Nobody in particular
Requestors: Iikka.Virkkunen [...] trueflaw.com
Niko.Thome [...] icw.de
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: Re: Problem with Mail::GnuPG
Date: Thu, 22 Jun 2006 09:17:21 +0200
To: Robert Spier <rspier [...] pobox.com>
From: Niko.Thome [...] icw.de
Hi Robert, I recognized a new problem with the module. If I try to decrypt larger messages (>500 KB in my case), gnupg hangs. I found a solution in a newsgroup and wrote a patch for the module. Here is the solution: http://groups.google.co.uk/group/comp.lang.perl.modules/browse_thread/thread/6fecd275b291d029 See the attached patch... Mit freundlichen Grüßen / Best regards -------------------------------------------- Niko Thome Diplomand Main: +49 (0)6227 385-459 Fax: +49 (0)6227 385-190 InterComponentWare AG Otto-Hahn-Straße 3 69190 Walldorf/Baden (Germany) Email: Niko.Thome@icw.de -------------------------------------------- Visit our product: http://www.lifesensor.com Company: http://www.icw.de Robert Spier <rspier@pobox.com> 18.06.2006 06:23 To Niko.Thome@icw.de cc rspier@cpan.org Subject Re: Problem with Mail::GnuPG Can you provide me with a small test case so I can replicate this? -R At Fri, 9 Jun 2006 15:38:07 +0200, Niko.Thome@icw.de wrote: Show quoted text
> > Hi Robert, > > at this time I'm writing a Perl-Script that decrypts and verify pgp > encrypted/singed mails. I'm using your CPAN-Module, and it's working
quite Show quoted text
> well. > The problem I have is: If I receive an encrypted mail with attachments
in Show quoted text
> binary format everything works fine, but if I get an encrypted mail with
Show quoted text
> an textonly attachment (e.g. a .ini or .conf file) something went wrong. > The MIME::Entity-object I get back is not futher a multipart message.
The Show quoted text
> content of the textonly-file got into the body of the message. > > A further problem is, that the complete header of the original mail is > missing. What can I do to save the old header (except the Content-Type) > and use it for the decrypted mail? > > Thank you. > > Mit freundlichen Grüßen / Best regards > -------------------------------------------- > Niko Thome > Diplomand/graduand > > Main: +49 (0)6227 385-459 > Fax: +49 (0)6227 385-190 > > InterComponentWare AG > Otto-Hahn-Straße 3 > 69190 Walldorf/Baden (Germany) > > Email: Niko.Thome@icw.de > -------------------------------------------- > Visit our product: http://www.lifesensor.com > Company: http://www.icw.de

Message body is not shown because sender requested not to inline it.

From: RSPIER [...] cpan.org
On Sun Sep 03 13:09:20 2006, Niko.Thome@icw.de wrote: Show quoted text
> Hi Robert,
This is not a good solution because it forces the decrypted plaintext to be written to disk, which is not appropriate for all applications.
Subject: Re: GnuPG bug
Date: Sun, 11 Mar 2007 10:35:58 +0200
To: Robert Spier <rspier [...] pobox.com>
From: Iikka Virkkunen <iikka.virkkunen [...] trueflaw.com>
Robert, Firstly, my apologies for the rather harsh tone and the implicit ungratefulness of my last message. After bug-hunting for a day, I was heavily focused on the problem at hand and evidently had lost my perspective. Now that I've regained some of it, let me say humble _thank you_ for writing the module in the first place. We use it on production environment daily, and it's truly an indispensable tool for us. Thank you also, for making the tool open source so that when we had a problem with the tool, we could fix it ourself rapidly, in stead of having to wait for undetermined time without a tool we have come to rely in. I fully realize that my bug-hunting effort is negligible compared to the effort you have put in to writing the code in the first place. Show quoted text
> > I haven't had time to look into this for a while. > > There are many other issues with with the module, and it's > probably due for a total rewrite. > > The patch included on bug 21302 isn't good because it writes > plaintext to disk.
This certainly explains why you didn't release a new version with this patch. Good point. Show quoted text
> Your forking solution is better, but I'll need to think about it. > > A test case for this bug would be very useful.
Please find enclosed a test-code. Writing a general test-case, that makes direct use of the module is rather difficult, so in stead I took the problematic lines from the module code and wrote a simple test-case to illustrate the problem and my solution. I hope, the code is self-explaining. To run it: bash runTest.sh this creates dummy plaintext and ciphertext and runs the forktest. To see it fail: ./forkTest ciphertext.txt 0 -1 ... hangs To see it work with smaller input without forking ./forkTest ciphertext.txt 0 500 Hope these help you, Iikka
Download testcase.tgz
application/octet-stream 1.4k

Message body not shown because it is not plain text.

Show quoted text
> > -R > > At Sat, 10 Mar 2007 20:27:06 +0200, > Iikka Virkkunen wrote:
>> >> Hi! >> Right after solving the problem myself I found a solution to the >> infamous Mail::GnuPG big-message decryption problem from: >> http://rt.cpan.org/Public/Bug/Display.html?id=21302 >> However, I think my solution might be worth a consideration also. The >> code, as it is, first writes the ciphertext, then reads the >> plaintext. This has the problem, that big ciphertexts fill up the >> $output buffer, which causes the gpg write to block and the program >> to hang. The solution referenced above used temporary files to solve >> the problem. My solution is to fork the write thread to separate >> process: >> $id = fork(); >> if($id ==0){ >> print $input $ciphertext. "\n"; >> exit(0); >> } >> >> Best regards, >> >> Iikka >> P.S. Please, please release a new version with _some_ fix. It's an >> infuriating bug. >>
This bug seems to be the same as the resolved #21276. Feel free to re-open if you disagree.