diff options
author | Peter Palfrader <peter@palfrader.org> | 2002-07-13 20:42:51 +0000 |
---|---|---|
committer | Peter Palfrader <peter@palfrader.org> | 2002-07-13 20:42:51 +0000 |
commit | fa67d465a07fc4b7ffff005ba732ecee193ee8cd (patch) | |
tree | 2a72d810ab3bcc39c307971cac3541046445f4c9 | |
parent | 10fa6d047c7bbe2a78659a45a338093b0748276d (diff) |
Only export selected keys to pgp keyrings
-rw-r--r-- | Echolot/Stats.pm | 24 | ||||
-rw-r--r-- | TODO | 6 |
2 files changed, 17 insertions, 13 deletions
diff --git a/Echolot/Stats.pm b/Echolot/Stats.pm index 519b982..5493436 100644 --- a/Echolot/Stats.pm +++ b/Echolot/Stats.pm @@ -1,7 +1,7 @@ package Echolot::Stats; # (c) 2002 Peter Palfrader <peter@palfrader.org> -# $Id: Stats.pm,v 1.18 2002/07/13 20:33:33 weasel Exp $ +# $Id: Stats.pm,v 1.19 2002/07/13 20:42:51 weasel Exp $ # =pod @@ -576,8 +576,8 @@ sub build_mixring() { -sub build_pgpring_type($$$) { - my ($type, $GnuPG, $keyring) = @_; +sub build_pgpring_type($$$$) { + my ($type, $GnuPG, $keyring, $keyids) = @_; for my $remailer (Echolot::Globals::get()->{'storage'}->get_remailers()) { next unless $remailer->{'showit'}; @@ -585,11 +585,13 @@ sub build_pgpring_type($$$) { next unless Echolot::Globals::get()->{'storage'}->has_type($addr, $type); my %key; + my $final_keyid; for my $keyid (Echolot::Globals::get()->{'storage'}->get_keys($addr, $type)) { my %new_key = Echolot::Globals::get()->{'storage'}->get_key($addr, $type, $keyid); if (!defined $key{'last_update'} || $key{'last_update'} < $new_key{'last_update'} ) { %key = %new_key; + $final_keyid = $keyid; }; }; @@ -629,14 +631,15 @@ sub build_pgpring_type($$$) { cluck("GnuPG status '$status' didn't indicate key for '$addr' was imporeted correctly. Ignoring.\n"); }; }; + push @$keyids, $final_keyid; }; }; return 1; }; -sub build_pgpring_export($$$) { - my ($GnuPG, $keyring, $file) = @_; +sub build_pgpring_export($$$$) { + my ($GnuPG, $keyring, $file, $keyids) = @_; my ( $stdin_fh, $stdout_fh, $stderr_fh, $status_fh ) = ( IO::Handle->new(), @@ -652,7 +655,7 @@ sub build_pgpring_export($$$) { ); my $pid = $GnuPG->wrap_call( commands => [ '--export' ], - command_args => [qw{--no-options --no-default-keyring --keyring}, $keyring ], + command_args => [qw{--no-options --no-default-keyring --keyring}, $keyring, @$keyids ], handles => $handles ); close($stdin_fh); @@ -681,19 +684,20 @@ sub build_pgpring() { Echolot::Globals::get()->{'hostname'}.".".time.'.'.$PROCESS_ID.'_'.Echolot::Globals::get()->{'internalcounter'}++.'.keyring'; - build_pgpring_type('cpunk-rsa', $GnuPG, $keyring) or + my $keyids = []; + build_pgpring_type('cpunk-rsa', $GnuPG, $keyring, $keyids) or cluck("build_pgpring_type failed"), return undef; - build_pgpring_export($GnuPG, $keyring, Echolot::Config::get()->{'resultdir'}.'/pgp-rsa.asc') or + build_pgpring_export($GnuPG, $keyring, Echolot::Config::get()->{'resultdir'}.'/pgp-rsa.asc', $keyids) or cluck("build_pgpring_export failed"), return undef; - build_pgpring_type('cpunk-dsa', $GnuPG, $keyring) or + build_pgpring_type('cpunk-dsa', $GnuPG, $keyring, $keyids) or cluck("build_pgpring_type failed"), return undef; - build_pgpring_export($GnuPG, $keyring, Echolot::Config::get()->{'resultdir'}.'/pgp-all.asc') or + build_pgpring_export($GnuPG, $keyring, Echolot::Config::get()->{'resultdir'}.'/pgp-all.asc', $keyids) or cluck("build_pgpring_export failed"), return undef; @@ -1,9 +1,7 @@ -$Id: TODO,v 1.27 2002/07/12 00:40:13 weasel Exp $ +$Id: TODO,v 1.28 2002/07/13 20:42:51 weasel Exp $ for 2.0: document configuration options - seperate keys in remailer-key reply if they share the same armore (cmeclex is - the only one doing this. AARG) can be done later, nice if for 2.0: getkeyconf command could take option: address [address ...] @@ -14,3 +12,5 @@ can be done later, nice if for 2.0: rotate secret get rid of dependency on mix get rid of dependency on gnupg + seperate keys in remailer-key reply if they share the same armore (cmeclex is + the only one doing this. AARG) |