Ubuntu Pastebin

Paste from nacc at Thu, 22 Dec 2016 23:18:11 +0000

Download as text
 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Description: Update tests for gnupg2 changes
 The tests currently rely on gnupg1 formatted outputs, so pass
parameters to gnupg that . Additionally, it
 seems some new parameters are needed to get batch behavior correctly.
 Thanks to https://github.com/keybase/keybase-issues/issues/1712 for
 related, but not identical, issues and solution suggestions.
Author: Nishanth Aravamudan <nish.aravamudan@canonical.com>
Bug-Ubuntu: https://launchpad.net/bugs/1652133
Last-Update: 2016-12-22

--- a/Horde_Crypt-2.7.5/lib/Horde/Crypt/Pgp/Backend/Binary.php
+++ b/Horde_Crypt-2.7.5/lib/Horde/Crypt/Pgp/Backend/Binary.php
@@ -75,8 +75,15 @@
             '--no-options',
             '--no-default-keyring',
             '--yes',
-            '--homedir ' . $this->_tempdir
+            '--homedir ' . $this->_tempdir,
+            '--keyid-format short'
         );
+
+        $result = $this->_callGpg(array('--version'), 'r', null, false, false, true);
+        /* gpg > 1.x requires specifying the pinentry-mode */
+        if (!preg_match('/gpg \(GnuPG\) = (1\.[0-9\.]+)/', $result->stdout, $m)) {
+           $this->_gnupg[] = '--pinentry-mode loopback';
+        }
     }
 
     /**
@@ -678,6 +685,7 @@
         if ($parseable) {
             putenv('LANGUAGE=C');
         }
+        putenv('GPG_TTY=$(tty)');
         if ($mode == 'w') {
             if ($fp = popen($cmdline, 'w')) {
                 putenv('LANGUAGE=' . $language);
@@ -723,6 +731,17 @@
             }
         }
 
+        $cmdline = array(
+            'killall',
+            '--quiet',
+            '-SIGHUP',
+            'gpg-agent'
+        );
+        if (!($fp = popen(implode(' ', $cmdline), 'r'))) {
+            throw new HordeCrypt_Exception(Horde_Crypt_Translation::t("Error while dropping passphrases from agent cache."));
+        }
+        pclose($fp);
+
         return $data;
     }
 
Download as text