[Pgp-tools-commit] r843 - in trunk: debian gpg-key2latex

Guilhem Moulin guilhem-guest at moszumanska.debian.org
Wed Feb 24 10:22:50 UTC 2016


Author: guilhem-guest
Date: 2016-02-24 10:22:50 +0000 (Wed, 24 Feb 2016)
New Revision: 843

Modified:
   trunk/debian/changelog
   trunk/gpg-key2latex/gpg-key2latex
Log:
gpg-key2latex: fix master key fpr when there is an unusable subkey.

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2016-02-19 16:51:06 UTC (rev 842)
+++ trunk/debian/changelog	2016-02-24 10:22:50 UTC (rev 843)
@@ -31,6 +31,8 @@
       output.
     + For ECDH, ECDSA, EDDSA (sub)keys, show the curve name instead of the
       public key algorithm and length.  This matches GnuPG 2.1.x's output.
+    + The master key's fingerprint was incorrectly set to the last unusable
+      (eg, expired or revoked) subkey fingerprint, if any.  (Closes: #815721)
   * keyart:
     + Print the public key algorithm and length as shown by GnuPG 2.1 (e.g.,
       "rsa4096" instead of "4096R"); for ECDH, ECDSA and EDDSA keys, show the

Modified: trunk/gpg-key2latex/gpg-key2latex
===================================================================
--- trunk/gpg-key2latex/gpg-key2latex	2016-02-19 16:51:06 UTC (rev 842)
+++ trunk/gpg-key2latex/gpg-key2latex	2016-02-24 10:22:50 UTC (rev 843)
@@ -111,6 +111,8 @@
                     chomp;
                     if (/^pub:([^:]*):([^:]*):([^:]*):([0-9A-F]{16}):(\d+):(\d*):(?:[^:]*:){4}([^:]*)(:.*)?$/) {
                         my $keyid = $4;
+                        %key = ();
+                        undef $sub;
                         if ($1 =~ /[eir]/ or $7 =~ /D/) {
                             warn "Ignoring unusable key $keyid.\n";
                         }
@@ -126,6 +128,7 @@
                     }
                     next unless %key;
                     if (/^uid:([^:]+):(?:[^:]*:){6}[^:]*:([^:]+)/) {
+                        undef $sub;
                         next if $1 =~ /[er]/;
 
                         my $text = $2;
@@ -135,9 +138,8 @@
                         next;
                     }
                     if (/^sub:([^:]+):([^:]*):([^:]*):([0-9A-F]{16}):(\d+):(\d*):(?:[^:]*:){4}([^:]*)(:.*)?$/) {
-                        undef $sub;
-                        next if $1 =~ /[eir]/ or $7 =~ /D/; # ignore unsable subkey
                         $sub = {};
+                        $sub->{validity} = $1;
                         $sub->{length} = $2;
                         $sub->{algo} = $3;
                         $sub->{creation} = $5;
@@ -150,7 +152,8 @@
                         if (defined $sub) {
                             # subkey fingerprint
                             $sub->{fpr} = $1;
-                            push @{$key{sub}}, $sub;
+                            push @{$key{sub}}, $sub # ignore unusable subkeys
+                                unless $sub->{validity} =~ /[eir]/ or $sub->{caps} =~ /D/;
                         }
                         else {
                             # key fingerprint




More information about the Pgp-tools-commit mailing list