Skip Menu |

This queue is for tickets about the GnuPG-Interface CPAN distribution.

Report information
The Basics
Id: 57050
Status: resolved
Priority: 0/
Queue: GnuPG-Interface

People
Owner: Nobody in particular
Requestors: salvatore.bonaccorso [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: allow reporting of usage_flags on GnuPG::Key objects
Date: Thu, 29 Apr 2010 20:15:32 +0200
To: bug-GnuPG-Interface [...] rt.cpan.org
From: Salvatore Bonaccorso <salvatore.bonaccorso [...] gmail.com>
Hi In Debian Bugtracker, Daniel Kahn Gillmor posted the following request [1]. He also prepared a patch implementing this. Could you have a look, if you would like to add this? (I added the patch additionaly as file, as RT may garble the patch in mailtext). [I have not tested the patch yet]. [1] http://bugs.debian.org/579666 Bests Salvatore ----- Forwarded message from Daniel Kahn Gillmor <dkg@fifthhorseman.net> ----- From: Daniel Kahn Gillmor <dkg@fifthhorseman.net> Resent-From: Daniel Kahn Gillmor <dkg@fifthhorseman.net> Reply-To: Daniel Kahn Gillmor <dkg@fifthhorseman.net>, 579666@bugs.debian.org X-Mailer: reportbug 4.11 Date: Thu, 29 Apr 2010 13:51:52 -0400 To: Debian Bug Tracking System <submit@bugs.debian.org> Subject: Bug#579666: libgnupg-interface-perl: allow reporting of usage_flags on GnuPG::Key objects Package: libgnupg-interface-perl Version: 0.42-2 Severity: wishlist Tags: patch It would be nice to know the reported usage flags (encrypt, authenticate, sign, and certify) for each key from a listing of public keys. The attached patch adds (and populates) a usage_flags member for GnuPG::Key, and adds it to the test suite as well. --dkg -- System Information: Debian Release: squeeze/sid APT prefers testing APT policy: (500, 'testing'), (200, 'unstable'), (1, 'experimental') Architecture: i386 (i686) Kernel: Linux 2.6.32-4-686 (SMP w/1 CPU core) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages libgnupg-interface-perl depends on: ii gnupg 1.4.10-2 GNU privacy guard - a free PGP rep ii gnupg2 2.0.14-1 GNU privacy guard - a free PGP rep ii libany-moose-perl 0.12-1 module to use either Moose or Mous ii perl 5.10.1-12 Larry Wall's Practical Extraction libgnupg-interface-perl recommends no packages. libgnupg-interface-perl suggests no packages. -- no debconf information --- a/lib/GnuPG/Interface.pm +++ b/lib/GnuPG/Interface.pm @@ -417,7 +417,9 @@ my ( $user_id_validity, $key_length, $algo_num, $hex_key_id, $creation_date_string, $expiration_date_string, - $local_id, $owner_trust, $user_id_string + $local_id, $owner_trust, $user_id_string, + $sigclass, #unused + $usage_flags, ) = @fields[ 1 .. $#fields ]; @@ -431,6 +433,11 @@ ? GnuPG::PublicKey->new() : GnuPG::SecretKey->new(); + # only allow expected usage flags, and exclude uppercase + # letters (which refer to the entire key, rather than this + # one) + $usage_flags =~ s/[^ecsa]//g; + $current_key->hash_init( length => $key_length, algo_num => $algo_num, @@ -439,6 +446,7 @@ owner_trust => $owner_trust, creation_date_string => $creation_date_string, expiration_date_string => $expiration_date_string, + usage_flags => $usage_flags, ); $current_signed_item = GnuPG::UserId->new( --- a/lib/GnuPG/Key.pm +++ b/lib/GnuPG/Key.pm @@ -25,6 +25,7 @@ creation_date_string expiration_date_string fingerprint + usage_flags ) ] => ( isa => 'Any', --- a/t/get_public_keys.t +++ b/t/get_public_keys.t @@ -32,6 +32,7 @@ creation_date_string => '2000-02-06', expiration_date_string => '2002-02-05', owner_trust => 'f', + usage_flags => 'sc', ); $handmade_key->fingerprint @@ -65,6 +66,7 @@ hex_id => 'ADB99D9C2E854A6B', creation_date_string => '2000-02-06', expiration_date_string => '2002-02-05', + usage_flags => 'e', ); $subkey->fingerprint Show quoted text
_______________________________________________ pkg-perl-maintainers mailing list pkg-perl-maintainers@lists.alioth.debian.org http://lists.alioth.debian.org/mailman/listinfo/pkg-perl-maintainers
----- End forwarded message -----

Message body is not shown because sender requested not to inline it.

Download signature.asc
application/pgp-signature 835b

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #57050] allow reporting of usage_flags on GnuPG::Key objects
Date: Sat, 1 May 2010 10:55:20 -0400
To: Salvatore Bonaccorso via RT <bug-GnuPG-Interface [...] rt.cpan.org>
From: Jesse Vincent <jesse [...] fsck.com>
Is there any chance you could ask the author to add some documentation along with this code change? On Thu 29.Apr'10 at 14:15:47 -0400, Salvatore Bonaccorso via RT wrote: Show quoted text
> Thu Apr 29 14:15:46 2010: Request 57050 was acted upon. > Transaction: Ticket created by salvatore.bonaccorso@gmail.com > Queue: GnuPG-Interface > Subject: allow reporting of usage_flags on GnuPG::Key objects > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: salvatore.bonaccorso@gmail.com > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=57050 > > > > Hi > > In Debian Bugtracker, Daniel Kahn Gillmor posted the following request > [1]. He also prepared a patch implementing this. Could you have a > look, if you would like to add this? (I added the patch additionaly as > file, as RT may garble the patch in mailtext). [I have not tested the > patch yet]. > > [1] http://bugs.debian.org/579666 > > Bests > Salvatore > > ----- Forwarded message from Daniel Kahn Gillmor <dkg@fifthhorseman.net> ----- > > From: Daniel Kahn Gillmor <dkg@fifthhorseman.net> > Resent-From: Daniel Kahn Gillmor <dkg@fifthhorseman.net> > Reply-To: Daniel Kahn Gillmor <dkg@fifthhorseman.net>, > 579666@bugs.debian.org > X-Mailer: reportbug 4.11 > Date: Thu, 29 Apr 2010 13:51:52 -0400 > To: Debian Bug Tracking System <submit@bugs.debian.org> > Subject: Bug#579666: libgnupg-interface-perl: allow reporting of usage_flags > on GnuPG::Key objects > > Package: libgnupg-interface-perl > Version: 0.42-2 > Severity: wishlist > Tags: patch > > It would be nice to know the reported usage flags (encrypt, > authenticate, sign, and certify) for each key from a listing of public > keys. > > The attached patch adds (and populates) a usage_flags member for > GnuPG::Key, and adds it to the test suite as well. > > --dkg > > -- System Information: > Debian Release: squeeze/sid > APT prefers testing > APT policy: (500, 'testing'), (200, 'unstable'), (1, 'experimental') > Architecture: i386 (i686) > > Kernel: Linux 2.6.32-4-686 (SMP w/1 CPU core) > Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) > Shell: /bin/sh linked to /bin/bash > > Versions of packages libgnupg-interface-perl depends on: > ii gnupg 1.4.10-2 GNU privacy guard - a free PGP rep > ii gnupg2 2.0.14-1 GNU privacy guard - a free PGP rep > ii libany-moose-perl 0.12-1 module to use either Moose or Mous > ii perl 5.10.1-12 Larry Wall's Practical Extraction > > libgnupg-interface-perl recommends no packages. > > libgnupg-interface-perl suggests no packages. > > -- no debconf information > > --- a/lib/GnuPG/Interface.pm > +++ b/lib/GnuPG/Interface.pm > @@ -417,7 +417,9 @@ > my ( > $user_id_validity, $key_length, $algo_num, $hex_key_id, > $creation_date_string, $expiration_date_string, > - $local_id, $owner_trust, $user_id_string > + $local_id, $owner_trust, $user_id_string, > + $sigclass, #unused > + $usage_flags, > ) = @fields[ 1 .. $#fields ]; > > > @@ -431,6 +433,11 @@ > ? GnuPG::PublicKey->new() > : GnuPG::SecretKey->new(); > > + # only allow expected usage flags, and exclude uppercase > + # letters (which refer to the entire key, rather than this > + # one) > + $usage_flags =~ s/[^ecsa]//g; > + > $current_key->hash_init( > length => $key_length, > algo_num => $algo_num, > @@ -439,6 +446,7 @@ > owner_trust => $owner_trust, > creation_date_string => $creation_date_string, > expiration_date_string => $expiration_date_string, > + usage_flags => $usage_flags, > ); > > $current_signed_item = GnuPG::UserId->new( > --- a/lib/GnuPG/Key.pm > +++ b/lib/GnuPG/Key.pm > @@ -25,6 +25,7 @@ > creation_date_string > expiration_date_string > fingerprint > + usage_flags > ) > ] => ( > isa => 'Any', > --- a/t/get_public_keys.t > +++ b/t/get_public_keys.t > @@ -32,6 +32,7 @@ > creation_date_string => '2000-02-06', > expiration_date_string => '2002-02-05', > owner_trust => 'f', > + usage_flags => 'sc', > ); > > $handmade_key->fingerprint > @@ -65,6 +66,7 @@ > hex_id => 'ADB99D9C2E854A6B', > creation_date_string => '2000-02-06', > expiration_date_string => '2002-02-05', > + usage_flags => 'e', > ); > > $subkey->fingerprint > > _______________________________________________ > pkg-perl-maintainers mailing list > pkg-perl-maintainers@lists.alioth.debian.org > http://lists.alioth.debian.org/mailman/listinfo/pkg-perl-maintainers > > ----- End forwarded message ----- >
Show quoted text
> --- a/lib/GnuPG/Interface.pm > +++ b/lib/GnuPG/Interface.pm > @@ -417,7 +417,9 @@ > my ( > $user_id_validity, $key_length, $algo_num, $hex_key_id, > $creation_date_string, $expiration_date_string, > - $local_id, $owner_trust, $user_id_string > + $local_id, $owner_trust, $user_id_string, > + $sigclass, #unused > + $usage_flags, > ) = @fields[ 1 .. $#fields ]; > > > @@ -431,6 +433,11 @@ > ? GnuPG::PublicKey->new() > : GnuPG::SecretKey->new(); > > + # only allow expected usage flags, and exclude uppercase > + # letters (which refer to the entire key, rather than this > + # one) > + $usage_flags =~ s/[^ecsa]//g; > + > $current_key->hash_init( > length => $key_length, > algo_num => $algo_num, > @@ -439,6 +446,7 @@ > owner_trust => $owner_trust, > creation_date_string => $creation_date_string, > expiration_date_string => $expiration_date_string, > + usage_flags => $usage_flags, > ); > > $current_signed_item = GnuPG::UserId->new( > --- a/lib/GnuPG/Key.pm > +++ b/lib/GnuPG/Key.pm > @@ -25,6 +25,7 @@ > creation_date_string > expiration_date_string > fingerprint > + usage_flags > ) > ] => ( > isa => 'Any', > --- a/t/get_public_keys.t > +++ b/t/get_public_keys.t > @@ -32,6 +32,7 @@ > creation_date_string => '2000-02-06', > expiration_date_string => '2002-02-05', > owner_trust => 'f', > + usage_flags => 'sc', > ); > > $handmade_key->fingerprint > @@ -65,6 +66,7 @@ > hex_id => 'ADB99D9C2E854A6B', > creation_date_string => '2000-02-06', > expiration_date_string => '2002-02-05', > + usage_flags => 'e', > ); > > $subkey->fingerprint
CC: 579666 [...] bugs.debian.org
Subject: Re: Bug#579666: [rt.cpan.org #57050] allow reporting of usage_flags on GnuPG::Key objects
Date: Sat, 01 May 2010 13:58:37 -0400
To: bug-GnuPG-Interface [...] rt.cpan.org
From: Daniel Kahn Gillmor <dkg [...] fifthhorseman.net>
On 05/01/2010 11:35 AM, Salvatore Bonaccorso wrote: Show quoted text
> Jesse asks if you could provide too some documentation along with your > proposed change to allow repoting of usage_flags on GnuPG::Key > objects.
Attached is an updated patch that includes documentation, imports usage flags for subkeys also, and actually includes usage_flags in the test suite properly. With this version of the patch, I also decided to not filter gpg's reported usage flags, passing them through raw to the user of GnuPG::Interface. i think this kind of transparency is more in keeping with the rest of the interface, and easy enough for the caller to deal with. I think the patch is stable now. Please let me know if you need anything else. --dkg

Message body is not shown because sender requested not to inline it.

Download signature.asc
application/pgp-signature 892b

Message body not shown because it is not plain text.

CC: 579666 [...] bugs.debian.org
Subject: Bug#579666: [rt.cpan.org #57050] allow reporting of usage_flags on GnuPG::Key objects
Date: Sat, 01 May 2010 14:44:16 -0400
To: bug-GnuPG-Interface [...] rt.cpan.org
From: Daniel Kahn Gillmor <dkg [...] fifthhorseman.net>
Sigh. One last draft of the patch to add usage_flags to GnuPG::Interface. This one fixes t/get_secret_keys.t, which accidentally didn't make it into the last revision. Sorry for the extra noise. --dkg

Message body is not shown because sender requested not to inline it.

Download signature.asc
application/pgp-signature 892b

Message body not shown because it is not plain text.

Subject: Re: Bug#579666: [rt.cpan.org #57050] allow reporting of usage_flags on GnuPG::Key objects
Date: Sat, 8 May 2010 17:27:44 -0400
To: Daniel Kahn Gillmor via RT <bug-GnuPG-Interface [...] rt.cpan.org>
From: Jesse Vincent <jesse [...] fsck.com>
On Sat, May 01, 2010 at 02:44:36PM -0400, Daniel Kahn Gillmor via RT wrote: Show quoted text
> Queue: GnuPG-Interface > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=57050 > > > Sigh. One last draft of the patch to add usage_flags to > GnuPG::Interface. This one fixes t/get_secret_keys.t, which > accidentally didn't make it into the last revision. > > Sorry for the extra noise.
No worries. Thanks. Applied.