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

Bug #21083 Useless gpg-agent initialization
Submitted: 2016-06-17 13:28 UTC
From: alec Assigned:
Status: Wont fix Package: Crypt_GPG (version 1.4.1)
PHP Version: Irrelevant OS:
Roadmaps: 1.4.3    
Subscription  


 [2016-06-17 13:28 UTC] alec (Aleksander Machniak)
Description: ------------ When using GnuPG 2.x we call gpg-agent binary for every gpg operation except when we check the version. I think it is needed only for signing and decrypting. With this patch all tests pass: --- a/Crypt/GPG/Engine.php +++ b/Crypt/GPG/Engine.php @@ -1619,7 +1619,9 @@ class Crypt_GPG_Engine $env['LC_ALL'] = 'C'; // If using GnuPG 2.x start the gpg-agent - if (version_compare($version, '2.0.0', 'ge')) { + if (version_compare($version, '2.0.0', 'ge') + && preg_match('/--(sign|clearsign|detach-sign|decrypt)( |$)/', $this->_operation) + ) { if (!$this->_agent) { throw new Crypt_GPG_OpenSubprocessException( 'Unable to open gpg-agent subprocess (gpg-agent not found). ' .

Comments

 [2016-09-23 15:55 UTC] alec (Aleksander Machniak)
-Status: Open +Status: Wont fix
In GnuPG 2.1: - gpg-agent is invoked for any operation with use of secret key (including import/export) - gpg-agent is started automatically by gpg So, I think we can ignore this.