diff options
author | agc <agc> | 2005-03-03 22:43:49 +0000 |
---|---|---|
committer | agc <agc> | 2005-03-03 22:43:49 +0000 |
commit | c899214c28186efcde3cb0fd5ec34fe69b001fe3 (patch) | |
tree | 1fee601aa6ad00ffdd055eab618f798b0557f952 /security/gpg2dot/files | |
parent | b7f4045523af658e570672ce54453dd2bb9fe65b (diff) | |
download | pkgsrc-c899214c28186efcde3cb0fd5ec34fe69b001fe3.tar.gz |
Update gpg2dot to version 1.4.
Fixes from Christoph Badura, who tested on gnupg-1.2.
This new version works with gnupg-1.4.0 as well as older versions of gpg,
and uses the --list-sigs argument as well as the --with-colons arguments
to gpg.
Diffstat (limited to 'security/gpg2dot/files')
-rw-r--r-- | security/gpg2dot/files/gpg2dot.pl | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/security/gpg2dot/files/gpg2dot.pl b/security/gpg2dot/files/gpg2dot.pl index 213e23907f1..58dfe9e2a28 100644 --- a/security/gpg2dot/files/gpg2dot.pl +++ b/security/gpg2dot/files/gpg2dot.pl @@ -1,6 +1,6 @@ -#!@PREFIX@/bin/perl +#! @PREFIX@/bin/perl # -# $NetBSD: gpg2dot.pl,v 1.3 2004/04/04 22:16:59 hubertf Exp $ +# $NetBSD: gpg2dot.pl,v 1.4 2005/03/03 22:43:49 agc Exp $ # ---------------------------------------------------------------------------- # "THE BEER-WARE LICENSE" (Revision 42): @@ -20,26 +20,27 @@ $date = localtime(); $mykeyid = shift; -$sg = ""; -open(GPG, "gpg --list-keys --verbose 2>/dev/null |"); +open(GPG, "gpg --list-sigs --with-colons --no-sig-cache --verbose 2>/dev/null |"); while (<GPG>) { chomp; - if (/^(pub) +(\S+)\s+(\S+)\s+(.+\S)/ || - /^(uid) +\s+(.+\S)/) { - if ($1 eq "pub") { - ($lkeyid, $date, $kuid) = ($2, $3, $4); + my @fields = split /:/; + if ($fields[0] eq "pub" || $fields[0] eq "uid") { + if ($fields[0] eq "pub") { + ($lkeyid, $date, $kuid) = ($fields[4], $fields[5], $fields[9]); } else { - ($kuid) = ($2); + 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 = $lkeyid) =~ s:.*/::; $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); + elsif ($fields[0] eq "sig") { + ($skeyid, $date, $suid) = ($fields[4], $fields[5], $fields[9]); next if ($suid =~ /id not found/ || $skeyid eq $keyid); push(@isigs, "$keyid $skeyid $date $suid"); |