Subject: | use_agent still broken |
Date: | Wed, 16 Jul 2014 17:31:12 +0200 |
To: | bug-Mail-GnuPG [...] rt.cpan.org |
From: | Robert Sachunsky <robert.schubert [...] mathint.com> |
Dear maintainer,
it seems the option use_agent _still_ fails with Mail::GnuPG v. 19:
t/agent.t ................ 1/?
# Failed test at t/agent.t line 78.
# got: '0'
# expected: '2'
# Failed test at t/agent.t line 81.
# got: '0'
# expected: '2'
# Failed test at t/agent.t line 82.
# got: 'EFEA4EAD'
# expected: undef
# Failed test at t/agent.t line 83.
# got: 'Mail::GnuPG Test Key <mail@gnupg.dom>'
# expected: undef
# Failed test at t/agent.t line 92.
# got: '0'
# expected: '2'
Unknown Content-Type or no PGP message in body at
/root/.cpan/build/Mail-GnuPG-0.19-vA0Gug/blib/lib/Mail/GnuPG.pm line 400.
# Looks like you planned 20 tests but ran 8.
# Looks like you failed 5 tests of 8 run.
# Looks like your test exited with 32 just after 8.
t/agent.t ................ Dubious, test returned 32 (wstat 8192, 0x2000)
Trying this with a test of my own, I found out the following:
- gpg-agent gets called, but with CLEAR_PASSPHRASE instead of GET_PASSPHRASE
- gpg uses the (empty) default passphrase sent to it via separate FD,
which it reports as wrong (exit code 2)
This can be fixed by changing GnuPG.pm such that if use_agent was set,
GnuPG::Interface will not receive an IO::Handle for the passphrase
(hence in turn gpg will not be called with --passphrase-fd), as in the
patch attached below.
With this change, the agent test eventually succeeds (under an English
locale). However, agent.t itself should be fixed as well, in order to:
- get more sensible test output when errors do occur (as exptected vs
measured output are reversed in the test)
- get a correct result on systems with a non-English locale
To that end, I also provided a patch.
Hope this helps.
Regards,
Robert
--
My system is a openSUSE 12.3 (i386 GNU/Linux 3.7.10, perl v5.16.2,
GnuPG::Interface v0.50). All GnuPG::Interface tests were successful.
Message body is not shown because sender requested not to inline it.
Message body is not shown because sender requested not to inline it.
Message body not shown because it is not plain text.