Package: libgnupg-interface-perl

the --fixed-list-mode option for gpg is designed for cleaner/simpler
machine-parseable output:

 
http://www.gnupg.org/documentation/manuals/gnupg-devel/GPG-Input-and-Output.html#index-fixed_002dlist_002dmode-178

> Do not merge primary user ID and primary key in --with-colon listing
> mode and print all timestamps as seconds since 1970-01-01. 

As of version 2.0.10 (Jan 2009), gpg2 uses --fixed-list-mode by default:

  http://lists.gnupg.org/pipermail/gnupg-announce/2009q1/000284.html

As a consequence, using gpg2 with GnuPG::Interface produces an extra
GnuPG::UserID object on each key with an empty string and no signatures.
 Worse, this empty User ID inherits the validity of the key itself,
which is the highest validity of any other User ID.

As a result, every key that has a fully-valid User ID appears to also
have a full-valid User ID (albeit one with no signatures) of "".

The attached patch enforces the use of --fixed-list-mode (so both gpg 1
and gpg 2 will behave in the same way) and cleans up the creation of the
mistaken initial empty User ID.

Thanks for GnuPG::Interface!

        --dkg
--- a/lib/GnuPG/Interface.pm
+++ b/lib/GnuPG/Interface.pm
@@ -378,6 +378,7 @@
     $self->options($new_options);
     $self->options->push_extra_args(
         '--with-colons',
+        '--fixed-list-mode',
         '--with-fingerprint',
         '--with-fingerprint',
     );
@@ -449,12 +450,6 @@
                 usage_flags            => $usage_flags,
             );
 
-            $current_signed_item = GnuPG::UserId->new(
-                validity  => $user_id_validity,
-                as_string => unescape_string($user_id_string),
-            );
-
-            $current_key->push_user_ids($current_signed_item);
         }
         elsif ( $record_type eq 'fpr' ) {
             my $hex = $fields[9];

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to