Re: GnuPG with Perl 5.8 (or best replacement)?

[email protected] ("Randall J. Parr") Sat, 18 Jan 2003 15:44:31 -0800
Newsgroups perl.crypto
Organization Temporal Arts
Message-ID <[email protected]>
Wiggins D'Anconia wrote:
 > Randall J. Parr wrote:
 > <snip>
 >
 >> I have "googled" 'til my fingers hurt but have been unable to discover
 >> any guidance as to a version of GnuPG that will install in Perl 5.8
 >> and/or a recommended module which can replace and/or supercede GnuPG.
 >>
 > <snip>
 >
 > It appears to be a change in teh POSIX constants, or in how strict
 > collects barewords in relation to constants. I believe the fix is fairly
 > small so you might contact the author, though the bigger problem may be
 > newer versions of GnuPG will break the module as it uses the shared
 > memory ability of gnupg which has been deprecated.
 >
 > You may also want to check out Crypt::OpenPGP as it has a GnuPG
 > compatibility setting, but may not work with large files on lower memory
 > systems as it appeared to store the file encrypted/decrypted in memory
 > rather than passing a stream, which wouldn't work in our case as we
 > wanted multiple large files to be encrypt/decrypting at once.  I really
 > liked the GnuPG::Interface setup and it seemed to work well in a simple
 > environment, but it didn't work in our "server" environment (long story,
 > dealing with fork/exec, waitpid, etc. that most people probably won't
 > have problems with).
 >
 > http://search.cpan.org/author/BTROTT/Crypt-OpenPGP-1.03/
 > http://search.cpan.org/author/FTOBIN/GnuPG-Interface-0.33/
 >
 > In the end I had to grow my own using a 'system' call.  My research was
 > done on Solaris 8 with GnuPG 1.0.6.
 >
 > http://danconia.org
 >

[email protected] had the solution to the POSIX error

Bareword "POSIX::_SC_OPEN_MAX"  not allowed while "strict subs" in use
at blib/lib/GnuPG.pm line 267.

To get around the error:
in the source directory run the normal "perl Makefile.PL" and make.
After the make has completed edit the GnuPG.pm file in the root of the
source
directory and add double quotes around the barword in question, i.e.:

line 267:
my $max_fd = POSIX::sysconf( POSIX::_SC_OPEN_MAX ) || 256;

becomes:
my $max_fd = POSIX::sysconf("POSIX::_SC_OPEN_MAX") || 256;

NOW the make test fails with message that, I *think*, are related to 
the   deprecation of the shared-memory IPC mode of gpg (as you indicated).

I am using gpg 1.0.7 as delivered with Red Hat 8.0.

Any suggestions as to how to get around this?

One of the reasons I keep trying to get this to work is the scripts I'm 
converting make use of GnuPG::Tie:Encrypt and GnuPG is the only package 
I've found which includes this kind of TIE'd interface.

We have to encyrpt emails which are from 2K to maybe 20K.
I'm assuming these don't qualify as the "large" files you mentioned above?

------------------------------------------------------------------------
[root@tarts GnuPG-0.09]# TRACING=1; export TRACING
[root@tarts GnuPG-0.09]# make test
cp GnuPG/Tie/Encrypt.pm blib/lib/GnuPG/Tie/Encrypt.pm
cp GnuPG/Tie/Sign.pm blib/lib/GnuPG/Tie/Sign.pm
cp GnuPG/Tie/Decrypt.pm blib/lib/GnuPG/Tie/Decrypt.pm
cp GnuPG/Tie.pm blib/lib/GnuPG/Tie.pm
cp GnuPG/Tie/ClearSign.pm blib/lib/GnuPG/Tie/ClearSign.pm
cp GnuPG.pm blib/lib/GnuPG.pm
cp gpgmailtunl blib/script/gpgmailtunl
/usr/bin/perl "-MExtUtils::MY" -e "MY->fixin(shift)" blib/script/gpgmailtunl
PERL_DL_NONLAZY=1 /usr/bin/perl "-Iblib/lib" "-Iblib/arch" test.pl
1..25
Key generation                          GnuPG: reading from status fd 3
gpg: shared memory coprocessing is not available
GnuPG: got from status fd: EOFGnuPG: closing status fd 3
not ok 1: wrong response from gnupg (expected SHM_INFO):
 at test.pl line 26
Import new public key                   GnuPG: reading from status fd 3
gpg: shared memory coprocessing is not available
GnuPG: got from status fd: EOFGnuPG: closing status fd 3
not ok 2: wrong response from gnupg (expected SHM_INFO):
 at test.pl line 34
...
...
and so on until all tests fail
-------------------------------------------------------------------