Skip Menu |

This queue is for tickets about the Crypt-GPG CPAN distribution.

Report information
The Basics
Id: 14848
Status: resolved
Priority: 0/
Queue: Crypt-GPG

People
Owner: AGUL [...] cpan.org
Requestors: tl [...] onlyshallow.com
Cc:
AdminCc:

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



Subject: decrypt method fails because of secret key handling
I have been unable to decrypt and I haven't found anything on the web explaining usage (other than the man page, in which the usage is unclear). I finally diagnosed the problem. It turns out that another user (dmorel) reported this as part of 13563. I wanted to call it out a bit and offer a slightly different fix. Line 176 of GPG.pm contains: if ($2 eq $self->{SECRETKEY}->{ID}) { This should be changed to $my seckey = ref($self->{SECRETKEY}) ? $self->{SECRETKEY}->{ID} : $self->{SECRETKEY}; if ($2 eq $seckey)) { This will allow the routine to function in the previous mode (assuming it is still valid), while supporting the usage that I am employing. An example of my usage follows: my $gpg = new Crypt::GPG; $gpg->secretkey('462992BD1262EC19'); $gpg->passphrase('abc'); my $plaintext = $gpg->gpg->decrypt(\@lines); The @lines array contains the encrypted message (i.e., '-----BEGIN PGP MESSAGE-----' ...). It doesn't look like this module has seen any changes lately. I hope Mr. Gulhati has some time to look at these bugs. If I'm misusing the interface, I'd like to know. In the meantime, perhaps this workaround can help someone else. I'm using gpg version 1.4.1.
From: dan_new_2001 [...] yahoo.de
Show quoted text
> ... > This should be changed to > $my seckey = ref($self->{SECRETKEY}) ? $self->{SECRETKEY}->{ID} : > $self->{SECRETKEY}; > if ($2 eq $seckey)) { >
Unfortunatly I have the same error. Thanks for the workaround. There are just two type errors: my $seckey = ref($self->{SECRETKEY}) ? $self->{SECRETKEY}->{ID} : $self->{SECRETKEY}; if ($2 eq $seckey) { Regards, Dan.
From: robertojimenoca [...] terra.es
The bug should be closed as the problem does not exist anymore in the latest Crypt::GPG release.
Fixed in 1.61