X-Git-Url: https://git.sthu.org/?a=blobdiff_plain;f=gpgsigs%2Fgpgsigs;h=cc7bad0aa404d66c08192004f914f12a51e8a413;hb=7f67e8a62b522d78020a6ead48cef03f7d3421da;hp=2c4da429ac0290e5ea9ac7a82122f354bedfc503;hpb=b6f3799ed2d896195b4d67868c0f2ba6b2b1a827;p=pgp-tools.git diff --git a/gpgsigs/gpgsigs b/gpgsigs/gpgsigs index 2c4da42..cc7bad0 100755 --- a/gpgsigs/gpgsigs +++ b/gpgsigs/gpgsigs @@ -20,6 +20,7 @@ # see the Debian changelog for further changes. my $VERSION = qq$Rev$; +$ENV{PATH} .= ":/usr/share/signing-party"; use strict; use warnings; @@ -152,11 +153,12 @@ print STDERR "Running --list-sigs, this will take a while "; open SIGS, "gpg --fixed-list-mode --with-colons --list-sigs @mykeys @keys 2>/dev/null |" or die "can't get gpg listing"; -my ($key, $uid, $sigs); +my ($key, $uid, $sigs, $photocount); while () { if ( m/^pub:(?:.*?:){3,3}([0-9A-F]{16,16}):/ ) { $key = $1; print STDERR "."; + undef $photocount; next; } if ( m/^uid:(.):(?:.*?:){7,7}(.*):/s ) { @@ -177,8 +179,11 @@ while () { my $size = $3 - 19; # FIXME: find a nicer way to find out picture size $uid = "[jpeg image of size $size]"; next if $uidstatus eq "r"; - if ($latex) { - system "gpg --photo-viewer 'convert - %k.eps' --list-options show-photos --list-key $key > /dev/null"; + if ($latex and not $photocount) { # call once per key + my ($shortkey) = substr $key, -8; + system "rm -f $shortkey.[1-9]*.eps"; + system "gpg --photo-viewer 'gpgsigs-eps-helper $shortkey' --list-options show-photos --list-key $key > /dev/null"; + $photocount = 1; } my ($shortkey) = substr $key, -8; push @{$uids{$shortkey}}, $uid; @@ -237,28 +242,37 @@ close MD; open MD, "gpg --with-colons --print-md sha256 $keytxt|" or warn "can't get gpg sha256\n"; my $SHA256 = ; close MD; +open MD, "gpg --with-colons --print-md ripemd160 $keytxt|" or warn "can't get gpg ripemd160\n"; +my $RIPEMD160 = ; +close MD; my @MD5 = split /:/, $MD5; my @SHA1 = split /:/, $SHA1; my @SHA256 = split /:/, $SHA256; +my @RIPEMD160 = split /:/, $RIPEMD160; $MD5 = $MD5[2]; $SHA1 = $SHA1[2]; $SHA256 = $SHA256[2]; +$RIPEMD160 = $RIPEMD160[2]; $MD5 =~ s/(.{16})/$1 /; $SHA1 =~ s/(.{20})/$1 /; $SHA256 =~ s/(.{32})/$1 /; +$RIPEMD160 =~ s/(.{20})/$1 /; $MD5 =~ s/([0-9A-Z]{2})/$1 /ig; $SHA1 =~ s/([0-9A-Z]{4})/$1 /ig; $SHA256 =~ s/([0-9A-Z]{4})/$1 /ig; +$RIPEMD160 =~ s/([0-9A-Z]{4})/$1 /ig; chomp $MD5; chomp $SHA1; chomp $SHA256; +chomp $RIPEMD160; my $metatxt = quotemeta($keytxt); $MD5 =~ s/^$metatxt:\s*//; $SHA1 =~ s/^$metatxt:\s*//; $SHA256 =~ s/^$metatxt:\s*//; +$RIPEMD160 =~ s/^$metatxt:\s*//; # write out result @@ -293,6 +307,7 @@ if ($latex) { \usepackage[margin=2cm]{geometry} \usepackage{alltt} \usepackage{graphicx} +\usepackage{grffile} \begin{document} \begin{alltt} EOF @@ -310,6 +325,9 @@ while () { if (/^SHA256 Checksum:/ && defined $SHA256) { s/[_[:xdigit:]][_ [:xdigit:]]+_/$SHA256/; } + if (/^RIPEMD160 Checksum:/ && defined $RIPEMD160) { + s/[_[:xdigit:]][_ [:xdigit:]]+_/$RIPEMD160/; + } if ( m/^pub +(?:\d+)[DR]\/([0-9A-F]{8}) [0-9]{4}-[0-9]{2}-[0-9]{2} *(.*)/ ) { $key = $1; $uid = $2; @@ -318,6 +336,7 @@ while () { # next; #} print WRITE; + undef $photocount; next; } @@ -334,8 +353,9 @@ while () { foreach $uid (@{$uids{$key}}) { print WRITE print_tag($key, $uid) . " $uid\n"; if ($latex and ($uid =~ /^\[jpeg image/)) { + $photocount++; print WRITE "\\begin{flushright}\n"; - print WRITE "\\includegraphics[height=3cm]{$key.eps}\n"; + print WRITE "\\includegraphics[height=3cm]{$key.$photocount}\n"; print WRITE "\\end{flushright}\n"; } } @@ -397,8 +417,9 @@ B [I] II<[>B<,>IB<,>I<...>I<]>>I<]> F B was written to assist the user in signing keys during a keysigning party. It takes as input a file containing keys in C format and prepends every line with a tag indicating if the user has already signed -that uid. When the file contains C or C lines -and placeholders (C<__ __>), the checksum is inserted. +that uid. When the file contains C lines and placeholders +(C<__ __>), the checksum is inserted. ALGO can be set to the following algorithms: +MD5 SHA1 SHA256 or RIPEMD160. =head1 OPTIONS @@ -425,6 +446,7 @@ since the input text was generated. =item B<--latex> Generate LaTeX output, including photo IDs. Implies B<--refresh>. +B This writes eps files to the current directory. =item I