travisghansen / phpgpg

Support PGP operations in PHP
9 stars 4 forks source link

Updated the GpgMe driver to send required passphrase field through to… #4

Closed hppycoder closed 8 years ago

hppycoder commented 8 years ago

GnuPG requires addDecryptKey to have the signature (Resource, Fingerprint, Passphrase). It was failing to be add based on sending a Key to the method.

travisghansen commented 8 years ago

@hppycoder does that actually work for you? I could never seem to get that to work and even asked the developer of the pecl extension to tweak things if I recall.

What versions of everything are you running? OS? PHP Version? version of the PHP extension? version of GPG and gpgme installed on the OS etc?

Thanks! I'll for sure pull this in, just want to put together some tests maybe and see if I can get it to work.

hppycoder commented 8 years ago

Yes, this does work for us. The documentation states that it's a required parameter: http://php.net/manual/en/function.gnupg-adddecryptkey.php

[Symfony\Component\Debug\Exception\ContextErrorException]
Warning: gnupg::adddecryptkey() expects exactly 2 parameters, 1 given

PHP Version: 5.3.3 php-pecl-ssh2-0.11.0-7.el6.x86_64

This PR covers passing through the passphrase and it worked for our setup. Considering it's a required property on the function according to PHP I think it's safe to merge.

travisghansen commented 8 years ago

@hppycoder I've pushed a new tag as well for usage with composer.