Hey folks,

  I'm trying to get GnuPG::Interface working and I've run into a
problem. It seems that when trying to decrypt a file where the plaintext
version is over 61068 bytes that GnuPG::Interface just hangs. I've done
extensive testing and it appears to work just fine when the plaintext
file is that size or below. I've tried it using the Debian package
libgnupg-interface-perl and also with the latest source from CPAN built
on both the Debian box and also a Redhat ES 3.0 box. Decryption of the
files with gpg from the command line works just fine. If anyone has any
idea what could be causing this I would appreciate your thoughts. Also,
if there is any other information that I can provide to help please let
me know. Here is the script I'm using to decrypt the file for testing:

#!/usr/bin/perl -w
use lib qw( /tmp/GnuPG-Interface-0.33/blib/lib
/tmp/Class-MethodMaker-2.02/blib/lib );
use strict;
use IO::Handle;
use IO::File;
use GnuPG::Interface;
                                                                                       
                                     my $passphrase = 'johnnybravo';

my $gnupg = GnuPG::Interface->new();

my ( $input, $output, $error, $passphrase_fh, $status_fh )
  = ( IO::Handle->new(),
      IO::Handle->new(),
      IO::Handle->new(),
      IO::Handle->new(),
      IO::Handle->new(),
    );

my $handles = GnuPG::Handles->new( stdin      => $input,
                                   stdout     => $output,
                                   stderr     => $error,
                                   passphrase => $passphrase_fh,
                                   status     => $status_fh,
                                 );

# this time we'll also demonstrate decrypting
# a file written to disk
# Make sure you "use IO::File" if you use this module!
my $cipher_file = IO::File->new( $ARGV[0] );

# this sets up the communication
my $pid = $gnupg->decrypt( handles => $handles );

# This passes in the passphrase
print $passphrase_fd $passphrase;
close $passphrase_fd;

# this passes in the plaintext
print $input $_ while <$cipher_file>;

# this closes the communication channel,
# indicating we are done
close $input;
close $cipher_file;

my @plaintext    = <$output>;   # reading the output
my @error_output = <$error>;    # reading the error
my @status_info  = <$status_fh>; # read the status info

print "#" x 80 . "\n";
print @error_output;
print "#" x 80 . "\n";
print @status_info;
print "#" x 80 . "\n";
print @plaintext;

# clean up...
close $output;
close $error;
close $status_fh;

waitpid $pid, 0;  # clean up the finished GnuPG process


TIA

Joshua Colson
Systems Administrator
Giant Industries, Inc

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to