I was testing some old GnuPG scripts today, with my latest version of GnuPrivacyGuard ( version 1.42 ) and found a little easy to fix bug. Since the module appears to be unmaintained anymore, I'll mention it here.

First, it has been previously known, that a "strict" bugfix was to change line 267 of GnuPG.pm to avoid the 'bareword not allowed while using strict' error

# from my $max_fd = POSIX::sysconf( POSIX::_SC_OPEN_MAX ) || 256; # to my $max_fd = POSIX::sysconf( POSIX::_SC_OPEN_MAX() ) || 256;

Second, when you use versions of gpg > 1.25 (according to a debian bug report) with GnuPG.pm, you will get a decrypt error:

protocol error: expected DECRYPTION_OKAY got PLAINTEXT:

So another fix is to change GnuPG.pm, at line 742

# from # $self->abort_gnupg( "protocol error: expected DECRYPTION_OKAY got + $cmd: \n" ) # unless $cmd =~ /DECRYPTION_OKAY/; # to $self->abort_gnupg( "protocol error: expected PLAINTEXT got $cmd: +\n" ) unless $cmd =~ /PLAINTEXT/;

I'm not really a human, but I play one on earth. Cogito ergo sum a bum

Replies are listed 'Best First'.
Re: Getting GnuPG.pm to work with gpg > 1.25
by diotalevi (Canon) on Oct 02, 2006 at 18:54 UTC

    If you can't get the maintainer to update it, post a fixed distribution to CPAN anyway. It won't be indexed but you could ask the modules list to transfer permissions to you. Once you have that, ask PAUSE to reindex it and you're the proud maintainer of a module. Then we all win. Also, filing tickets on RT is nice because that's the public place to write down bug reports so other people can know abou them.

    ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

Re: Getting GnuPG.pm to work with gpg > 1.25
by wazoox (Prior) on Oct 02, 2006 at 19:34 UTC
    The main concern with this module is that it doesn't work if your language isn't en_US. I'm afraid that anything using gnuPG directly will remain extremely fragile and buggy anyway.
    The real thing would be a module using libgpgme (though it would be Un*x only I suppose). Too bas there isn't one apparently.