pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/security/gpg2dot/files "Collapse" mutual trust into a ...
details: https://anonhg.NetBSD.org/pkgsrc/rev/027af7a4f549
branches: trunk
changeset: 466596:027af7a4f549
user: lukem <lukem%pkgsrc.org@localhost>
date: Wed Jan 21 04:14:45 2004 +0000
description:
"Collapse" mutual trust into a single line of a different color.
If an optional "mykeyid" is given on the command line, use different
colors for lines to & from that node. The colors are:
green mutual trust, includes mykey
blue mutual trust, not mykey
orange someone trusts mykey (one way)
red mykey trusts someone (one way)
black one way trust, not mykey
diffstat:
security/gpg2dot/files/gpg2dot.pl | 47 ++++++++++++++++++++++++++++++--------
1 files changed, 37 insertions(+), 10 deletions(-)
diffs (81 lines):
diff -r 104debd1a4ec -r 027af7a4f549 security/gpg2dot/files/gpg2dot.pl
--- a/security/gpg2dot/files/gpg2dot.pl Wed Jan 21 04:04:55 2004 +0000
+++ b/security/gpg2dot/files/gpg2dot.pl Wed Jan 21 04:14:45 2004 +0000
@@ -1,15 +1,24 @@
#!@PREFIX@/bin/perl
+#
+# $NetBSD: gpg2dot.pl,v 1.2 2004/01/21 04:14:45 lukem Exp $
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
-# <atatat%NetBSD.ORG@localhost> wrote this file. As long as you retain this notice you
-# can do whatever you want with this stuff. If we meet some day, and you think
-# this stuff is worth it, you can buy me a beer in return.
-#
-# Andrew Brown
+# Andrew Brown <atatat%NetBSD.org@localhost> and Luke Mewburn <lukem%NetBSD.org@localhost>
+# wrote this file. As long as you retain this notice you can do whatever
+# you want with this stuff. If we meet some day, and you think this stuff
+# is worth it, you can buy us a beer in return.
# ----------------------------------------------------------------------------
+#
+# gpg2dot [mykey] --
+# generate input for dot(1) from gpg(1) --list-sigs
+# gpg http://www.gnupg.org
+# dot http://www.graphviz.org/
+#
+
$date = localtime();
+$mykeyid = shift;
$sg = "";
open(GPG, "gpg --list-keys --verbose 2>/dev/null |");
@@ -25,24 +34,42 @@
}
$kuid =~ s/\"/\\\"/g;
($keyid = $lkeyid) =~ s:.*/::;
- next if ($kuid !~ /netbsd.org/i);
$kuid{$keyid} = $kuid;
+ next if ($label{$keyid} != "");
$label{$keyid} = "$lkeyid - $date\\n$kuid";
}
elsif (/^sig (.{7}) (\S+)\s+(\S+)\s+(.+\S)/) {
($skeyid, $date, $suid) = ($2, $3, $4);
- next if ($kuid !~ /netbsd.org/i ||
- $suid =~ /id not found/ ||
+ next if ($suid =~ /id not found/ ||
$skeyid eq $keyid);
push(@isigs, "$keyid $skeyid $date $suid");
+ $sigmap{"$keyid-$skeyid"} = 1;
}
}
foreach (@isigs) {
($keyid, $skeyid, $date, $suid) = split(/ /, $_, 4);
next if (!$kuid{$keyid} || !$kuid{$skeyid});
- push(@sigs, sprintf("\"%s\" -> \"%s\";\t// %s -> %s\n",
- $skeyid, $keyid, $kuid{$skeyid}, $kuid{$keyid}));
+ next if ($sigmap{"$skeyid-$keyid"} == -1);
+ $color = "black";
+ $attrs = "";
+ if ($sigmap{"$skeyid-$keyid"}) {
+ if ($keyid eq $mykeyid ||
+ $skeyid eq $mykeyid) { # two way trust, includes me
+ $color = "green";
+ } else { # two way trust, me unevolved
+ $color = "blue";
+ }
+ $attrs = ",dir=\"both\"";
+ $sigmap{"$keyid-$skeyid"} = -1;
+ } elsif ($keyid eq $mykeyid) { # you trust me (one way)
+ $color = "orange";
+ } elsif ($skeyid eq $mykeyid) { # i trust you (one way)
+ $color = "red";
+ }
+ push(@sigs, sprintf("\"%s\" -> \"%s\" [color=\"%s\"%s];\t// %s -> %s\n",
+ $skeyid, $keyid, $color, $attrs,
+ $kuid{$skeyid}, $kuid{$keyid}));
$signer{$skeyid} = "yes";
$signed{$keyid} = "yes";
}
Home |
Main Index |
Thread Index |
Old Index