sigtrace.pl

Adrian 'Dagurashibanipal' von Bidder avbidder@fortytwo.ch
Tue Aug 20 11:34:02 2002


--=-c1+IeW0xEUDsAr8QxCPn
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Tue, 2002-08-20 at 10:41, Darxus@chaosreigns.com wrote:
> On 08/20, Adrian 'Dagurashibanipal' von Bidder wrote:
> > No idea how this datafile is built, but a 'add a specific key' option
> > would be great. (Ok, I see that this could be non-trivial or impossible
> > depending on the data format).
>=20
> No, that would be really easy.  The code is actually in sigtrace. =20
>=20
> # Load all signature relationships into a hash of arrays, called %signedb=
y.
> # Each key is the ID of someone who signed keys, and its value is an arra=
y
> # containing a list of the IDs he signed.
>=20
> #while ($line =3D <STDIN>)
> #{
> #  ($type,$id) =3D split(' ',$line);
> #  if ($type eq "pub")
> #  {
> #    $pub =3D (split('/',$id))[1];
> #  } elsif ($type eq "sig")
> #  {
> #    next if ($id eq $pub);
> #    #push (@{$signedby{$id}},$pub);
> #    $signedby{$id} .=3D "$pub ";
> #  }
> #}
>=20
>=20
> If you uncomment that code and run something like "gpg --list-sigs
> yourkey | ./sigtrace.pl", it should add yourkey to signed.db (I reserve
> the right to be wrong since I just woke up waay too early)

Cool.

Slight bug:

Newer gpg signatures can cause output like 'sig 3    <id> <uid>' , this
would be keyid 3...

Perhaps you could switch to --with-colons output format, that should
never change. My perl is long unused, but this here works for me.

--- sigtrace.pl.orig	2002-08-20 11:26:15.000000000 +0200
+++ sigtrace.pl	2002-08-20 11:32:59.000000000 +0200
@@ -85,7 +85,8 @@
=20
 while ($line =3D <STDIN>)
 {
-  ($type,$id) =3D split(' ',$line);
+  ($type, $dummy, $dummy, $dummy, $id) =3D split(':',$line);
+  $id =3D substr($id, 8, 15);
   if ($type eq "pub")
   {
     $pub =3D (split('/',$id))[1];


(Oh, and you can't call it without arguments. Need to give some -
doesn't matter what).

cheers
-- vbi

--=20
secure email with gpg                         http://fortytwo.ch/gpg

--=-c1+IeW0xEUDsAr8QxCPn
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQA9Yg1dwj49sl5Lcx8RArEeAJ9cGgeDXjoKOa10KrJSzSMFWyPMMACfXjp5
D62R/pye574frhh7FYsL6DU=
=jPrf
-----END PGP SIGNATURE-----

--=-c1+IeW0xEUDsAr8QxCPn--