summaryrefslogtreecommitdiff
path: root/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0008-fix-test_default_key_passphrase-when-passphrase-come.patch
blob: 5ae938325ff180ece57d2526f5c19bbe18cbc433 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Date: Tue, 13 Sep 2016 15:22:27 -0400
Subject: fix test_default_key_passphrase when passphrase comes from agent

In the modern GnuPG suite, where the passphrase is always managed by
the agent, gpg itself doesn't emit the GOOD_PASSPHRASE status.
Instead, if signing is successful it emits plain old SIG_CREATED.

There are probably even better ways to test whether a given key is
unlocked in this case, but this is a straightforward baseline fix that
should get this part of the test suite to pass with all available
versions of GnuPG.
---
 lib/GnuPG/Interface.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/GnuPG/Interface.pm b/lib/GnuPG/Interface.pm
index 83a4b1a..1f1e6d5 100644
--- a/lib/GnuPG/Interface.pm
+++ b/lib/GnuPG/Interface.pm
@@ -808,7 +808,7 @@ sub test_default_key_passphrase() {
 
     # all we realy want to check is the status fh
     while (<$status>) {
-        if (/^\[GNUPG:\]\s*GOOD_PASSPHRASE/) {
+        if (/^\[GNUPG:\]\s*(GOOD_PASSPHRASE|SIG_CREATED)/) {
             waitpid $pid, 0;
             return 1;
         }