CC: | guthrie [...] counterexample.org |
Subject: | Documentation incorrect for verify() |
Date: | Wed, 18 Feb 2009 02:51:57 -0500 |
To: | bug-Crypt-GPG [...] rt.cpan.org |
From: | "John T. Guthrie III" <guthrie [...] counterexample.org> |
The documentation states that the verify() method can take either a single
argument which is an arrayref containing an encrypted message or two
arguments, one of which is an arrayref containing a message, and the other a
detached signature. It is shown in the documentation as follows:
verify(\@message, [\@signature])
This seems to imply, that in the two argument version the signature should be
the second argument. However, at line 157 of GPG.pm, we have the line:
my $message = ref($_[1]) ? join '', @{$_[1]} : $_[1];
which seems to be taking the message from the second argument, not the first.
Moreover, the verify function just does not work if I follow the documentation,
but it does work if I reverse the arguments. This would suggest that the
documentation should read:
verify([\@signature,] \@message)
or the code needs to be fixed to have the message and signature go to the
correct temporary files when there are two arguments.
--
John Guthrie