Bug #17822 [Opn]: Missing keyId in KeyNotFoundException for decryption/verify process
| From: | alec at alec dot pl | Date: | Thu, 26 Aug 2010 11:06:05 +0000 |
| Subject: | Bug #17822 [Opn]: Missing keyId in KeyNotFoundException for decryption/verify process | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-4686@lists.php.net to get a copy of this message | ||
Edit report at http://pear.php.net/bugs/bug.php?id=17822&edit=1
ID: 17822
Updated by: alec@alec.pl
Reported By: alec at alec dot pl
-Summary: Missing keyId in KeyNotFoundException for decryption
process
+Summary: Missing keyId in KeyNotFoundException for
decryption/verify process
Status: Open
Type: Bug
Package: Crypt_GPG
Package Version: SVN
PHP Version: Irrelevant
Roadmap Versions:
New Comment:
-Summary: Missing keyId in KeyNotFoundException for decryption
process
+Summary: Missing keyId in KeyNotFoundException for
decryption/verify process
This patch is for decryption. I've found that key Id is also not set on
verification. E.g. when there's no public key I got such responses:
ERROR: gpg: Signature made Mon Aug 10 01:50:14 2009 CEST using DSA key
ID B459AB58
ERROR: gpg: Can't check signature: No public key
STATUS: ERRSIG 6BEFD4D6B459AB58 17 2 01 1249861814 9
STATUS: NO_PUBKEY 6BEFD4D6B459AB58
Previous Comments:
------------------------------------------------------------------------
[2010-08-26 10:23:48] alec
Description:
------------
When decryption fails because of lack of private key its ID is not set
in exception object. Simple fix:
--- DecryptStatusHandler.old 2010-08-26 11:16:31.000000000 +0200
+++ DecryptStatusHandler.php 2010-08-26 12:21:30.365249721 +0200
@@ -288,7 +288,7 @@
throw new Crypt_GPG_KeyNotFoundException(
'Cannot decrypt data. No suitable private key is in the
' .
'keyring. Import a suitable private key before trying
to ' .
- 'decrypt this data.', $code);
+ 'decrypt this data.', $code, $this->currentSubKeyId);
case Crypt_GPG::ERROR_BAD_PASSPHRASE:
$badPassphrases = array_diff_key(
------------------------------------------------------------------------
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=17822&edit=1