Skip Menu |

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

Report information
The Basics
Id: 87553
Status: resolved
Priority: 0/
Queue: Mail-GnuPG

People
Owner: Nobody in particular
Requestors: jamie [...] mayfirst.org
Cc:
AdminCc:

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



Subject: Mail::GnuPG bug report: parsing of verify results
Date: Fri, 2 Aug 2013 12:13:20 -0400
To: bug-Mail-GnuPG [...] rt.cpan.org
From: Jamie McClelland <jamie [...] mayfirst.org>
Hi - thanks for the Mail::GnuPG perl library! I had trouble with getting proper results when running the verify function that seem caused by an improper regular expression. There's a comment in the code: # FIXME: these regex are likely to break under non english locales. Which is true... I've attached a simple patch that should preserve backward compatibility. It returns the entire result of the verify command so that the calling script can handle parsing, dealing with locales, etc. I hope you find it useful. jamie diff --git a/GnuPG.pm b/GnuPG.pm index 3a1d224..6aa8750 100644 --- a/GnuPG.pm +++ b/GnuPG.pm @@ -220,7 +220,7 @@ sub decrypt { my ($keyid) = $result =~ /using \S+ key ID (.+)$/m; my ($pemail) = $result =~ /Good signature from "(.+)"$/m; - return ($exit_value,$keyid,$pemail); + return ($exit_value,$keyid,$pemail,$result); } @@ -460,7 +460,7 @@ sub verify { my ($pemail) = $result =~ /Good signature from "(.+)"$/m; - return ($exit_value,$keyid,$pemail); + return ($exit_value,$keyid,$pemail,$result); } -- Jamie McClelland May First/People Link Growing networks to build a just world http://www.mayfirst.org https://support.mayfirst.org OpenPGP Key: http://current.workingdirectory.net/pages/identity/
Download signature.asc
application/pgp-signature 836b

Message body not shown because it is not plain text.

The regexes in question are no longer used as of version 0.20, so hopefully this patch is obsolete.