Import of pkgsrc-2013Q2

This commit is contained in:
2013-09-26 17:14:40 +02:00
commit 785076ae39
74991 changed files with 4380255 additions and 0 deletions

8
security/gpg2dot/DESCR Normal file
View File

@@ -0,0 +1,8 @@
This simple perl script takes the output of gpg --list-keys --verbose,
which lists all the keys in your public key ring, along with all
their signatures, and converts it to a di-graph in "dot" language
form.
The graphviz package can turn the description into a graph you can
look at to see who has signed whose key, or how far it is from your
key to someone in Reykjavik, etc.

45
security/gpg2dot/Makefile Normal file
View File

@@ -0,0 +1,45 @@
# $NetBSD: Makefile,v 1.17 2013/05/31 12:41:51 wiz Exp $
#
DISTNAME= gpg2dot-1.5
PKGREVISION= 2
CATEGORIES= security
MASTER_SITES= # empty
DISTFILES= # empty
MAINTAINER= lukem@NetBSD.org
HOMEPAGE= ftp://ftp.NetBSD.org/pub/NetBSD/packages/pkgsrc/doc/pkgsrc.html
COMMENT= Converts your GnuPG keyring to a graph of associations
USE_LANGUAGES= # empty
USE_TOOLS+= perl:run
NO_CONFIGURE= yes
DISTVER= ${DISTNAME:S/gpg2dot-//}
WRKSRC= ${WRKDIR}
INSTALLATION_DIRS= bin
do-extract:
${CP} ${FILESDIR}/gpg2dot.pl ${WRKSRC}/gpg2dot.pl
# ${CP} ${FILESDIR}/gpg2dot.1 ${WRKSRC}/gpg2dot.1.in
do-build:
.for file in gpg2dot
${SED} -e 's|@PREFIX@|${PREFIX}|g' \
-e 's|@DISTVER@|${DISTVER}|g' \
< ${WRKSRC}/${file}.pl \
> ${WRKSRC}/${file}
.endfor
#.for file in gpg2dot
# ${SED} -e '' \
# < ${WRKSRC}/${file}.1.in \
# > ${WRKSRC}/${file}.1
#.endfor
do-install:
${INSTALL_SCRIPT} ${WRKSRC}/gpg2dot ${DESTDIR}${PREFIX}/bin/gpg2dot
# ${INSTALL_MAN} ${WRKSRC}/gpg2dot.1 ${PREFIX}/${PKGMANDIR}/man1
.include "../../mk/bsd.pkg.mk"

2
security/gpg2dot/PLIST Normal file
View File

@@ -0,0 +1,2 @@
@comment $NetBSD: PLIST,v 1.1 2004/01/21 04:04:55 atatat Exp $
bin/gpg2dot

View File

@@ -0,0 +1,112 @@
#! @PREFIX@/bin/perl
#
# $NetBSD: gpg2dot.pl,v 1.5 2011/01/13 00:40:09 lukem Exp $
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# Andrew Brown <atatat@NetBSD.org> and Luke Mewburn <lukem@NetBSD.org>
# 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/
#
$url_statistics='http://webware.lysator.liu.se/jc/wotsap/search/keystatistics?key=%s';
$url_pathfinder='http://webware.lysator.liu.se/jc/wotsap/search/paths?top=%s&bottom=%s';
$now = localtime();
$mykeyid = uc shift;
open(GPG, "gpg --list-sigs --with-colons --no-sig-cache --verbose 2>/dev/null |");
while (<GPG>) {
chomp;
my @fields = split /:/;
if ($fields[0] eq "pub" || $fields[0] eq "uid") {
if ($fields[0] eq "pub") {
($keyid, $date, $kuid) = ($fields[4], $fields[5], $fields[9]);
}
else {
next; # XXX --with-colons doesn't seem to produce uid records with useable values
($kuid) = ($fields[$9]);
}
$kuid =~ s/\"/\\\"/g;
$kuid =~ s/\\x([0-9a-fA-F]+)/chr(hex($1))/eg;
$keyid = substr($keyid, -8);
$kuid{$keyid} = $kuid;
next if ($label{$keyid} != "");
$label{$keyid} = "$keyid - $date\\n$kuid";
}
elsif ($fields[0] eq "sig") {
($skeyid, $date, $suid) = ($fields[4], $fields[5], $fields[9]);
$skeyid = substr($skeyid, -8);
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});
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\"[tailURL=\"%s\",headURL=\"%s\",color=\"%s\"%s];\t// %s -> %s\n",
$skeyid, $keyid,
sprintf($url_pathfinder, $keyid, $skeyid),
sprintf($url_pathfinder, $skeyid, $keyid),
$color, $attrs,
$kuid{$skeyid}, $kuid{$keyid}));
$signer{$skeyid} = "yes";
$signed{$keyid} = "yes";
}
foreach (keys %label) {
next if (!$signer{$_} && !$signed{$_});
push(@keys, sprintf("\"%s\" [URL=\"%s\",label=\"%s\",shape=\"box\"];\n",
$_, sprintf($url_statistics, $_), $label{$_}));
}
@sigs = uniq(sort(@sigs));
$" = "";
print(<<"EOF")
digraph "gpg" {
label = "gpg signature graph, $now";
@keys
@sigs
}
EOF
;
sub uniq {
my (@i) = @_;
my (@o);
push(@o, shift(@i));
foreach (@i) {
push(@o, $_) if ($o[-1] ne $_);
}
@o;
}