# ex:ts=8 sw=4:
-# $OpenBSD: Paths.pm,v 1.22 2013/12/31 11:21:10 espie Exp $
+# $OpenBSD: Paths.pm,v 1.23 2014/01/02 13:45:14 espie Exp $
#
# Copyright (c) 2007 Marc Espie <espie@openbsd.org>
#
sub pkgca() { '/etc/ssl/pkgca.pem' }
sub signify() { '/usr/bin/signify' }
sub signifykey() { '/etc/openbsd.pubkey' }
+sub signifyfwkey() { '/etc/openbsd-fw.pubkey' }
sub pkg_add() { '/usr/sbin/pkg_add' }
sub chmod() { '/bin/chmod' } # external command is used for symbolic modes.
sub gzip() { '/usr/bin/gzip' }
# ex:ts=8 sw=4:
-# $OpenBSD: signify.pm,v 1.1 2013/12/31 11:21:10 espie Exp $
+# $OpenBSD: signify.pm,v 1.2 2014/01/02 13:45:14 espie Exp $
#
# Copyright (c) 2013 Marc Espie <espie@openbsd.org>
#
my $header = "signify -- signature\n";
my $cmd = OpenBSD::Paths->signify;
-my $defaultpubkey = OpenBSD::Paths->signifykey;
my $suffix = ".sig";
sub compute_signature
open my $fh, ">", $contents;
$plist->write_no_sig($fh);
close $fh;
- $state->system($cmd, '-I', $contents, '-S', $key, '-V', 'sign')
+ $state->system($cmd, '-i', $contents, '-s', $key, '-S')
== 0 or die "probleme generating signature";
open(my $sighandle, '<', $sigfile)
or die "problem reading signature";
print $fh2 $header, $sig->{b64sig}, "\n";
close $fh;
close $fh2;
- my $pubkey = $defaultpubkey;
+ my $pubkey;
+
+ if ($state->defines('FW_UPDATE')) {
+ $pubkey = OpenBSD::Paths->signifyfwkey;
+ } else {
+ $pubkey = OpenBSD::Paths->signifykey;
+ }
if ($plist->has('vendor')) {
my $vendor = $plist->get('vendor')->name;
$pubkey = "/etc/signify/$vendor.pubkey";
}
if ($state->system(sub { open STDERR, ">", "/dev/null";
open STDOUT, ">", "/dev/null";},
- $cmd, '-I', $fname, '-P', $pubkey, '-V', 'verify') != 0) {
+ $cmd, '-i', $fname, '-p', $pubkey, '-V') != 0) {
$state->log("Bad signature");
return 0;
}