projects
/
pgp-tools.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Some packaging improvements: use dh_installexamples to install examples,
[pgp-tools.git]
/
gpgsigs
/
gpgsigs
diff --git
a/gpgsigs/gpgsigs
b/gpgsigs/gpgsigs
index 61c03be226cb3b160a30706f95a37ef44af7ca47..7678c196d6cb424414de2df45c9ca38f68950c6a 100755
(executable)
--- a/
gpgsigs/gpgsigs
+++ b/
gpgsigs/gpgsigs
@@
-155,7
+155,9
@@
while (<SIGS>) {
next;
}
if ( m/^uid:(?:.*?:){8,8}(.*):/s ) {
next;
}
if ( m/^uid:(?:.*?:){8,8}(.*):/s ) {
- $uid = myrecode($1, "UTF-8", $charset);
+ $uid = $1;
+ $uid =~ s/\\x([0-9a-f][0-9a-f])/ chr(hex($1)) /gie;
+ $uid = myrecode($uid, "UTF-8", $charset);
next;
}
if ( m/^sig:(?:.*?:){3,3}([0-9A-F]{8})([0-9A-F]{8}):(?:.*?:){5,5}(.*?):/ ) {
next;
}
if ( m/^sig:(?:.*?:){3,3}([0-9A-F]{8})([0-9A-F]{8}):(?:.*?:){5,5}(.*?):/ ) {
@@
-206,13
+208,23
@@
for my $k ( keys %{$sigs} ) {
# read checksums
# read checksums
-open MD, "gpg --print-md md5 $keytxt|" or warn "can't get gpg md5\n";
+open MD, "gpg --
with-colons --
print-md md5 $keytxt|" or warn "can't get gpg md5\n";
my $MD5 = <MD>;
close MD;
my $MD5 = <MD>;
close MD;
-open MD, "gpg --print-md sha1 $keytxt|" or warn "can't get gpg sha1\n";
+open MD, "gpg --
with-colons --
print-md sha1 $keytxt|" or warn "can't get gpg sha1\n";
my $SHA1 = <MD>;
close MD;
my $SHA1 = <MD>;
close MD;
+my @MD5 = split /:/, $MD5;
+my @SHA1 = split /:/, $SHA1;
+$MD5 = $MD5[2];
+$SHA1 = $SHA1[2];
+
+$MD5 =~ s/(.{16})/$1 /;
+$SHA1 =~ s/(.{20})/$1 /;
+$MD5 =~ s/([0-9A-Z]{2})/$1 /ig;
+$SHA1 =~ s/([0-9A-Z]{4})/$1 /ig;
+
chomp $MD5;
chomp $SHA1;
my $metatxt = quotemeta($keytxt);
chomp $MD5;
chomp $SHA1;
my $metatxt = quotemeta($keytxt);
@@
-226,6
+238,9
@@
sub print_tag
my ($key, $uid) = @_;
if (! defined $sigs->{$key}->{$uid}) {
warn "uid '$uid' not found on key $key\n";
my ($key, $uid) = @_;
if (! defined $sigs->{$key}->{$uid}) {
warn "uid '$uid' not found on key $key\n";
+ #for (keys %{ $sigs->{$key} }) {
+ # print STDERR "only have $_\n";
+ #};
return '(' . (' ' x @mykeys) . ')';
}
my $r = '(';
return '(' . (' ' x @mykeys) . ')';
}
my $r = '(';