php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58260 problem importing key using gnupg-pecl
Submitted: 2008-07-01 15:12 UTC Modified: 2012-02-21 18:27 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: legare at uqtr dot ca Assigned:
Status: Not a bug Package: gnupg (PECL)
PHP Version: 4.3.2 OS: rhel 3.0as kernel 2.4.21-57-smp
Private report: No CVE-ID: None
 [2008-07-01 15:12 UTC] legare at uqtr dot ca
Description:
------------
I've configured/compiled and installed gnupg 1.4.9, gpgme 1.1.4, libassuan 1.0.4, libgcrypt 1.4.1, libgpg-error 1.6, libksba 1.0.3 and pth 2.0.7.  I'm using a bundled RPM of PHP 4.3.2 on a 32 bits linux box. I've phpized and compiled successfully other php modules in the past.


I then downloaded gnupg (pecl) 1.3.1, phpize and compiled this way :

export CFLAGS=-I/p/gnupg/include
export LDFLAGS=-L/p/gnupg/lib

./configure --with-gnupg=/p/gnupg/include

make

copied and chmod the gnupg.so file in my /usr/lib/php4, edited php.ini...  restarted apache...

phpinfo() shows gnupgme and gnupg versions as expected.

My php script displays the following error message :

Warning: gnupg_import(): import failed in /web/gemoms/gpg.php on line 39

The key was exported with "gpg --export --armor USER" command.

Is there a way to have more debugging output to learn what failed into the import process ? I'm a little puzzled as to know what's failing.

Reproduce code:
---------------
<?
   $keydata =<<<EOF
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.9 (GNU/Linux)
[skipped]
-----END PGP PUBLIC KEY BLOCK-----
EOF;

   error_reporting(E_ALL);

   if(! $gpg = gnupg_init())
      echo "error gnupg_init()";


   gnupg_seterrormode($gpg, GNUPG_ERROR_WARNING);
   if(!gnupg_setarmor($gpg, true))
      print gnupg_geterror($gpg);

   if(! $info = gnupg_import($gpg, $keydata))
      print gnupg_geterror($gpg);
   else
      var_dump($info);

?>



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-07-02 09:48 UTC] legare at uqtr dot ca
I still don't know what was wrong, but I installed the packages on another server running RHEL 5.2 with php 5.1.6 it everything works fine.
 [2012-02-21 18:27 UTC] rasmus@php.net
-Status: Open +Status: Not a bug
 [2012-02-21 18:27 UTC] rasmus@php.net
This seems to work fine.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 05:01:29 2024 UTC