I have have been trying to set up passbolt. While following the guide on medium with the exception that am running PHP7.0 I have managed to got all the health checks green with the exception of one. The public key cannot be used to encrypt and sign a message
I have enabled debugging and the stackstace returns the following code:
public function authenticate(CakeRequest $request, CakeResponse $response) {
// Init gpg object and load server key
$this->_initKeyring();
$this->_response = &$response;
I checked phpinfo and i have the following lines listed:
gnupg:
gnupg support => enabled
GPGme Version => 1.6.0
Extension Version => 1.4.0
While logged in as www-data (yes bad but just for debugging) Am able to list all pgp keys and sign files.
The server is a Ubuntu 16.04
PHP 7.0.22
mysql 5.7
passbolt version cloned yesterday
Checklist
[ X ] I have read intro post: About the Installation Issues category
[ X ] I have read the tutorials, help and searched for similar issues
[ X ] I provide relevant information about my server (component names and versions, etc.)
[ X ] I provide a copy of my logs and healthcheck
[ X ] I describe the steps I have taken to trouble shoot the problem
[ X ] I describe the steps on how to reproduce the issue
Am no hero in php but this is what i came up with:
<?php
// Enter your .gnupg environment
putenv('GNUPGHOME=/var/www/.gnupg/');
error_reporting(E_ALL);
$res = gnupg_init();
echo "kmek";
gnupg_addencryptkey($res,"1D2757F6764AA8A68EE96008651FBE12F7A623EC");
gnupg_addsignkey($res,"1D2757F6764AA8A68EE96008651FBE12F7A623EC","");
$enc = gnupg_encryptsign($res, "just a test");
echo $enc;
echo "kmek";
?>
Output is: kmekkmek
Which means $enc is empty. The only thing I wasn’t sure about is the “,”"); As there is no passphrase as per documentation I believe this is correct. No errors or stacktraces tho…
To my knowledge php-gnupg uses gnupg version 1, so it shouldn’t be an issue.
Do you get any error when doing the encrypt/ sign directly from command line?
At that point if you don’t get any error, i’m not sure what’s going on. Maybe it could be an oddity with your key, maybe an issue with php-gnupg on your particular setup. Hard to tell without error messages…
Well importing the key into pgp2 solved the problem. However I then ran into https://github.com/passbolt/passbolt_api/issues/100
I spent some time debugging it but got annoyed. Deleted the whole passbolt directory and .gnupg directorys and started from scratch. With success I now have an instance running still clueless what i facked up the first time.