summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2016-10-03 13:58:10 +0000
committerMarc Espie <espie@cvs.openbsd.org>2016-10-03 13:58:10 +0000
commit712fdeb733c1a4fa04c0b6d77396ec60bb067f49 (patch)
tree4172624bed47ee077a625a89cfa2858d23273cd4 /usr.sbin
parentd5027f95670cbf22347cb2abbe4133e39fe88524 (diff)
gc the old checking code in pkg_add
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PkgAdd.pm60
-rw-r--r--usr.sbin/pkg_add/OpenBSD/State.pm8
2 files changed, 4 insertions, 64 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm b/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm
index cd3102cc672..89d78ecadd3 100644
--- a/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm
@@ -1,7 +1,7 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: PkgAdd.pm,v 1.90 2016/09/14 14:14:22 espie Exp $
+# $OpenBSD: PkgAdd.pm,v 1.91 2016/10/03 13:58:09 espie Exp $
#
# Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
#
@@ -304,14 +304,6 @@ sub display_timestamp
my ($pkgname, $plist, $state) = @_;
return unless $plist->is_signed;
- if ($state->defines('nosig')) {
- $state->errsay("NOT CHECKING DIGITAL SIGNATURE FOR #1",
- $pkgname);
- return;
- }
- if (!$plist->check_signature($state)) {
- $state->fatal("#1 is corrupted", $pkgname);
- }
$state->display_timestamp($pkgname,
$plist->get('digital-signature')->iso8601);
}
@@ -684,43 +676,6 @@ sub iterate
}
}
-sub check_digital_signature
-{
- my ($set, $state) = @_;
- for my $handle ($set->newer) {
- $state->set_name_from_handle($handle, '+');
- my $plist = $handle->plist;
- my $pkgname = $plist->pkgname;
- if ($plist->is_signed) {
- if ($state->defines('nosig')) {
- $state->errsay("NOT CHECKING DIGITAL SIGNATURE FOR #1",
- $pkgname);
- } else {
- if (!$plist->check_signature($state)) {
- $state->fatal("#1 is corrupted",
- $pkgname);
- }
- $plist->{check_digest} = 1;
- $state->{packages_with_sig}++;
- }
- } else {
- $state->{packages_without_sig}{$pkgname} = 1;
- return if $state->{signature_style} eq 'unsigned';
- my $okay = 0;
- my $url;
- if (defined $handle->location) {
- $url = $handle->location->url;
- } else {
- $url = $pkgname;
- }
- $okay = $state->confirm("UNSIGNED PACKAGE $url: install anyway", 0);
- if (!$okay) {
- $state->fatal("Unsigned package #1", $url);
- }
- }
- }
-}
-
sub delete_old_packages
{
my ($set, $state) = @_;
@@ -770,8 +725,6 @@ sub really_add
my $errors = 0;
- check_digital_signature($set, $state);
-
if ($state->{not}) {
$state->status->what("Pretending to add");
} else {
@@ -1180,17 +1133,6 @@ sub finish_display
OpenBSD::Add::manpages_index($state);
# and display delayed thingies.
- my $warn = 1;
- if ($state->{signature_style} eq 'unsigned') {
- $warn = 0;
- }
- if ($state->{packages_with_sig}) {
- $warn = 1;
- }
- if ($warn && $state->{packages_without_sig}) {
- $state->say("UNSIGNED PACKAGES: #1",
- join(', ', keys %{$state->{packages_without_sig}}));
- }
if (defined $state->{updatedepends} && %{$state->{updatedepends}}) {
$state->say("Forced updates, bogus dependencies for ",
join(' ', sort(keys %{$state->{updatedepends}})),
diff --git a/usr.sbin/pkg_add/OpenBSD/State.pm b/usr.sbin/pkg_add/OpenBSD/State.pm
index dce6d294c4f..3f6e4282474 100644
--- a/usr.sbin/pkg_add/OpenBSD/State.pm
+++ b/usr.sbin/pkg_add/OpenBSD/State.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: State.pm,v 1.39 2016/09/27 21:31:20 naddy Exp $
+# $OpenBSD: State.pm,v 1.40 2016/10/03 13:58:09 espie Exp $
#
# Copyright (c) 2007-2014 Marc Espie <espie@openbsd.org>
#
@@ -346,12 +346,10 @@ sub handle_options
});
$state->{v} = $state->opt('v');
- if ($state->defines('newsign')) {
- $state->{signature_style} //= 'new';
- } elsif ($state->defines('unsigned')) {
+ if ($state->defines('unsigned')) {
$state->{signature_style} //= 'unsigned';
} elsif ($state->defines('oldsign')) {
- $state->{signature_style} //= 'old';
+ $state->fatal('old style signature no longer supported');
} else {
$state->{signature_style} //= 'new';
}