--- GnuPG.pm.orig 2009-04-23 21:06:16.000000000 +0100
+++ GnuPG.pm.debian 2009-04-23 21:05:35.000000000 +0100
@@ -264,7 +264,7 @@
# some ends must be closed in the child.
#
# Besides this is just plain good hygiene
- my $max_fd = POSIX::sysconf( &POSIX::_SC_OPEN_MAX ) || 256;
+ my $max_fd = POSIX::sysconf( POSIX::_SC_OPEN_MAX ) || 256;
foreach my $f ( 3 .. $max_fd ) {
next if $f == fileno $self->{status_fd};
POSIX::close( $f );
@@ -611,30 +611,12 @@
( $cmd, $arg ) = $self->read_from_status()
if ( $cmd =~ /RSA_OR_IDEA/ );
- # Ignore automatic key imports
- ( $cmd, $arg ) = $self->read_from_status()
- if ( $cmd =~ /IMPORTED/ );
-
- ( $cmd, $arg ) = $self->read_from_status()
- if ( $cmd =~ /IMPORT_OK/ );
-
- ( $cmd, $arg ) = $self->read_from_status()
- if ( $cmd =~ /IMPORT_RES/ );
-
$self->abort_gnupg( "invalid signature from ", $arg =~ /[^ ](.+)/, "\n" )
if ( $cmd =~ /BADSIG/);
- if ( $cmd =~ /ERRSIG/)
- {
- my ($keyid, $key_algo, $digest_algo, $sig_class, $timestamp, $rc)
- = split ' ', $arg;
- if ($rc == 9)
- {
- ($cmd, $arg) = $self->read_from_status();
- $self->abort_gnupg( "no public key $keyid" );
- }
- $self->abort_gnupg( "error verifying signature from $keyid" )
- }
+ $self->abort_gnupg( "error verifying signature from ",
+ $arg =~ /([^ ])/, "\n" )
+ if ( $cmd =~ /ERRSIG/);
$self->abort_gnupg ( "protocol error: expected SIG_ID" )
unless $cmd =~ /SIG_ID/;
@@ -646,12 +628,6 @@
my ( $keyid, $name ) = split /\s+/, $arg, 2;
( $cmd, $arg ) = $self->read_from_status;
- my $policy_url = undef;
- if ( $cmd =~ /POLICY_URL/ ) {
- $policy_url = $arg;
- ( $cmd, $arg ) = $self->read_from_status;
- }
-
$self->abort_gnupg ( "protocol error: expected VALIDSIG" )
unless $cmd =~ /VALIDSIG/;
my ( $fingerprint ) = split /\s+/, $arg, 2;
@@ -668,7 +644,6 @@
user => $name,
fingerprint => $fingerprint,
trust => $trust,
- policy_url => $policy_url,
};
}
@@ -752,27 +727,19 @@
sub decrypt_postread($) {
my $self = shift;
- my @cmds;
# gnupg 1.0.2 adds this status message
my ( $cmd, $arg ) = $self->read_from_status;
- push @cmds, $cmd;
- if ($cmd =~ /BEGIN_DECRYPTION/) {
- ( $cmd, $arg ) = $self->read_from_status();
- push @cmds, $cmd;
- };
+ ( $cmd, $arg ) = $self->read_from_status()
+ if $cmd =~ /BEGIN_DECRYPTION/;
my $sig = undef;
- while (defined $cmd && !($cmd =~ /DECRYPTION_OKAY/)) {
- if ( $cmd =~ /SIG_ID/ ) {
- $sig = $self->check_sig( $cmd, $arg );
- }
- ( $cmd, $arg ) = $self->read_from_status();
- push @cmds, $cmd if defined $cmd;
- };
+ if ( $cmd =~ /SIG_ID/ ) {
+ $sig = $self->check_sig( $cmd, $arg );
+ ( $cmd, $arg ) = $self->read_from_status;
+ }
- my $cmds = join ', ', @cmds;
- $self->abort_gnupg( "protocol error: expected DECRYPTION_OKAY but never got it (all I saw was: $cmds): \n" )
+ $self->abort_gnupg( "protocol error: expected DECRYPTION_OKAY got $cmd: \n" )
unless $cmd =~ /DECRYPTION_OKAY/;
return $sig ? $sig : 1;