"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "scripts/Dpkg/OpenPGP.pm" between
dpkg_1.20.2.tar.xz and dpkg_1.20.3.tar.xz

About: dpkg is the Debian GNU/Linux package installation tool (handles .deb files).

OpenPGP.pm  (dpkg_1.20.2.tar.xz):OpenPGP.pm  (dpkg_1.20.3.tar.xz)
skipping to change at line 23 skipping to change at line 23
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>. # along with this program. If not, see <https://www.gnu.org/licenses/>.
package Dpkg::OpenPGP; package Dpkg::OpenPGP;
use strict; use strict;
use warnings; use warnings;
use POSIX qw(:sys_wait_h); use POSIX qw(:sys_wait_h);
use Exporter qw(import); use Exporter qw(import);
use File::Temp;
use File::Copy; use File::Copy;
use Dpkg::Gettext; use Dpkg::Gettext;
use Dpkg::ErrorHandling; use Dpkg::ErrorHandling;
use Dpkg::IPC; use Dpkg::IPC;
use Dpkg::Path qw(find_command); use Dpkg::Path qw(find_command);
our $VERSION = '0.01'; our $VERSION = '0.01';
our @EXPORT = qw( our @EXPORT = qw(
openpgp_sig_to_asc openpgp_sig_to_asc
skipping to change at line 101 skipping to change at line 102
if (find_command('gpg')) { if (find_command('gpg')) {
push @exec, 'gpg'; push @exec, 'gpg';
} elsif ($opts{require_valid_signature}) { } elsif ($opts{require_valid_signature}) {
error(g_('cannot import key in %s since GnuPG is not installed'), error(g_('cannot import key in %s since GnuPG is not installed'),
$asc); $asc);
} else { } else {
warning(g_('cannot import key in %s since GnuPG is not installed'), warning(g_('cannot import key in %s since GnuPG is not installed'),
$asc); $asc);
return; return;
} }
my $gpghome = File::Temp->newdir('dpkg-import-key.XXXXXXXX', TMPDIR => 1);
push @exec, '--homedir', $gpghome;
push @exec, '--no-options', '--no-default-keyring', '-q', '--import'; push @exec, '--no-options', '--no-default-keyring', '-q', '--import';
push @exec, '--keyring', $opts{keyring}; push @exec, '--keyring', $opts{keyring};
push @exec, $asc; push @exec, $asc;
my ($stdout, $stderr); my ($stdout, $stderr);
spawn(exec => \@exec, wait_child => 1, nocheck => 1, timeout => 10, spawn(exec => \@exec, wait_child => 1, nocheck => 1, timeout => 10,
to_string => \$stdout, error_to_string => \$stderr); to_string => \$stdout, error_to_string => \$stderr);
if (WIFEXITED($?)) { if (WIFEXITED($?)) {
my $status = WEXITSTATUS($?); my $status = WEXITSTATUS($?);
print { *STDERR } "$stdout$stderr" if $status; print { *STDERR } "$stdout$stderr" if $status;
skipping to change at line 130 skipping to change at line 135
sub verify_signature { sub verify_signature {
my ($sig, %opts) = @_; my ($sig, %opts) = @_;
$opts{require_valid_signature} //= 1; $opts{require_valid_signature} //= 1;
my @exec; my @exec;
if (find_command('gpgv')) { if (find_command('gpgv')) {
push @exec, 'gpgv'; push @exec, 'gpgv';
} elsif (find_command('gpg')) { } elsif (find_command('gpg')) {
push @exec, 'gpg', '--no-default-keyring', '-q', '--verify'; my @gpg_opts = qw(--no-options --no-default-keyring -q);
push @exec, 'gpg', @gpg_opts, '--verify';
} elsif ($opts{require_valid_signature}) { } elsif ($opts{require_valid_signature}) {
error(g_('cannot verify signature on %s since GnuPG is not installed'), error(g_('cannot verify signature on %s since GnuPG is not installed'),
$sig); $sig);
} else { } else {
warning(g_('cannot verify signature on %s since GnuPG is not installed') , warning(g_('cannot verify signature on %s since GnuPG is not installed') ,
$sig); $sig);
return; return;
} }
foreach my $keyring (@{$opts{keyrings}}) { foreach my $keyring (@{$opts{keyrings}}) {
push @exec, '--keyring', $keyring; push @exec, '--keyring', $keyring;
 End of changes. 3 change blocks. 
1 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)