[#14014] Add support for GnuPG 2.1 API and/or gnupg extension
Summary Add support for GnuPG 2.1 API and/or gnupg extension
Queue IMP
Queue Version Git master
Type Enhancement
State Feedback
Priority 1. Low
Owners
Requester software-horde@interfasys.ch
Created 2015-06-13 (1638 days ago)
Due
Updated 2017-04-19 (962 days ago)
Assigned
Resolved
Milestone
Patch No

Comments
software-horde@interfasys.ch 2015-06-13 17:43:00
I can't store the PGP passphrase.
I've noticed that before storing the passphrase IMP is performing a 
test and maybe something isn't working in the library since the 
phpunit tests are failing.

There were 2 errors:

1) Horde_Crypt_PgpTest::testPgpDecrypt
Horde_Crypt_Exception: Could not decrypt PGP data: gpg: decryption 
failed: No secret key

/usr/local/php55/lib/php/Horde/Crypt/Pgp.php:1153
/usr/local/php55/lib/php/Horde/Crypt/Pgp.php:866
/usr/local/php55/lib/php/test/Horde_Crypt/Horde/Crypt/PgpTest.php:74
/usr/local/php55/lib/php/Horde/Test/AllTests.php:84

2) Horde_Crypt_PgpTest::testPgpSign
file_get_contents(/tmp/1am9erx6/horde-pgp5kHzka): failed to open 
stream: No such file or directory

/usr/local/php55/lib/php/Horde/Crypt/Pgp.php:1504
/usr/local/php55/lib/php/Horde/Crypt/Pgp.php:1077
/usr/local/php55/lib/php/Horde/Crypt/Pgp.php:842
/usr/local/php55/lib/php/test/Horde_Crypt/Horde/Crypt/PgpTest.php:430
/usr/local/php55/lib/php/Horde/Test/AllTests.php:84

--

There was 1 failure:

1) Horde_Crypt_PgpTest::testVerifyPassphrase
Failed asserting that false is true.

/usr/local/php55/lib/php/test/Horde_Crypt/Horde/Crypt/PgpTest.php:520
/usr/local/php55/lib/php/Horde/Test/AllTests.php:84

software-horde@interfasys.ch 2015-06-13 18:03:43
Reading through the commits, it seems GnuPG 2.1 is not supported yet 
and that the gnupg PECL extension will be required.

If that's the case, I think the pgp section of the Horde config should 
let users know.

user66@arcor.de 2015-06-19 09:45:02
I can confirm this bug.

After upgrading my Linux distribution, which upgraded GnuPG from 
2.0.26 to 2.1.4, I can't sign and decrypt E-Mails using PGP any more. 
The GUI always tells me that the password (for the private key) is 
wrong.

So, it really seems that GnuPG 2.1.x does not work with Horde 5.

Michael Slusarz <slusarz@horde.org> 2015-07-15 06:37:00
This has been known for ages now, and is the reason why I started to 
write the Horde_Pgp library.

Unfortunately, someone will need to finish that work since I don't 
have the time to finish.

mike.gabriel@das-netzwerkteam.de 2017-02-10 17:41:52
Hi Jan,

> This has been known for ages now, and is the reason why I started to 
> write the Horde_Pgp library.
>
> Unfortunately, someone will need to finish that work since I don't 
> have the time to finish.

I have sort-of latest Horde (from Debian testing/unstable) running with gpg2.

See https://bugs.debian.org/854819


math.parent@gmail.com 2017-04-18 21:10:18
This may fix this issue: <https://bugs.debian.org/849151>.

But this use short keyid format which is not recommended today.

math.parent@gmail.com 2017-04-18 21:46:56
DUP of #14548 ?

Git Commit <commits@lists.horde.org> 2017-04-19 12:14:32
Changes have been made in Git (master):

commit 040e5761b2e00f54fc55452a2de8b6163ea63546
Author: Jan Schneider <jan@horde.org>
Date:   Wed Apr 19 14:05:46 2017 +0200

     Support testing multiple PGP backends.

     Required for testing bug #14014.

  framework/Crypt/test/Horde/Crypt/Pgp/TestBase.php | 174 
+++++++++++++++-------
  1 file changed, 120 insertions(+), 54 deletions(-)

http://github.com/horde/horde/commit/040e5761b2e00f54fc55452a2de8b6163ea63546

Git Commit <commits@lists.horde.org> 2017-04-19 12:14:33
Changes have been made in Git (master):

commit 7857060cc9bc6f067886cf5e949c79fa7cb095c3
Author: Jan Schneider <jan@horde.org>
Date:   Wed Apr 19 14:12:40 2017 +0200

     Test GnuPG 2 too (Bug #14014).

  .travis.yml                                         | 1 +
  framework/Crypt/test/Horde/Crypt/Pgp/BinaryTest.php | 7 ++++++-
  framework/Crypt/test/Horde/Crypt/conf.php.dist      | 1 +
  3 files changed, 8 insertions(+), 1 deletion(-)

http://github.com/horde/horde/commit/7857060cc9bc6f067886cf5e949c79fa7cb095c3

Git Commit <commits@lists.horde.org> 2017-04-19 12:14:33
Changes have been made in Git (master):

commit 12b0b389efc81d525ca0d0da8b4a4b4b4bab3d5a
Author: Jan Schneider <jan@horde.org>
Date:   Wed Apr 19 14:13:30 2017 +0200

     [jan] Support GnuPG 2.1+ too (Bug #14014).

  framework/Crypt/lib/Horde/Crypt/Pgp/Backend/Binary.php | 11 +++++++++++
  framework/Crypt/package.xml                            |  4 ++--
  2 files changed, 13 insertions(+), 2 deletions(-)

http://github.com/horde/horde/commit/12b0b389efc81d525ca0d0da8b4a4b4b4bab3d5a

Jan Schneider <jan@horde.org> 2017-04-19 12:16:11
Neither the GPG_TTY or the '--keyid-format short' seemed to have been 
necessary in my tests on Ubuntu 16.04 LTS, so I left them out for now. 
I had to explicitly allow the loopback pinentry in gpg-agent.conf 
though.