Fix it to actually work
[pgp-tools.git] / caff / pgp-fixkey
index ca00698cda2c8a22aa1a07fa32d48f8bc9f2cc15..d772af7926bfd2814a6908f674ff569ad3434230 100755 (executable)
 
 =head1 NAME
 
-pgp-clean -- remove all non-self signatures from key
+pgp-fixkey -- remove broken packets from keys
 
 =head1 SYNOPSIS
 
 =over
 
-=item B<pgp-clean> I<keyid> [I<keyid> ...]
+=item B<pgp-fixkey> I<keyid> [I<keyid> ...]
 
 =back
 
 =head1 DESCRIPTION
 
-B<pgp-clean> takes a list of keyids on the command line and outputs an
-ascii-armored keyring on stdout for each key with all signatures except
-self-signatures stripped.  Its use is to reduce the size of keys sent out after
-signing (e.g. with B<caff>).
+B<pgp-fixkey> removes broken packets from keys in the GnuPG keyring that make
+GnuPG spew ugly warnings.  It takes a list of keyids on the command line and
+only cleans those keys.
 
 =head1 OPTIONS
 
@@ -76,8 +75,6 @@ caff(1), gpg(1).
 
 Peter Palfrader <peter@palfrader.org>
 
-This manpage was written in POD by Christoph Berg <cb@df7cb.de>.
-
 =cut
 
 use strict;
@@ -230,7 +227,7 @@ my $KEYEDIT_DELSUBKEY_PROMPT = '^\[GNUPG:\] GET_BOOL keyedit.remove.subkey';
 
 
 sub usage() {
-       print STDERR "pgp-clean $VERSION - (c) 2004, 2005 Peter Palfrader\n";
+       print STDERR "pgp-fixkey $VERSION - (c) 2004, 2005 Peter Palfrader\n";
        print STDERR "Usage: $PROGRAM_NAME <keyid> [<keyid> ...]\n";
        exit 1;
 };
@@ -247,9 +244,6 @@ for my $keyid (@ARGV) {
 };
 
 
-##################
-# export and prune
-##################
 KEYS:
 for my $keyid (@KEYIDS) {
        # get key listing
@@ -331,7 +325,7 @@ for my $keyid (@KEYIDS) {
                if (defined $line) { # only if we found a sig here - we never remove revocation packets for instance
                        debug("[sigremoval] doing line $line.");
                        my ($dummy1, $dummy2, $dummy3, $dummy4, $signer, $created, $dummy7, $dummy8, $dummy9) = split /:/, $line;
-                       if ($signer eq ('-1' x 16)) {
+                       if ($signer eq ('0' x 16)) {
                                debug("[sigremoval] not interested in that sig ($signer).");
                                $answer = "yes";
                        };