Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.6.9

Bug #17512 addDecryptKey
Submitted: 2010-06-22 16:52 UTC
From: lampacz Assigned: gauthierm
Status: Closed Package: Crypt_GPG (version 1.1.1)
PHP Version: 5.3.2 OS: Debian
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 35 + 49 = ?

 
 [2010-06-22 16:52 UTC] lampacz (Michal Dvoracek)
Description: ------------ exception when add decrypt key Test script: --------------- require_once('Crypt/GPG.php'); $oGPG = new Crypt_GPG(array('homedir' => '/home/www/xxx/.pgp', 'debug' => true)); $oGPG->addDecryptKey('0x70967B70', 'pass'); Expected result: ---------------- no error Actual result: -------------- Crypt_GPG DEBUG: OPENING SUBPROCESS WITH THE FOLLOWING COMMAND: Crypt_GPG DEBUG: /usr/bin/gpg --status-fd '3' --command-fd '4' --no-secmem-warning --no-tty --no-default-keyring --no-options --always-trust --homedir '/home/www/xxx/.pgp' --version Crypt_GPG DEBUG: BEGIN PROCESSING Crypt_GPG DEBUG: selecting streams Crypt_GPG DEBUG: => got 1 Crypt_GPG DEBUG: GPG output stream ready for reading Crypt_GPG DEBUG: => about to read 8192 bytes from GPG output Crypt_GPG DEBUG: => read 583 bytes Crypt_GPG DEBUG: selecting streams Crypt_GPG DEBUG: => got 1 Crypt_GPG DEBUG: GPG output stream ready for reading Crypt_GPG DEBUG: => about to read 8192 bytes from GPG output Crypt_GPG DEBUG: => read 0 bytes Crypt_GPG DEBUG: selecting streams Crypt_GPG DEBUG: => got 1 Crypt_GPG DEBUG: GPG error stream ready for reading Crypt_GPG DEBUG: => about to read 8192 bytes from GPG error Crypt_GPG DEBUG: => read 0 bytes Crypt_GPG DEBUG: selecting streams Crypt_GPG DEBUG: => got 1 Crypt_GPG DEBUG: GPG status stream ready for reading Crypt_GPG DEBUG: => about to read 8192 bytes from GPG status Crypt_GPG DEBUG: => read 0 bytes Crypt_GPG DEBUG: END PROCESSING Crypt_GPG DEBUG: CLOSING SUBPROCESS Crypt_GPG DEBUG: OPENING SUBPROCESS WITH THE FOLLOWING COMMAND: Crypt_GPG DEBUG: /usr/bin/gpg --status-fd '3' --command-fd '4' --no-secmem-warning --no-tty --no-default-keyring --no-options --no-use-agent --no-permission-warning --exit-on-status-write-error --trust-model always --with-colons --with-fingerprint --with-fingerprint --fixed-list-mode --homedir '/home/www/xxx/.pgp' --list-secret-keys '0x70967B70' Crypt_GPG DEBUG: BEGIN PROCESSING Crypt_GPG DEBUG: selecting streams Crypt_GPG DEBUG: => got 1 Crypt_GPG DEBUG: GPG error stream ready for reading Crypt_GPG DEBUG: => about to read 8192 bytes from GPG error Crypt_GPG DEBUG: => read 5 bytes Crypt_GPG DEBUG: selecting streams Crypt_GPG DEBUG: => got 1 Crypt_GPG DEBUG: GPG error stream ready for reading Crypt_GPG DEBUG: => about to read 8192 bytes from GPG error Crypt_GPG DEBUG: => read 62 bytes Crypt_GPG DEBUG: ERROR: gpg: can't open `/home/www/xxx/.pgp/secring.gpg' Crypt_GPG DEBUG: selecting streams Crypt_GPG DEBUG: => got 3 Crypt_GPG DEBUG: GPG output stream ready for reading Crypt_GPG DEBUG: => about to read 8192 bytes from GPG output Crypt_GPG DEBUG: => read 0 bytes Crypt_GPG DEBUG: GPG error stream ready for reading Crypt_GPG DEBUG: => about to read 8192 bytes from GPG error Crypt_GPG DEBUG: => read 82 bytes Crypt_GPG DEBUG: ERROR: gpg: keydb_search failed: file open error Crypt_GPG DEBUG: ERROR: gpg: error reading key: file open error Crypt_GPG DEBUG: GPG status stream ready for reading Crypt_GPG DEBUG: => about to read 8192 bytes from GPG status Crypt_GPG DEBUG: => read 0 bytes Crypt_GPG DEBUG: selecting streams Crypt_GPG DEBUG: => got 1 Crypt_GPG DEBUG: GPG error stream ready for reading Crypt_GPG DEBUG: => about to read 8192 bytes from GPG error Crypt_GPG DEBUG: => read 0 bytes Crypt_GPG DEBUG: END PROCESSING Crypt_GPG DEBUG: CLOSING SUBPROCESS Crypt_GPG DEBUG: => subprocess returned an unexpected exit code: 2 Fatal error: Uncaught Crypt_GPG_Exception: Unknown error getting keys. Please use the 'debug' option when creating the Crypt_GPG object, and file a bug report at http://pear.php.net/bugs/report.php?package=Crypt_GPG in /usr/share/php/Crypt/GPG.php on line 1672 Exception trace # Function Location 0 Crypt_GPG->getKeys('0x70967B70') /usr/share/php/Crypt/GPG.php:1672 1 Crypt_GPG->_addKey(Array, true, false, '0x70967B70', 'pass') /usr/share/ph in /usr/share/php/Crypt/GPG.php on line 732 first command without fd: /usr/bin/gpg --no-secmem-warning --no-tty --no-default-keyring --no-options --always-trust --no-permission-warning --homedir '/home/www/xxx/.pgp' --version gpg (GnuPG) 1.4.10 Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Home: /home/www/xxx/.pgp Supported algorithms: Pubkey: RSA, RSA-E, RSA-S, ELG-E, DSA Cipher: 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH, CAMELLIA128, CAMELLIA192, CAMELLIA256 Hash: MD5, SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224 Compression: Uncompressed, ZIP, ZLIB, BZIP2 first command without fd: /usr/bin/gpg --no-secmem-warning --no-tty --no-default-keyring --no-options --no-use-agent --no-permission-warning --exit-on-status-write-error --trust-model always --with-colons --with-fingerprint --with-fingerprint --fixed-list-mode --homedir '/home/www/xxx/.pgp' --list-secret-keys '0x70967B70' sec::1024:17:E639124A70967B70:1267428644::::::scaESCA:::: fpr:::::::::88A4A272C0848AB366E1BEC5E639124A70967B70: uid:::::1277204528::BEF7CE7FBCCEF2CDD636454B3383C3D187D548D5::xxx - xxxx <xxx@xxx.xxx>: ssb::2048:16:5F7FA26CB8059B49:1267428644::::::e:::: fpr:::::::::AB2C682E4D2AEAB6A12386315F7FA26CB8059B49:

Comments

 [2010-08-20 11:33 UTC] alec (Aleksander Machniak)
ERROR: gpg: can't open `/home/www/xxx/.pgp/secring.gpg' For me this looks like an access rights issue.
 [2010-08-20 19:01 UTC] gauthierm (Michael Gauthier)
I am able to reproduce this by using a homedir that is readable by Apache containing keyring files not readable by Apache. I will add better error handling for this situation.
 [2010-08-20 19:46 UTC] gauthierm (Michael Gauthier)
-Status: Open +Status: Closed -Assigned To: +Assigned To: gauthierm
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. Better error handling added in revision 302563. http://svn.php.net/viewvc?view=revision&revision=302563