diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2007-06-17 09:50:03 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2007-06-17 09:50:03 +0000 |
commit | 534154918c009a0635d7029d8785f214421f3e67 (patch) | |
tree | 3eb7e9548da0ff4d6cc6bee464f61f26997deef2 | |
parent | 7302ef96428b6e6ed4d2be6deefe9a2ed724c034 (diff) |
add a bit of scaffolding for signatures
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackingElement.pm | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm index 1fdebd0c067..2f9fa4b56d7 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PackingElement.pm,v 1.138 2007/06/16 12:16:42 espie Exp $ +# $OpenBSD: PackingElement.pm,v 1.139 2007/06/17 09:50:02 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -111,6 +111,12 @@ sub write } } +sub write_no_sig +{ + my ($self, $fh) = @_; + $self->write($fh); +} + # needed for comment checking sub fullstring { @@ -1444,6 +1450,32 @@ sub check return; } +package OpenBSD::PackingElement::DigitalSignature; +our @ISA=qw(OpenBSD::PackingElement::Unique); +sub keyword() { 'digital-signature' } +__PACKAGE__->register_with_factory; + +sub new +{ + my ($class, $args) = @_; + my ($key, $timestamp, $signature) = split(/\:/, $args); + bless { key => $key, timestamp => $timestamp, b64sig => $signature }, + $class; +} + +sub stringize +{ + my $self = shift; + return join(':', $self->{key}, $self->{timestamp}, $self->{b64sig}); +} + +sub write_no_sig +{ + my ($self, $fh) = @_; + print $fh "\@", $self->keyword, " ", $self->{key}, ":", + $self->{timestamp}, "\n"; +} + package OpenBSD::PackingElement::Old; our @ISA=qw(OpenBSD::PackingElement); @@ -1481,7 +1513,7 @@ sub register_old_keyword } for my $k (qw(src display mtree ignore_inst dirrm pkgcfl pkgdep newdepend - libdepend digitalsignature ignore)) { + libdepend ignore)) { __PACKAGE__->register_old_keyword($k); } |