#!/usr/bin/perl -w
-# caff -- CA - Fire and Forget
-# $Id: caff 37 2005-02-28 23:20:15Z weasel $
+# pgp-fixkey -- remove broken packets from keys
+# $Id$
#
# Copyright (c) 2004, 2005 Peter Palfrader <peter@palfrader.org>
#
use IO::Select;
use GnuPG::Interface;
-my $REVISION = '$Rev: 37 $';
+my $REVISION = '$Rev$';
my ($REVISION_NUMER) = $REVISION =~ /(\d+)/;
my $VERSION = "0.0.0.$REVISION_NUMER";
if ($type eq 'pub') {
$thiskey = $keyid;
debug("Found key $thiskey");
+ } elsif (!defined $thiskey) {
+ next;
} elsif ($type eq 'sig' || $type eq 'rev') {
- if (($keyid eq '0' x 16) && ($created == 0)) {
- push @KEYIDS, $thiskey if defined $thiskey;
- info("Adding $thiskey");
+ if (($keyid eq '0' x 16) || ($created == 0)) {
+ push @KEYIDS, $thiskey;
+ info("Key $thiskey needs cleaning.");
$thiskey = undef;
};
};
if (defined $line) { # only if we found a sig here - we never remove revocation packets for instance
debug("[sigremoval] doing line $line.");
my (undef, undef, undef, undef, $signer, $created, undef, undef, undef) = split /:/, $line;
- if ($signer eq ('0' x 16)) {
- debug("[sigremoval] not interested in that sig ($signer).");
+ if (($signer eq '0' x 16) || ($created == 0)) {
+ debug("[sigremoval] not interested in that sig ($signer, created: $created).");
$answer = "yes";
};
} else {