]>
git.sthu.org Git - pgp-tools.git/blob - keyanalyze/willy/unsign
3 # unsign takes the output from keyanalyze and adds useful information such as
4 # the keys that haven't signed you and you haven't signed within this set.
5 # This functionality should probably be added as an option to keyanalyze.
10 my ($title, @array) = @_;
11 my $size = $#array + 1;
14 print " $_ $names{$_}\n";
16 print "Total: $size keys in this set\n";
20 my ($firstref, $secondref) = @_;
23 ELEMENT
: foreach $element (@
$firstref) {
24 foreach $test (@
$secondref) {
25 next ELEMENT
if $element eq $test;
28 push @result, $element;
35 my ($name, $toref, $fromref) = @_;
36 open(KEY
, $name) or return 1;
38 while (my $line = <KEY
>) {
39 if ($line =~ "^Signatures to") {
41 } elsif ($line =~ "^Total:") {
43 } elsif ($line =~ "^Signatures from") {
45 } elsif ($state == 1) {
46 my @key = split(' ', $line);
47 push @
$toref, @key[1];
48 } elsif ($state == 2) {
49 my @key = split(' ', $line);
50 push @
$fromref, @key[1];
57 open(IDS
, "$group/pubring.ids") or die "Could not open $group\n";
59 next if ($id =~ /^#/);
60 next if ($id =~ /^$/);
63 $id = substr($id, -8) if length($id) > 8;
66 $name = `gpg --options $group/options --list-keys $id`;
68 $name =~ s/^.*[0-9][0-9] //;
75 my $name = $group . "/output/" . substr($key, 0, 2) . "/" . $key;
79 next if read_keyfile
($name, \
@to, \
@from);
84 my @nonsigned = set_diff
(\
@ids, \
@from);
85 my @nonsigners = set_diff
(\
@ids, \
@to);
87 my @first = set_diff
(\
@nonsigned, \
@nonsigners);
88 my @third = set_diff
(\
@nonsigned, \
@first);
89 my @second = set_diff
(\
@nonsigners, \
@nonsigned);
91 open(KEY
, ">>$name") or die "Cannot open $name\n";
92 my $oldfh = select(KEY
);
94 print_keys
("This key has been signed by, but has not signed", @first);
95 print_keys
("This key has signed, but has not been signed by", @second);
96 print_keys
("This key is not directly connected to", @third);