[Pgp-tools-commit] r724 - in trunk: debian gpgsigs

Guilhem Moulin guilhem-guest at moszumanska.debian.org
Thu Nov 6 21:51:34 UTC 2014


Author: guilhem-guest
Date: 2014-11-06 21:51:34 +0000 (Thu, 06 Nov 2014)
New Revision: 724

Modified:
   trunk/debian/changelog
   trunk/gpgsigs/gpgsigs
Log:
gpgsigs: Allow 8-digits keyid to be passed for annotation.

Closes: #768342 (regression bug).

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2014-11-06 21:51:29 UTC (rev 723)
+++ trunk/debian/changelog	2014-11-06 21:51:34 UTC (rev 724)
@@ -8,6 +8,8 @@
     + Fix RCF 2822 violation: Never localize the "Date" header, regarless of
       the LC_ALL, LC_TIME and LANG in use.  Regression introduced in r698.
       (Closes: #767371)
+    + Regression fix: allow 8-digits keyid to be passed for annotation.
+      (Closes: #768342)
   * gpg-key2latex: new script to generate a LaTeX file with fingerprint paper
     slips. (Closes: #316131, #412512)
 

Modified: trunk/gpgsigs/gpgsigs
===================================================================
--- trunk/gpgsigs/gpgsigs	2014-11-06 21:51:29 UTC (rev 723)
+++ trunk/gpgsigs/gpgsigs	2014-11-06 21:51:34 UTC (rev 724)
@@ -94,7 +94,7 @@
 if (!@mykeys || scalar @ARGV) {
 	usage(*STDERR, 1);
 }
-foreach my $falsekey (grep { $_ !~ /^([0-9A-F]{16,16}|[0-9A-F]{8,8})$/ } @mykeys) {
+foreach my $falsekey (grep { $_ !~ /^([0-9A-F]{16}|[0-9A-F]{8})$/ } @mykeys) {
 	print STDERR "Invalid keyid $falsekey given\n";
 	usage(*STDERR, 1);
 }
@@ -176,6 +176,7 @@
 					$key = $2;
 					$keys{$key} = [];
 					print STDERR '.';
+					@mykeys = map { substr($key,-8) eq $_ ? $key : $_ } @mykeys;
 					next;
 				}
 				next unless $key; # nothing to do on revoked keys
@@ -200,7 +201,7 @@
 				}
 				next unless $uid; # nothing to do on revoked uids
 				if (/^sig:(?:[^:]*:){3}([0-9A-F]{16}):(\d+):(\d*):(?:[^:]*:){3}(1[0-3][lx])(?::.*)?$/) {
-					if (!grep { /(?:$1|$key)$/ } @mykeys) {
+					if (!grep { $1 =~ /$_$/ or $key =~ /$_$/ } @mykeys) {
 						$sig = []; # $key is not ours, and the signer isn't us: don't waste resources
 					} else {
 						$sigs{$key}->{$uid}->{$1} //= [];




More information about the Pgp-tools-commit mailing list