Gentoo Archives: gentoo-commits

From: "Andreas Hüttel" <dilfridge@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-perl/GnuPG-Interface/, dev-perl/GnuPG-Interface/files/
Date: Sun, 28 May 2017 16:28:29
Message-Id: 1495988897.b3c40ee37e509f164238a38e6509ccca803cfa43.dilfridge@gentoo
1 commit: b3c40ee37e509f164238a38e6509ccca803cfa43
2 Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
3 AuthorDate: Sun May 28 16:27:08 2017 +0000
4 Commit: Andreas Hüttel <dilfridge <AT> gentoo <DOT> org>
5 CommitDate: Sun May 28 16:28:17 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b3c40ee3
7
8 dev-perl/GnuPG-Interface: Add Debian patchset
9
10 Package-Manager: Portage-2.3.6, Repoman-2.3.2
11
12 .../GnuPG-Interface-0.520.0-r2.ebuild | 58 ++++
13 ...spelling-error-settting-should-be-setting.patch | 35 +++
14 ...ce-0.520.0-0002-Generalize-the-test-suite.patch | 151 +++++++++++
15 ...dity-of-an-key-when-we-have-established-n.patch | 37 +++
16 ...04-ensure-that-test-covers-all-signatures.patch | 35 +++
17 ...20.0-0005-add-gpg_is_modern-to-test-suite.patch | 39 +++
18 ...G-2.1-reports-more-detail-about-secret-ke.patch | 120 ++++++++
19 ...match-plaintext-output-across-versions-of.patch | 95 +++++++
20 ...fault_key_passphrase-when-passphrase-come.patch | 29 ++
21 ...0.520.0-0009-clean-up-trailing-whitespace.patch | 112 ++++++++
22 ...-0.520.0-0010-fix-capitalization-of-GnuPG.patch | 35 +++
23 ...0-0011-ommand_args-should-be-command_args.patch | 21 ++
24 ...rints-as-inputs-during-tests-to-demonstra.patch | 265 ++++++++++++++++++
25 ...20.0-0013-move-key-files-to-generic-names.patch | 33 +++
26 ...0014-fix-spelling-s-convience-convenience.patch | 53 ++++
27 ...-new-secret-key-with-different-passphrase.patch | 117 ++++++++
28 ...-gpg-without-explicit-passphrase-agent-pi.patch | 302 +++++++++++++++++++++
29 ...uPG-agent-before-and-after-the-test-suite.patch | 42 +++
30 ...t-temporary-homedir-during-the-test-suite.patch | 110 ++++++++
31 ...-work-with-gpg1-assuming-plain-gpg-is-mod.patch | 51 ++++
32 20 files changed, 1740 insertions(+)
33
34 diff --git a/dev-perl/GnuPG-Interface/GnuPG-Interface-0.520.0-r2.ebuild b/dev-perl/GnuPG-Interface/GnuPG-Interface-0.520.0-r2.ebuild
35 new file mode 100644
36 index 00000000000..fa04802748c
37 --- /dev/null
38 +++ b/dev-perl/GnuPG-Interface/GnuPG-Interface-0.520.0-r2.ebuild
39 @@ -0,0 +1,58 @@
40 +# Copyright 1999-2017 Gentoo Foundation
41 +# Distributed under the terms of the GNU General Public License v2
42 +
43 +EAPI=6
44 +
45 +DIST_AUTHOR=ALEXMV
46 +DIST_VERSION=0.52
47 +inherit perl-module
48 +
49 +DESCRIPTION="Perl module interface to interacting with GnuPG"
50 +
51 +SLOT="0"
52 +KEYWORDS="~amd64 ~hppa ~ppc ~x86"
53 +IUSE="test"
54 +
55 +RDEPEND="
56 + >=app-crypt/gnupg-1.2.1-r1
57 + virtual/perl-autodie
58 + >=virtual/perl-Math-BigInt-1.780.0
59 + >=dev-perl/Moo-0.91.11
60 + >=dev-perl/MooX-HandlesVia-0.1.4
61 + >=dev-perl/MooX-late-0.14.0
62 +"
63 +DEPEND="${RDEPEND}
64 + >=virtual/perl-ExtUtils-MakeMaker-6.360.0
65 +"
66 +
67 +PATCHES=(
68 + "${FILESDIR}/${P}"-0001-fix-spelling-error-settting-should-be-setting.patch
69 + "${FILESDIR}/${P}"-0002-Generalize-the-test-suite.patch
70 + "${FILESDIR}/${P}"-0003-subkey-validity-of-an-key-when-we-have-established-n.patch
71 + "${FILESDIR}/${P}"-0004-ensure-that-test-covers-all-signatures.patch
72 + "${FILESDIR}/${P}"-0005-add-gpg_is_modern-to-test-suite.patch
73 + "${FILESDIR}/${P}"-0006-Modern-GnuPG-2.1-reports-more-detail-about-secret-ke.patch
74 + "${FILESDIR}/${P}"-0007-test-suite-match-plaintext-output-across-versions-of.patch
75 + "${FILESDIR}/${P}"-0008-fix-test_default_key_passphrase-when-passphrase-come.patch
76 + "${FILESDIR}/${P}"-0009-clean-up-trailing-whitespace.patch
77 + "${FILESDIR}/${P}"-0010-fix-capitalization-of-GnuPG.patch
78 + "${FILESDIR}/${P}"-0011-ommand_args-should-be-command_args.patch
79 + "${FILESDIR}/${P}"-0012-use-fingerprints-as-inputs-during-tests-to-demonstra.patch
80 + "${FILESDIR}/${P}"-0013-move-key-files-to-generic-names.patch
81 + "${FILESDIR}/${P}"-0014-fix-spelling-s-convience-convenience.patch
82 + "${FILESDIR}/${P}"-0015-added-new-secret-key-with-different-passphrase.patch
83 + "${FILESDIR}/${P}"-0016-Test-use-of-gpg-without-explicit-passphrase-agent-pi.patch
84 + "${FILESDIR}/${P}"-0017-Kill-any-GnuPG-agent-before-and-after-the-test-suite.patch
85 + "${FILESDIR}/${P}"-0018-Use-a-short-temporary-homedir-during-the-test-suite.patch
86 + "${FILESDIR}/${P}"-0019-Make-things-work-with-gpg1-assuming-plain-gpg-is-mod.patch
87 +)
88 +
89 +DIST_TEST=skip
90 +# Nearly all tests succeed with this patchset and GnuPG 2.1 when running outside the
91 +# emerge sandbox. However, the agent architecture is not really sandbox-friendly, so...
92 +#
93 +# Test Summary Report
94 +# -------------------
95 +# t/decrypt.t (Wstat: 0 Tests: 6 Failed: 2)
96 +# Failed tests: 5-6
97 +# Failed 1/22 test programs. 2/56 subtests failed.
98
99 diff --git a/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0001-fix-spelling-error-settting-should-be-setting.patch b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0001-fix-spelling-error-settting-should-be-setting.patch
100 new file mode 100644
101 index 00000000000..fcec6100907
102 --- /dev/null
103 +++ b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0001-fix-spelling-error-settting-should-be-setting.patch
104 @@ -0,0 +1,35 @@
105 +From: Daniel Kahn Gillmor <dkg@×××××××××××××.net>
106 +Date: Tue, 13 Sep 2016 07:26:00 +0200
107 +Subject: fix spelling error ("settting" should be "setting")
108 +
109 +---
110 + README | 2 +-
111 + lib/GnuPG/Interface.pm | 2 +-
112 + 2 files changed, 2 insertions(+), 2 deletions(-)
113 +
114 +diff --git a/README b/README
115 +index fcb982a..f457577 100644
116 +--- a/README
117 ++++ b/README
118 +@@ -6,7 +6,7 @@ SYNOPSIS
119 + use IO::Handle;
120 + use GnuPG::Interface;
121 +
122 +- # settting up the situation
123 ++ # setting up the situation
124 + my $gnupg = GnuPG::Interface->new();
125 + $gnupg->options->hash_init( armor => 1,
126 + homedir => '/home/foobar' );
127 +diff --git a/lib/GnuPG/Interface.pm b/lib/GnuPG/Interface.pm
128 +index f952f3e..83a4b1a 100644
129 +--- a/lib/GnuPG/Interface.pm
130 ++++ b/lib/GnuPG/Interface.pm
131 +@@ -834,7 +834,7 @@ GnuPG::Interface - Perl interface to GnuPG
132 + use IO::Handle;
133 + use GnuPG::Interface;
134 +
135 +- # settting up the situation
136 ++ # setting up the situation
137 + my $gnupg = GnuPG::Interface->new();
138 + $gnupg->options->hash_init( armor => 1,
139 + homedir => '/home/foobar' );
140
141 diff --git a/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0002-Generalize-the-test-suite.patch b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0002-Generalize-the-test-suite.patch
142 new file mode 100644
143 index 00000000000..d0d3e6ccdf9
144 --- /dev/null
145 +++ b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0002-Generalize-the-test-suite.patch
146 @@ -0,0 +1,151 @@
147 +From: Daniel Kahn Gillmor <dkg@×××××××××××××.net>
148 +Date: Tue, 13 Sep 2016 10:38:12 -0400
149 +Subject: Generalize the test suite
150 +
151 +The test suite currently assumes it knows something about the internal
152 +state of GnuPG's homedir.
153 +
154 +It's safer and less brittle to rely explicitly on the public interface
155 +that GnuPG has committed to, such as --import-keys and --list-keys,
156 +rather than assuming that certain files are in certain places in the
157 +GnuPG homedir.
158 +
159 +It's also better to create a fresh homedir and allow GnuPG to populate
160 +it during the test suite, cleaning it up at the end, rather than hope
161 +that GnuPG will leave a pre-existing homedir untouched.
162 +
163 +With this change, many more of the tests pass when /usr/bin/gpg is
164 +provided by GnuPG 2.1.
165 +---
166 + t/000_setup.t | 28 ++++++++++++++++++++++++++++
167 + t/MyTestSpecific.pm | 2 +-
168 + t/zzz_cleanup.t | 17 +++++++++++++++++
169 + test/fake-pinentry.pl | 28 ++++++++++++++++++++++++++++
170 + test/{options => gpg.conf} | 0
171 + test/secret-keys/1.0.test | 4 ++--
172 + 6 files changed, 76 insertions(+), 3 deletions(-)
173 + create mode 100644 t/000_setup.t
174 + create mode 100644 t/zzz_cleanup.t
175 + create mode 100755 test/fake-pinentry.pl
176 + rename test/{options => gpg.conf} (100%)
177 +
178 +diff --git a/t/000_setup.t b/t/000_setup.t
179 +new file mode 100644
180 +index 0000000..7f7f7b0
181 +--- /dev/null
182 ++++ b/t/000_setup.t
183 +@@ -0,0 +1,28 @@
184 ++#!/usr/bin/perl -w
185 ++
186 ++use strict;
187 ++use English qw( -no_match_vars );
188 ++
189 ++use lib './t';
190 ++use MyTest;
191 ++use MyTestSpecific;
192 ++use Cwd;
193 ++use File::Path qw (make_path);
194 ++use File::Copy;
195 ++
196 ++TEST
197 ++{
198 ++ make_path('test/gnupghome', { mode => 0700 });
199 ++ my $agentconf = IO::File->new( "> test/gnupghome/gpg-agent.conf" );
200 ++ $agentconf->write("pinentry-program " . getcwd() . "/test/fake-pinentry.pl\n");
201 ++ $agentconf->close();
202 ++ copy('test/gpg.conf', 'test/gnupghome/gpg.conf');
203 ++ reset_handles();
204 ++
205 ++ my $pid = $gnupg->import_keys(command_args => [ 'test/pubring.gpg', 'test/secring.gpg' ],
206 ++ options => [ 'batch'],
207 ++ handles => $handles);
208 ++ waitpid $pid, 0;
209 ++
210 ++ return $CHILD_ERROR == 0;
211 ++};
212 +diff --git a/t/MyTestSpecific.pm b/t/MyTestSpecific.pm
213 +index 053b749..1af98ae 100644
214 +--- a/t/MyTestSpecific.pm
215 ++++ b/t/MyTestSpecific.pm
216 +@@ -40,7 +40,7 @@ use vars qw( @ISA @EXPORT
217 +
218 + $gnupg = GnuPG::Interface->new( passphrase => 'test' );
219 +
220 +-$gnupg->options->hash_init( homedir => 'test',
221 ++$gnupg->options->hash_init( homedir => 'test/gnupghome',
222 + armor => 1,
223 + meta_interactive => 0,
224 + meta_signing_key_id => '0xF950DA9C',
225 +diff --git a/t/zzz_cleanup.t b/t/zzz_cleanup.t
226 +new file mode 100644
227 +index 0000000..5c03a72
228 +--- /dev/null
229 ++++ b/t/zzz_cleanup.t
230 +@@ -0,0 +1,17 @@
231 ++#!/usr/bin/perl -w
232 ++
233 ++use strict;
234 ++use English qw( -no_match_vars );
235 ++
236 ++use lib './t';
237 ++use MyTest;
238 ++use MyTestSpecific;
239 ++use File::Path qw (remove_tree);
240 ++
241 ++# this is actually no test, just cleanup.
242 ++TEST
243 ++{
244 ++ my $err = [];
245 ++ remove_tree('test/gnupghome', {error => \$err});
246 ++ return ! @$err;
247 ++};
248 +diff --git a/test/fake-pinentry.pl b/test/fake-pinentry.pl
249 +new file mode 100755
250 +index 0000000..12d3611
251 +--- /dev/null
252 ++++ b/test/fake-pinentry.pl
253 +@@ -0,0 +1,28 @@
254 ++#!/usr/bin/perl -w
255 ++# Use this for your test suites when a perl interpreter is available.
256 ++#
257 ++# The encrypted keys in your test suite that you expect to work must
258 ++# be locked with a passphrase of "test"
259 ++#
260 ++# Author: Daniel Kahn Gillmor <dkg@×××××××××××××.net>
261 ++#
262 ++# License: This trivial work is hereby explicitly placed into the
263 ++# public domain. Anyone may reuse it, modify it, redistribute it for
264 ++# any purpose.
265 ++
266 ++use strict;
267 ++use warnings;
268 ++
269 ++# turn off buffering
270 ++$| = 1;
271 ++
272 ++print "OK This is only for test suites, and should never be used in production\n";
273 ++while (<STDIN>) {
274 ++ chomp;
275 ++ next if (/^$/);
276 ++ next if (/^#/);
277 ++ print ("D test\n") if (/^getpin/i);
278 ++ print "OK\n";
279 ++ exit if (/^bye/i);
280 ++}
281 ++1;
282 +diff --git a/test/options b/test/gpg.conf
283 +similarity index 100%
284 +rename from test/options
285 +rename to test/gpg.conf
286 +diff --git a/test/secret-keys/1.0.test b/test/secret-keys/1.0.test
287 +index 5999484..129d472 100644
288 +--- a/test/secret-keys/1.0.test
289 ++++ b/test/secret-keys/1.0.test
290 +@@ -1,5 +1,5 @@
291 +-test/secring.gpg
292 +-----------------
293 ++test/gnupghome/secring.gpg
294 ++--------------------------
295 + sec 1024D/F950DA9C 2000-02-06
296 + uid GnuPG test key (for testing purposes only)
297 + uid Foo Bar (1)
298
299 diff --git a/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0003-subkey-validity-of-an-key-when-we-have-established-n.patch b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0003-subkey-validity-of-an-key-when-we-have-established-n.patch
300 new file mode 100644
301 index 00000000000..23fbf97fee2
302 --- /dev/null
303 +++ b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0003-subkey-validity-of-an-key-when-we-have-established-n.patch
304 @@ -0,0 +1,37 @@
305 +From: Daniel Kahn Gillmor <dkg@×××××××××××××.net>
306 +Date: Tue, 13 Sep 2016 11:35:31 -0400
307 +Subject: subkey validity of an key when we have established no trust anchors
308 +
309 +This apparently isn't tested by deep comparisons, though, so it was
310 +never caught.
311 +---
312 + t/get_public_keys.t | 2 +-
313 + t/get_secret_keys.t | 2 +-
314 + 2 files changed, 2 insertions(+), 2 deletions(-)
315 +
316 +diff --git a/t/get_public_keys.t b/t/get_public_keys.t
317 +index 53db021..73e320b 100644
318 +--- a/t/get_public_keys.t
319 ++++ b/t/get_public_keys.t
320 +@@ -175,7 +175,7 @@ TEST
321 + ];
322 +
323 + my $subkey = GnuPG::SubKey->new
324 +- ( validity => 'u',
325 ++ ( validity => '-',
326 + length => 768,
327 + algo_num => 16,
328 + hex_id => 'ADB99D9C2E854A6B',
329 +diff --git a/t/get_secret_keys.t b/t/get_secret_keys.t
330 +index 3a1d99f..7bba083 100644
331 +--- a/t/get_secret_keys.t
332 ++++ b/t/get_secret_keys.t
333 +@@ -48,7 +48,7 @@ TEST
334 +
335 +
336 + my $subkey = GnuPG::SubKey->new
337 +- ( validity => 'u',
338 ++ ( validity => '-',
339 + length => 768,
340 + algo_num => 16,
341 + hex_id => 'ADB99D9C2E854A6B',
342
343 diff --git a/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0004-ensure-that-test-covers-all-signatures.patch b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0004-ensure-that-test-covers-all-signatures.patch
344 new file mode 100644
345 index 00000000000..1743b7d9177
346 --- /dev/null
347 +++ b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0004-ensure-that-test-covers-all-signatures.patch
348 @@ -0,0 +1,35 @@
349 +From: Daniel Kahn Gillmor <dkg@×××××××××××××.net>
350 +Date: Tue, 13 Sep 2016 11:39:04 -0400
351 +Subject: ensure that test covers all signatures
352 +
353 +The earlier test wasn't reporting on one of the known self-sigs for
354 +the test key for some reason.
355 +
356 +This change ensures that all known signatures are present.
357 +---
358 + t/get_public_keys.t | 12 +++++++++++-
359 + 1 file changed, 11 insertions(+), 1 deletion(-)
360 +
361 +diff --git a/t/get_public_keys.t b/t/get_public_keys.t
362 +index 73e320b..9e96f7d 100644
363 +--- a/t/get_public_keys.t
364 ++++ b/t/get_public_keys.t
365 +@@ -83,7 +83,17 @@ TEST
366 + date_string => '2000-02-06',
367 + hex_id => '53AE596EF950DA9C',
368 + sig_class => 0x13,
369 +- validity => '!'));
370 ++ validity => '!'),
371 ++ GnuPG::Signature->new(
372 ++ date => 1177086329,
373 ++ algo_num => 17,
374 ++ is_exportable => 1,
375 ++ user_id_string => 'GnuPG test key (for testing purposes only)',
376 ++ date_string => '2007-04-20',
377 ++ hex_id => '53AE596EF950DA9C',
378 ++ sig_class => 0x13,
379 ++ validity => '!'),
380 ++ );
381 +
382 + my $uid1 = GnuPG::UserId->new( as_string => 'Foo Bar (1)',
383 + validity => '-');
384
385 diff --git a/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0005-add-gpg_is_modern-to-test-suite.patch b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0005-add-gpg_is_modern-to-test-suite.patch
386 new file mode 100644
387 index 00000000000..0016fa755c0
388 --- /dev/null
389 +++ b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0005-add-gpg_is_modern-to-test-suite.patch
390 @@ -0,0 +1,39 @@
391 +From: Daniel Kahn Gillmor <dkg@×××××××××××××.net>
392 +Date: Tue, 13 Sep 2016 14:31:38 -0400
393 +Subject: add $gpg_is_modern to test suite
394 +
395 +MyTestSpecific.pm now produces a new variable indicating whether it
396 +the version of GnuPG we run against is from the "Modern" line of GnuPG
397 +development (2.1 or later). This will be useful when comparing output
398 +that we can't expect from earlier versions.
399 +---
400 + t/MyTestSpecific.pm | 7 +++++--
401 + 1 file changed, 5 insertions(+), 2 deletions(-)
402 +
403 +diff --git a/t/MyTestSpecific.pm b/t/MyTestSpecific.pm
404 +index 1af98ae..a309698 100644
405 +--- a/t/MyTestSpecific.pm
406 ++++ b/t/MyTestSpecific.pm
407 +@@ -29,17 +29,20 @@ use GnuPG::Handles;
408 + use vars qw( @ISA @EXPORT
409 + $stdin $stdout $stderr
410 + $gpg_program $handles $gnupg
411 +- %texts
412 ++ %texts $gpg_is_modern
413 + );
414 +
415 + @ISA = qw( Exporter );
416 + @EXPORT = qw( stdin stdout stderr
417 + gnupg_program handles reset_handles
418 +- texts file_match
419 ++ texts file_match gpg_is_modern
420 + );
421 +
422 + $gnupg = GnuPG::Interface->new( passphrase => 'test' );
423 +
424 ++my @version = split('\.', $gnupg->version());
425 ++$gpg_is_modern = ($version[0] > 2 || ($version[0] == 2 && $version[1] >= 1));
426 ++
427 + $gnupg->options->hash_init( homedir => 'test/gnupghome',
428 + armor => 1,
429 + meta_interactive => 0,
430
431 diff --git a/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0006-Modern-GnuPG-2.1-reports-more-detail-about-secret-ke.patch b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0006-Modern-GnuPG-2.1-reports-more-detail-about-secret-ke.patch
432 new file mode 100644
433 index 00000000000..bea8bfc68df
434 --- /dev/null
435 +++ b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0006-Modern-GnuPG-2.1-reports-more-detail-about-secret-ke.patch
436 @@ -0,0 +1,120 @@
437 +From: Daniel Kahn Gillmor <dkg@×××××××××××××.net>
438 +Date: Tue, 13 Sep 2016 14:12:40 -0400
439 +Subject: Modern GnuPG (2.1) reports more detail about secret keys
440 +
441 +the GnuPG "modern" suite (version 2.1 or later) reports more detail
442 +about secret keys than previous versions did. In particular, it
443 +reports stored ownertrust, public key data, and designated revokers
444 +for secret keys. Older versions only reported those attributes for
445 +public keys.
446 +
447 +This patch adjusts the test suite to ensure that our handmade key
448 +matches the produced key when /usr/bin/gpg is supplied by the modern
449 +suite.
450 +---
451 + t/get_secret_keys.t | 66 +++++++++++++++++++++++++++++++++++++++++++----------
452 + 1 file changed, 54 insertions(+), 12 deletions(-)
453 +
454 +diff --git a/t/get_secret_keys.t b/t/get_secret_keys.t
455 +index 7bba083..c798cce 100644
456 +--- a/t/get_secret_keys.t
457 ++++ b/t/get_secret_keys.t
458 +@@ -23,16 +23,34 @@ TEST
459 + return 0 unless @returned_keys == 1;
460 +
461 + $given_key = shift @returned_keys;
462 +-
463 +- $handmade_key = GnuPG::PrimaryKey->new
464 +- ( length => 1024,
465 ++ my $pubkey_data = [
466 ++ Math::BigInt->from_hex('0x'.
467 ++ '88FCAAA5BCDCD52084D46143F44ED1715A339794641158DE03AA2092AFD3174E3DCA2CB7DF2DDC6FEDF7C3620F5A8BDAD06713E6153F8748DD76CB97305F30CBA8F8801DB47FAC11EED725F55672CB9BDAD629178A677CBB089B3E8AE0D9A9AD7741697A35F2868C62D25670994A92D810480173DC24263EEA0F103A43C0B64B'),
468 ++ Math::BigInt->from_hex('0x'.
469 ++ '8F2A3842C70FF17660CBB78C78FC93F534AB9A17'),
470 ++ Math::BigInt->from_hex('0x'.
471 ++ '83E348C2AA65F56DE84E8FDCE6DA7B0991B1C75EC8CA446FA85869A43350907BFF36BE512385E8E7E095578BB2138C04E318495873218286DE2B8C86F36EA670135434967AC798EBA28581F709F0C6B696EB512D3E561E381A06E4B5239BCC655015F9A926C74E4B859B26EAD604F208A556511A76A40EDCD9C38E6BD82CCCB4'),
472 ++ Math::BigInt->from_hex('0x'.
473 ++ '80DE04C85E30C9D62C13F90CFF927A84A5A59D0900B3533D4D6193FEF8C5DAEF9FF8A7D5F76B244FBC17644F50D524E0B19CD3A4B5FC2D78DAECA3FE58FA1C1A64E6C7B96C4EE618173543163A72EF954DFD593E84342699096E9CA76578AC1DE3D893BCCD0BF470CEF625FAF816A0F503EF75C18C6173E35C8675AF919E5704')
474 ++ ];
475 ++
476 ++
477 ++ my $args = {
478 ++ length => 1024,
479 + algo_num => 17,
480 + hex_id => '53AE596EF950DA9C',
481 + creation_date => 949813093,
482 + creation_date_string => '2000-02-06',
483 +- owner_trust => '', # secret keys do not report ownertrust?
484 ++ owner_trust => '-',
485 + usage_flags => 'scaESCA',
486 +- );
487 ++ pubkey_data => $pubkey_data,
488 ++ };
489 ++ if (!$gpg_is_modern) {
490 ++ # older versions don't report ownertrust or pubkey_data for secret keys:
491 ++ delete $args->{pubkey_data};
492 ++ $args->{owner_trust} = '';
493 ++ }
494 ++ $handmade_key = GnuPG::PrimaryKey->new($args);
495 +
496 + $handmade_key->fingerprint
497 + ( GnuPG::Fingerprint->new( as_hex_string =>
498 +@@ -42,20 +60,42 @@ TEST
499 +
500 + $handmade_key->push_user_ids(
501 + GnuPG::UserId->new( as_string => 'GnuPG test key (for testing purposes only)',
502 +- validity => ''), # secret keys do not report uid validity?
503 ++ validity => $args->{owner_trust}),
504 + GnuPG::UserId->new( as_string => 'Foo Bar (1)',
505 +- validity => '')); # secret keys do not report uid validity?
506 +-
507 +-
508 +- my $subkey = GnuPG::SubKey->new
509 +- ( validity => '-',
510 ++ validity => $args->{owner_trust}));
511 ++
512 ++ my $revoker = GnuPG::Revoker->new
513 ++ ( algo_num => 17,
514 ++ class => 0x80,
515 ++ fingerprint => GnuPG::Fingerprint->new( as_hex_string =>
516 ++ '4F863BBBA8166F0A340F600356FFD10A260C4FA3'),
517 ++ );
518 ++
519 ++ my $subkey_pub_data = [
520 ++ Math::BigInt->from_hex('0x'.
521 ++ '8831982DADC4C5D05CBB01D9EAF612131DDC9C24CEA7246557679423FB0BA42F74D10D8E7F5564F6A4FB8837F8DC4A46571C19B122E6DF4B443D15197A6A22688863D0685FADB6E402316DAA9B560D1F915475364580A67E6DF0A727778A5CF3'),
522 ++ Math::BigInt->from_hex('0x'.
523 ++ '6'),
524 ++ Math::BigInt->from_hex('0x'.
525 ++ '2F3850FF130C6AC9AA0962720E86539626FAA9B67B33A74DFC0DE843FF3E90E43E2F379EE0182D914FA539CCCF5C83A20DB3A7C45E365B8A2A092E799A3DFF4AD8274EB977BAAF5B1AFB2ACB8D6F92454F01682F555565E73E56793C46EF7C3E')
526 ++ ];
527 ++
528 ++ my $sub_args = {
529 ++ validity => '-',
530 + length => 768,
531 + algo_num => 16,
532 + hex_id => 'ADB99D9C2E854A6B',
533 + creation_date => 949813119,
534 + creation_date_string => '2000-02-06',
535 + usage_flags => 'e',
536 +- );
537 ++ pubkey_data => $subkey_pub_data,
538 ++ };
539 ++
540 ++ if (!$gpg_is_modern) {
541 ++ # older versions do not report pubkey data for secret keys
542 ++ delete $sub_args->{pubkey_data};
543 ++ }
544 ++ my $subkey = GnuPG::SubKey->new($sub_args);
545 +
546 + $subkey->fingerprint
547 + ( GnuPG::Fingerprint->new( as_hex_string =>
548 +@@ -64,6 +104,8 @@ TEST
549 + );
550 +
551 + $handmade_key->push_subkeys( $subkey );
552 ++ # older versions do not report designated revokers for secret keys
553 ++ $handmade_key->push_revokers( $revoker ) if ($gpg_is_modern);
554 +
555 + $handmade_key->compare( $given_key );
556 + };
557
558 diff --git a/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0007-test-suite-match-plaintext-output-across-versions-of.patch b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0007-test-suite-match-plaintext-output-across-versions-of.patch
559 new file mode 100644
560 index 00000000000..85c1a46adae
561 --- /dev/null
562 +++ b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0007-test-suite-match-plaintext-output-across-versions-of.patch
563 @@ -0,0 +1,95 @@
564 +From: Daniel Kahn Gillmor <dkg@×××××××××××××.net>
565 +Date: Tue, 13 Sep 2016 14:46:13 -0400
566 +Subject: test suite: match plaintext output across versions of GnuPG
567 +
568 +The human-readable version of --list-keys is *not* expected to be
569 +static over time or as the user's environment changes (e.g. LANG or
570 +LC_MESSAGES), so expecting it to be machine-parseable is probably a
571 +mistake.
572 +
573 +That said, some users might want to pull textual information about
574 +specific keys to display directly to the user, so it's not a terrible
575 +idea to have it in the test suite.
576 +
577 +Modern GnuPG (2.1 or later) changes the default structure of the
578 +human-readable output in a few significant ways:
579 +
580 + * it writes the path to the keyring as an absolute path, even if
581 + $GNUPGHOME is set to a non-absolute path.
582 +
583 + * it shows the calculated user id validity by default (see
584 + show-uid-validity in gpg's --list-options). (note that this is a
585 + translated string, so that "unknown" (in the default C locale)
586 + becomes "inconnue" when LANG or LC_MESSAGES is set to fr_CH.UTF-8,
587 + for example.
588 +
589 + * it writes the key algorithm names differently (e.g. rsa2048 instead
590 + of 2048R)
591 +
592 + * it does not display the key ID at all by default
593 +
594 + * it displays the full fingerprint in compact form by default
595 +
596 +This changeset fixes the test suite so that it can do a rough
597 +verification of the human-readable text output by list_secret_keys in
598 +the C locale in modern versions of GnuPG, while leaving it working for
599 +older GnuPG suites.
600 +---
601 + t/list_secret_keys.t | 15 +++++++++++++--
602 + test/secret-keys/1.modern.test | 8 ++++++++
603 + 2 files changed, 21 insertions(+), 2 deletions(-)
604 + create mode 100644 test/secret-keys/1.modern.test
605 +
606 +diff --git a/t/list_secret_keys.t b/t/list_secret_keys.t
607 +index 1fe9b7e..51e3651 100644
608 +--- a/t/list_secret_keys.t
609 ++++ b/t/list_secret_keys.t
610 +@@ -16,13 +16,22 @@ TEST
611 + {
612 + reset_handles();
613 +
614 ++ $ENV{LC_MESSAGES} = 'C';
615 + my $pid = $gnupg->list_secret_keys( handles => $handles );
616 + close $stdin;
617 +
618 + $outfile = 'test/secret-keys/1.out';
619 + my $out = IO::File->new( "> $outfile" )
620 + or die "cannot open $outfile for writing: $ERRNO";
621 +- $out->print( <$stdout> );
622 ++ while (<$stdout>) {
623 ++ if ($gpg_is_modern && /^\/.*\/test\/gnupghome\/pubring.kbx$/) {
624 ++ $out->print("test/gnupghome/pubring.kbx\n");
625 ++ } elsif ($gpg_is_modern && /^--*$/) {
626 ++ $out->print("--------------------------\n");
627 ++ } else {
628 ++ $out->print( $_ );
629 ++ }
630 ++ }
631 + close $stdout;
632 + $out->close();
633 + waitpid $pid, 0;
634 +@@ -33,7 +42,9 @@ TEST
635 +
636 + TEST
637 + {
638 +- my @files_to_test = ( 'test/secret-keys/1.0.test' );
639 ++ my $suffix = '0';
640 ++ $suffix = 'modern' if ($gpg_is_modern);
641 ++ my @files_to_test = ( 'test/secret-keys/1.'.$suffix.'.test' );
642 +
643 + return file_match( $outfile, @files_to_test );
644 + };
645 +diff --git a/test/secret-keys/1.modern.test b/test/secret-keys/1.modern.test
646 +new file mode 100644
647 +index 0000000..3e46407
648 +--- /dev/null
649 ++++ b/test/secret-keys/1.modern.test
650 +@@ -0,0 +1,8 @@
651 ++test/gnupghome/pubring.kbx
652 ++--------------------------
653 ++sec dsa1024 2000-02-06 [SCA]
654 ++ 93AFC4B1B0288A104996B44253AE596EF950DA9C
655 ++uid [ unknown] GnuPG test key (for testing purposes only)
656 ++uid [ unknown] Foo Bar (1)
657 ++ssb elg768 2000-02-06 [E]
658 ++
659
660 diff --git a/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0008-fix-test_default_key_passphrase-when-passphrase-come.patch b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0008-fix-test_default_key_passphrase-when-passphrase-come.patch
661 new file mode 100644
662 index 00000000000..5ae938325ff
663 --- /dev/null
664 +++ b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0008-fix-test_default_key_passphrase-when-passphrase-come.patch
665 @@ -0,0 +1,29 @@
666 +From: Daniel Kahn Gillmor <dkg@×××××××××××××.net>
667 +Date: Tue, 13 Sep 2016 15:22:27 -0400
668 +Subject: fix test_default_key_passphrase when passphrase comes from agent
669 +
670 +In the modern GnuPG suite, where the passphrase is always managed by
671 +the agent, gpg itself doesn't emit the GOOD_PASSPHRASE status.
672 +Instead, if signing is successful it emits plain old SIG_CREATED.
673 +
674 +There are probably even better ways to test whether a given key is
675 +unlocked in this case, but this is a straightforward baseline fix that
676 +should get this part of the test suite to pass with all available
677 +versions of GnuPG.
678 +---
679 + lib/GnuPG/Interface.pm | 2 +-
680 + 1 file changed, 1 insertion(+), 1 deletion(-)
681 +
682 +diff --git a/lib/GnuPG/Interface.pm b/lib/GnuPG/Interface.pm
683 +index 83a4b1a..1f1e6d5 100644
684 +--- a/lib/GnuPG/Interface.pm
685 ++++ b/lib/GnuPG/Interface.pm
686 +@@ -808,7 +808,7 @@ sub test_default_key_passphrase() {
687 +
688 + # all we realy want to check is the status fh
689 + while (<$status>) {
690 +- if (/^\[GNUPG:\]\s*GOOD_PASSPHRASE/) {
691 ++ if (/^\[GNUPG:\]\s*(GOOD_PASSPHRASE|SIG_CREATED)/) {
692 + waitpid $pid, 0;
693 + return 1;
694 + }
695
696 diff --git a/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0009-clean-up-trailing-whitespace.patch b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0009-clean-up-trailing-whitespace.patch
697 new file mode 100644
698 index 00000000000..f408c6568b0
699 --- /dev/null
700 +++ b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0009-clean-up-trailing-whitespace.patch
701 @@ -0,0 +1,112 @@
702 +From: Daniel Kahn Gillmor <dkg@×××××××××××××.net>
703 +Date: Tue, 11 Oct 2016 19:52:13 -0400
704 +Subject: clean up trailing whitespace
705 +
706 +---
707 + lib/GnuPG/Fingerprint.pm | 2 +-
708 + lib/GnuPG/Handles.pm | 2 +-
709 + lib/GnuPG/Interface.pm | 16 ++++++++--------
710 + 3 files changed, 10 insertions(+), 10 deletions(-)
711 +
712 +diff --git a/lib/GnuPG/Fingerprint.pm b/lib/GnuPG/Fingerprint.pm
713 +index fcb1028..81c38a7 100644
714 +--- a/lib/GnuPG/Fingerprint.pm
715 ++++ b/lib/GnuPG/Fingerprint.pm
716 +@@ -20,7 +20,7 @@ with qw(GnuPG::HashInit);
717 +
718 + has as_hex_string => (
719 + isa => 'Any',
720 +- is => 'rw',
721 ++ is => 'rw',
722 + );
723 +
724 + sub compare {
725 +diff --git a/lib/GnuPG/Handles.pm b/lib/GnuPG/Handles.pm
726 +index b30ca57..3eee0e3 100644
727 +--- a/lib/GnuPG/Handles.pm
728 ++++ b/lib/GnuPG/Handles.pm
729 +@@ -73,7 +73,7 @@ GnuPG::Handles - GnuPG handles bundle
730 + = ( IO::Handle->new(), IO::Handle->new(), IO::Handle->new(),
731 + IO::Handle->new(), IO::Handle->new(), IO::Handle->new(),
732 + );
733 +-
734 ++
735 + my $handles = GnuPG::Handles->new
736 + ( stdin => $stdin,
737 + stdout => $stdout,
738 +diff --git a/lib/GnuPG/Interface.pm b/lib/GnuPG/Interface.pm
739 +index 1f1e6d5..19e8070 100644
740 +--- a/lib/GnuPG/Interface.pm
741 ++++ b/lib/GnuPG/Interface.pm
742 +@@ -833,7 +833,7 @@ GnuPG::Interface - Perl interface to GnuPG
743 + # A simple example
744 + use IO::Handle;
745 + use GnuPG::Interface;
746 +-
747 ++
748 + # setting up the situation
749 + my $gnupg = GnuPG::Interface->new();
750 + $gnupg->options->hash_init( armor => 1,
751 +@@ -852,7 +852,7 @@ GnuPG::Interface - Perl interface to GnuPG
752 + # Now we'll go about encrypting with the options already set
753 + my @plaintext = ( 'foobar' );
754 + my $pid = $gnupg->encrypt( handles => $handles );
755 +-
756 ++
757 + # Now we write to the input of GnuPG
758 + print $input @plaintext;
759 + close $input;
760 +@@ -1144,7 +1144,7 @@ The following setup can be done before any of the following examples:
761 +
762 + my $handles = GnuPG::Handles->new( stdin => $input,
763 + stdout => $output );
764 +-
765 ++
766 + # this sets up the communication
767 + # Note that the recipients were specified earlier
768 + # in the 'options' data member of the $gnupg object.
769 +@@ -1220,7 +1220,7 @@ The following setup can be done before any of the following examples:
770 + # a file written to disk
771 + # Make sure you "use IO::File" if you use this module!
772 + my $cipher_file = IO::File->new( 'encrypted.gpg' );
773 +-
774 ++
775 + # this sets up the communication
776 + my $pid = $gnupg->decrypt( handles => $handles );
777 +
778 +@@ -1252,7 +1252,7 @@ The following setup can be done before any of the following examples:
779 + # This time we'll just let GnuPG print to our own output
780 + # and read from our input, because no input is needed!
781 + my $handles = GnuPG::Handles->new();
782 +-
783 ++
784 + my @ids = ( 'ftobin', '0xABCD1234' );
785 +
786 + # this time we need to specify something for
787 +@@ -1260,7 +1260,7 @@ The following setup can be done before any of the following examples:
788 + # search ids as arguments
789 + my $pid = $gnupg->list_public_keys( handles => $handles,
790 + command_args => [ @ids ] );
791 +-
792 ++
793 + waitpid $pid, 0;
794 +
795 + =head2 Creating GnuPG::PublicKey Objects
796 +@@ -1280,7 +1280,7 @@ The following setup can be done before any of the following examples:
797 + command_args => [ qw( test/key.1.asc ) ],
798 + handles => $handles,
799 + );
800 +-
801 ++
802 + my @out = <$handles->stdout()>;
803 + waitpid $pid, 0;
804 +
805 +@@ -1357,7 +1357,7 @@ under the same terms as Perl itself.
806 +
807 + =head1 AUTHOR
808 +
809 +-GnuPg::Interface is currently maintained by Jesse Vincent <jesse@××××.org>.
810 ++GnuPg::Interface is currently maintained by Jesse Vincent <jesse@××××.org>.
811 +
812 + Frank J. Tobin, ftobin@××××.org was the original author of the package.
813 +
814
815 diff --git a/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0010-fix-capitalization-of-GnuPG.patch b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0010-fix-capitalization-of-GnuPG.patch
816 new file mode 100644
817 index 00000000000..f55d4b15942
818 --- /dev/null
819 +++ b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0010-fix-capitalization-of-GnuPG.patch
820 @@ -0,0 +1,35 @@
821 +From: Daniel Kahn Gillmor <dkg@×××××××××××××.net>
822 +Date: Tue, 11 Oct 2016 19:52:58 -0400
823 +Subject: fix capitalization of GnuPG
824 +
825 +---
826 + README | 2 +-
827 + lib/GnuPG/Interface.pm | 2 +-
828 + 2 files changed, 2 insertions(+), 2 deletions(-)
829 +
830 +diff --git a/README b/README
831 +index f457577..aa7c984 100644
832 +--- a/README
833 ++++ b/README
834 +@@ -427,7 +427,7 @@ LICENSE
835 + under the same terms as Perl itself.
836 +
837 + AUTHOR
838 +- GnuPg::Interface is currently maintained by Jesse Vincent
839 ++ GnuPG::Interface is currently maintained by Jesse Vincent
840 + <jesse@××××.org>.
841 +
842 + Frank J. Tobin, ftobin@××××.org was the original author of the package.
843 +diff --git a/lib/GnuPG/Interface.pm b/lib/GnuPG/Interface.pm
844 +index 19e8070..cf7138f 100644
845 +--- a/lib/GnuPG/Interface.pm
846 ++++ b/lib/GnuPG/Interface.pm
847 +@@ -1357,7 +1357,7 @@ under the same terms as Perl itself.
848 +
849 + =head1 AUTHOR
850 +
851 +-GnuPg::Interface is currently maintained by Jesse Vincent <jesse@××××.org>.
852 ++GnuPG::Interface is currently maintained by Jesse Vincent <jesse@××××.org>.
853 +
854 + Frank J. Tobin, ftobin@××××.org was the original author of the package.
855 +
856
857 diff --git a/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0011-ommand_args-should-be-command_args.patch b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0011-ommand_args-should-be-command_args.patch
858 new file mode 100644
859 index 00000000000..a9ab737aa04
860 --- /dev/null
861 +++ b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0011-ommand_args-should-be-command_args.patch
862 @@ -0,0 +1,21 @@
863 +From: Daniel Kahn Gillmor <dkg@×××××××××××××.net>
864 +Date: Tue, 11 Oct 2016 19:57:10 -0400
865 +Subject: ommand_args should be command_args
866 +
867 +---
868 + t/list_public_keys.t | 2 +-
869 + 1 file changed, 1 insertion(+), 1 deletion(-)
870 +
871 +diff --git a/t/list_public_keys.t b/t/list_public_keys.t
872 +index 7e563c1..a36a78b 100644
873 +--- a/t/list_public_keys.t
874 ++++ b/t/list_public_keys.t
875 +@@ -38,7 +38,7 @@ TEST
876 + reset_handles();
877 +
878 + my $pid = $gnupg->list_public_keys( handles => $handles,
879 +- ommand_args => '0xF950DA9C'
880 ++ command_args => '0xF950DA9C'
881 + );
882 + close $stdin;
883 +
884
885 diff --git a/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0012-use-fingerprints-as-inputs-during-tests-to-demonstra.patch b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0012-use-fingerprints-as-inputs-during-tests-to-demonstra.patch
886 new file mode 100644
887 index 00000000000..9694e0854ce
888 --- /dev/null
889 +++ b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0012-use-fingerprints-as-inputs-during-tests-to-demonstra.patch
890 @@ -0,0 +1,265 @@
891 +From: Daniel Kahn Gillmor <dkg@×××××××××××××.net>
892 +Date: Tue, 11 Oct 2016 20:05:16 -0400
893 +Subject: use fingerprints as inputs during tests to demonstrate explicit usage
894 +
895 +---
896 + README | 6 +++---
897 + lib/GnuPG/Interface.pm | 6 +++---
898 + lib/GnuPG/Options.pm | 2 +-
899 + t/MyTestSpecific.pm | 2 +-
900 + t/encrypt.t | 6 +++---
901 + t/export_keys.t | 4 ++--
902 + t/get_public_keys.t | 2 +-
903 + t/get_secret_keys.t | 2 +-
904 + t/list_public_keys.t | 4 ++--
905 + t/list_secret_keys.t | 4 ++--
906 + t/list_sigs.t | 4 ++--
907 + t/sign_and_encrypt.t | 2 +-
908 + 12 files changed, 22 insertions(+), 22 deletions(-)
909 +
910 +diff --git a/README b/README
911 +index aa7c984..ed94ede 100644
912 +--- a/README
913 ++++ b/README
914 +@@ -228,7 +228,7 @@ EXAMPLES
915 +
916 + $gnupg->options->hash_init( armor => 1,
917 + recipients => [ 'ftobin@××××.edu',
918 +- '0xABCD1234' ],
919 ++ '0xABCD1234ABCD1234ABCD1234ABCD1234ABCD1234' ],
920 + meta_interactive => 0 ,
921 + );
922 +
923 +@@ -347,7 +347,7 @@ EXAMPLES
924 + # and read from our input, because no input is needed!
925 + my $handles = GnuPG::Handles->new();
926 +
927 +- my @ids = ( 'ftobin', '0xABCD1234' );
928 ++ my @ids = ( 'ftobin', '0xABCD1234ABCD1234ABCD1234ABCD1234ABCD1234' );
929 +
930 + # this time we need to specify something for
931 + # command_args because --list-public-keys takes
932 +@@ -358,7 +358,7 @@ EXAMPLES
933 + waitpid $pid, 0;
934 +
935 + Creating GnuPG::PublicKey Objects
936 +- my @ids = [ 'ftobin', '0xABCD1234' ];
937 ++ my @ids = [ 'ftobin', '0xABCD1234ABCD1234ABCD1234ABCD1234ABCD1234' ];
938 +
939 + my @keys = $gnupg->get_public_keys( @ids );
940 +
941 +diff --git a/lib/GnuPG/Interface.pm b/lib/GnuPG/Interface.pm
942 +index cf7138f..6eaef7d 100644
943 +--- a/lib/GnuPG/Interface.pm
944 ++++ b/lib/GnuPG/Interface.pm
945 +@@ -1130,7 +1130,7 @@ The following setup can be done before any of the following examples:
946 +
947 + $gnupg->options->hash_init( armor => 1,
948 + recipients => [ 'ftobin@××××.edu',
949 +- '0xABCD1234' ],
950 ++ '0xABCD1234ABCD1234ABCD1234ABCD1234ABCD1234' ],
951 + meta_interactive => 0 ,
952 + );
953 +
954 +@@ -1253,7 +1253,7 @@ The following setup can be done before any of the following examples:
955 + # and read from our input, because no input is needed!
956 + my $handles = GnuPG::Handles->new();
957 +
958 +- my @ids = ( 'ftobin', '0xABCD1234' );
959 ++ my @ids = ( 'ftobin', '0xABCD1234ABCD1234ABCD1234ABCD1234ABCD1234' );
960 +
961 + # this time we need to specify something for
962 + # command_args because --list-public-keys takes
963 +@@ -1265,7 +1265,7 @@ The following setup can be done before any of the following examples:
964 +
965 + =head2 Creating GnuPG::PublicKey Objects
966 +
967 +- my @ids = [ 'ftobin', '0xABCD1234' ];
968 ++ my @ids = [ 'ftobin', '0xABCD1234ABCD1234ABCD1234ABCD1234ABCD1234' ];
969 +
970 + my @keys = $gnupg->get_public_keys( @ids );
971 +
972 +diff --git a/lib/GnuPG/Options.pm b/lib/GnuPG/Options.pm
973 +index 86261a0..7788662 100644
974 +--- a/lib/GnuPG/Options.pm
975 ++++ b/lib/GnuPG/Options.pm
976 +@@ -198,7 +198,7 @@ GnuPG::Options - GnuPG options embodiment
977 +
978 + # assuming $gnupg is a GnuPG::Interface object
979 + $gnupg->options->armor( 1 );
980 +- $gnupg->options->push_recipients( 'ftobin', '0xABCD1234' );
981 ++ $gnupg->options->push_recipients( 'ftobin', '0xABCD1234ABCD1234ABCD1234ABCD1234ABCD1234' );
982 +
983 + =head1 DESCRIPTION
984 +
985 +diff --git a/t/MyTestSpecific.pm b/t/MyTestSpecific.pm
986 +index a309698..c8764cc 100644
987 +--- a/t/MyTestSpecific.pm
988 ++++ b/t/MyTestSpecific.pm
989 +@@ -46,7 +46,7 @@ $gpg_is_modern = ($version[0] > 2 || ($version[0] == 2 && $version[1] >= 1));
990 + $gnupg->options->hash_init( homedir => 'test/gnupghome',
991 + armor => 1,
992 + meta_interactive => 0,
993 +- meta_signing_key_id => '0xF950DA9C',
994 ++ meta_signing_key_id => '0x93AFC4B1B0288A104996B44253AE596EF950DA9C',
995 + always_trust => 1,
996 + );
997 +
998 +diff --git a/t/encrypt.t b/t/encrypt.t
999 +index 3183ac4..e6bdc08 100644
1000 +--- a/t/encrypt.t
1001 ++++ b/t/encrypt.t
1002 +@@ -27,7 +27,7 @@ TEST
1003 +
1004 + $gnupg->options->clear_recipients();
1005 + $gnupg->options->clear_meta_recipients_keys();
1006 +- $gnupg->options->push_recipients( '0x2E854A6B' );
1007 ++ $gnupg->options->push_recipients( '0x7466B7E98C4CCB64C2CE738BADB99D9C2E854A6B' );
1008 +
1009 + my $pid = $gnupg->encrypt( handles => $handles );
1010 +
1011 +@@ -43,7 +43,7 @@ TEST
1012 + {
1013 + reset_handles();
1014 +
1015 +- my @keys = $gnupg->get_public_keys( '0xF950DA9C' );
1016 ++ my @keys = $gnupg->get_public_keys( '0x93AFC4B1B0288A104996B44253AE596EF950DA9C' );
1017 + $gnupg->options->clear_recipients();
1018 + $gnupg->options->clear_meta_recipients_keys();
1019 + $gnupg->options->push_meta_recipients_keys( @keys );
1020 +@@ -64,7 +64,7 @@ TEST
1021 +
1022 + $gnupg->options->clear_recipients();
1023 + $gnupg->options->clear_meta_recipients_keys();
1024 +- $gnupg->options->push_recipients( '0x2E854A6B' );
1025 ++ $gnupg->options->push_recipients( '0x7466B7E98C4CCB64C2CE738BADB99D9C2E854A6B' );
1026 +
1027 + $handles->stdin( $texts{plain}->fh() );
1028 + $handles->options( 'stdin' )->{direct} = 1;
1029 +diff --git a/t/export_keys.t b/t/export_keys.t
1030 +index cf5c82b..5add064 100644
1031 +--- a/t/export_keys.t
1032 ++++ b/t/export_keys.t
1033 +@@ -15,7 +15,7 @@ TEST
1034 + reset_handles();
1035 +
1036 + my $pid = $gnupg->export_keys( handles => $handles,
1037 +- command_args => '0xF950DA9C' );
1038 ++ command_args => '0x93AFC4B1B0288A104996B44253AE596EF950DA9C' );
1039 + close $stdin;
1040 + waitpid $pid, 0;
1041 +
1042 +@@ -31,7 +31,7 @@ TEST
1043 + $handles->options( 'stdout' )->{direct} = 1;
1044 +
1045 + my $pid = $gnupg->export_keys( handles => $handles,
1046 +- command_args => '0xF950DA9C' );
1047 ++ command_args => '0x93AFC4B1B0288A104996B44253AE596EF950DA9C' );
1048 + waitpid $pid, 0;
1049 + return $CHILD_ERROR == 0;
1050 + };
1051 +diff --git a/t/get_public_keys.t b/t/get_public_keys.t
1052 +index 9e96f7d..7893625 100644
1053 +--- a/t/get_public_keys.t
1054 ++++ b/t/get_public_keys.t
1055 +@@ -19,7 +19,7 @@ TEST
1056 + {
1057 + reset_handles();
1058 +
1059 +- my @returned_keys = $gnupg->get_public_keys_with_sigs( '0xF950DA9C' );
1060 ++ my @returned_keys = $gnupg->get_public_keys_with_sigs( '0x93AFC4B1B0288A104996B44253AE596EF950DA9C' );
1061 +
1062 + return 0 unless @returned_keys == 1;
1063 +
1064 +diff --git a/t/get_secret_keys.t b/t/get_secret_keys.t
1065 +index c798cce..a7f1348 100644
1066 +--- a/t/get_secret_keys.t
1067 ++++ b/t/get_secret_keys.t
1068 +@@ -18,7 +18,7 @@ TEST
1069 + {
1070 + reset_handles();
1071 +
1072 +- my @returned_keys = $gnupg->get_secret_keys( '0xF950DA9C' );
1073 ++ my @returned_keys = $gnupg->get_secret_keys( '0x93AFC4B1B0288A104996B44253AE596EF950DA9C' );
1074 +
1075 + return 0 unless @returned_keys == 1;
1076 +
1077 +diff --git a/t/list_public_keys.t b/t/list_public_keys.t
1078 +index a36a78b..622b092 100644
1079 +--- a/t/list_public_keys.t
1080 ++++ b/t/list_public_keys.t
1081 +@@ -38,7 +38,7 @@ TEST
1082 + reset_handles();
1083 +
1084 + my $pid = $gnupg->list_public_keys( handles => $handles,
1085 +- command_args => '0xF950DA9C'
1086 ++ command_args => '0x93AFC4B1B0288A104996B44253AE596EF950DA9C'
1087 + );
1088 + close $stdin;
1089 +
1090 +@@ -64,7 +64,7 @@ TEST
1091 + $handles->options( 'stdout' )->{direct} = 1;
1092 +
1093 + my $pid = $gnupg->list_public_keys( handles => $handles,
1094 +- command_args => '0xF950DA9C',
1095 ++ command_args => '0x93AFC4B1B0288A104996B44253AE596EF950DA9C',
1096 + );
1097 +
1098 + waitpid $pid, 0;
1099 +diff --git a/t/list_secret_keys.t b/t/list_secret_keys.t
1100 +index 51e3651..7040c38 100644
1101 +--- a/t/list_secret_keys.t
1102 ++++ b/t/list_secret_keys.t
1103 +@@ -55,7 +55,7 @@ TEST
1104 + reset_handles();
1105 +
1106 + my $pid = $gnupg->list_secret_keys( handles => $handles,
1107 +- command_args => '0xF950DA9C' );
1108 ++ command_args => '0x93AFC4B1B0288A104996B44253AE596EF950DA9C' );
1109 + close $stdin;
1110 +
1111 + $outfile = 'test/secret-keys/2.out';
1112 +@@ -80,7 +80,7 @@ TEST
1113 + $handles->options( 'stdout' )->{direct} = 1;
1114 +
1115 + my $pid = $gnupg->list_secret_keys( handles => $handles,
1116 +- command_args => '0xF950DA9C' );
1117 ++ command_args => '0x93AFC4B1B0288A104996B44253AE596EF950DA9C' );
1118 +
1119 + waitpid $pid, 0;
1120 +
1121 +diff --git a/t/list_sigs.t b/t/list_sigs.t
1122 +index 16cfa6a..1301fb2 100644
1123 +--- a/t/list_sigs.t
1124 ++++ b/t/list_sigs.t
1125 +@@ -36,7 +36,7 @@ TEST
1126 + reset_handles();
1127 +
1128 + my $pid = $gnupg->list_sigs( handles => $handles,
1129 +- command_args => '0xF950DA9C',
1130 ++ command_args => '0x93AFC4B1B0288A104996B44253AE596EF950DA9C',
1131 + );
1132 + close $stdin;
1133 +
1134 +@@ -60,7 +60,7 @@ TEST
1135 + $handles->options( 'stdout' )->{direct} = 1;
1136 +
1137 + my $pid = $gnupg->list_sigs( handles => $handles,
1138 +- command_args => '0xF950DA9C',
1139 ++ command_args => '0x93AFC4B1B0288A104996B44253AE596EF950DA9C',
1140 + );
1141 +
1142 + waitpid $pid, 0;
1143 +diff --git a/t/sign_and_encrypt.t b/t/sign_and_encrypt.t
1144 +index 5dc1c08..df0fc75 100644
1145 +--- a/t/sign_and_encrypt.t
1146 ++++ b/t/sign_and_encrypt.t
1147 +@@ -14,7 +14,7 @@ TEST
1148 + {
1149 + reset_handles();
1150 +
1151 +- $gnupg->options->push_recipients( '0x2E854A6B' );
1152 ++ $gnupg->options->push_recipients( '0x7466B7E98C4CCB64C2CE738BADB99D9C2E854A6B' );
1153 + my $pid = $gnupg->sign_and_encrypt( handles => $handles );
1154 +
1155 + print $stdin @{ $texts{plain}->data() };
1156
1157 diff --git a/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0013-move-key-files-to-generic-names.patch b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0013-move-key-files-to-generic-names.patch
1158 new file mode 100644
1159 index 00000000000..489e685b7b8
1160 --- /dev/null
1161 +++ b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0013-move-key-files-to-generic-names.patch
1162 @@ -0,0 +1,33 @@
1163 +From: Daniel Kahn Gillmor <dkg@×××××××××××××.net>
1164 +Date: Tue, 11 Oct 2016 20:17:49 -0400
1165 +Subject: move key files to generic names
1166 +
1167 +---
1168 + t/000_setup.t | 2 +-
1169 + test/{pubring.gpg => public_keys.pgp} | Bin
1170 + test/{secring.gpg => secret_keys.pgp} | Bin
1171 + 3 files changed, 1 insertion(+), 1 deletion(-)
1172 + rename test/{pubring.gpg => public_keys.pgp} (100%)
1173 + rename test/{secring.gpg => secret_keys.pgp} (100%)
1174 +
1175 +diff --git a/t/000_setup.t b/t/000_setup.t
1176 +index 7f7f7b0..a8e3042 100644
1177 +--- a/t/000_setup.t
1178 ++++ b/t/000_setup.t
1179 +@@ -19,7 +19,7 @@ TEST
1180 + copy('test/gpg.conf', 'test/gnupghome/gpg.conf');
1181 + reset_handles();
1182 +
1183 +- my $pid = $gnupg->import_keys(command_args => [ 'test/pubring.gpg', 'test/secring.gpg' ],
1184 ++ my $pid = $gnupg->import_keys(command_args => [ 'test/public_keys.pgp', 'test/secret_keys.pgp' ],
1185 + options => [ 'batch'],
1186 + handles => $handles);
1187 + waitpid $pid, 0;
1188 +diff --git a/test/pubring.gpg b/test/public_keys.pgp
1189 +similarity index 100%
1190 +rename from test/pubring.gpg
1191 +rename to test/public_keys.pgp
1192 +diff --git a/test/secring.gpg b/test/secret_keys.pgp
1193 +similarity index 100%
1194 +rename from test/secring.gpg
1195 +rename to test/secret_keys.pgp
1196
1197 diff --git a/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0014-fix-spelling-s-convience-convenience.patch b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0014-fix-spelling-s-convience-convenience.patch
1198 new file mode 100644
1199 index 00000000000..ee809b61d75
1200 --- /dev/null
1201 +++ b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0014-fix-spelling-s-convience-convenience.patch
1202 @@ -0,0 +1,53 @@
1203 +From: Daniel Kahn Gillmor <dkg@×××××××××××××.net>
1204 +Date: Tue, 11 Oct 2016 20:25:48 -0400
1205 +Subject: fix spelling: s/convience/convenience/
1206 +
1207 +---
1208 + README | 4 ++--
1209 + lib/GnuPG/Interface.pm | 4 ++--
1210 + 2 files changed, 4 insertions(+), 4 deletions(-)
1211 +
1212 +diff --git a/README b/README
1213 +index ed94ede..a05ef9b 100644
1214 +--- a/README
1215 ++++ b/README
1216 +@@ -143,7 +143,7 @@ OBJECT METHODS
1217 + does not come into play. If the passphrase data member handle of the
1218 + handles object is not defined, but the the passphrase data member
1219 + handle of GnuPG::Interface object is, GnuPG::Interface will handle
1220 +- passing this information into GnuPG for the user as a convience.
1221 ++ passing this information into GnuPG for the user as a convenience.
1222 + Note that this will result in GnuPG::Interface storing the
1223 + passphrase in memory, instead of having it simply 'pass-through' to
1224 + GnuPG via a handle.
1225 +@@ -271,7 +271,7 @@ EXAMPLES
1226 + );
1227 +
1228 + # indicate our pasphrase through the
1229 +- # convience method
1230 ++ # convenience method
1231 + $gnupg->passphrase( $passphrase );
1232 +
1233 + # this sets up the communication
1234 +diff --git a/lib/GnuPG/Interface.pm b/lib/GnuPG/Interface.pm
1235 +index 6eaef7d..29205f0 100644
1236 +--- a/lib/GnuPG/Interface.pm
1237 ++++ b/lib/GnuPG/Interface.pm
1238 +@@ -1008,7 +1008,7 @@ and so this information is not generated and does not come into play.
1239 + If the B<passphrase> data member handle of the B<handles> object
1240 + is not defined, but the the B<passphrase> data member handle of GnuPG::Interface
1241 + object is, GnuPG::Interface will handle passing this information into GnuPG
1242 +-for the user as a convience. Note that this will result in
1243 ++for the user as a convenience. Note that this will result in
1244 + GnuPG::Interface storing the passphrase in memory, instead of having
1245 + it simply 'pass-through' to GnuPG via a handle.
1246 +
1247 +@@ -1175,7 +1175,7 @@ The following setup can be done before any of the following examples:
1248 + );
1249 +
1250 + # indicate our pasphrase through the
1251 +- # convience method
1252 ++ # convenience method
1253 + $gnupg->passphrase( $passphrase );
1254 +
1255 + # this sets up the communication
1256
1257 diff --git a/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0015-added-new-secret-key-with-different-passphrase.patch b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0015-added-new-secret-key-with-different-passphrase.patch
1258 new file mode 100644
1259 index 00000000000..fcf20c1b9d1
1260 --- /dev/null
1261 +++ b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0015-added-new-secret-key-with-different-passphrase.patch
1262 @@ -0,0 +1,117 @@
1263 +From: Daniel Kahn Gillmor <dkg@×××××××××××××.net>
1264 +Date: Tue, 11 Oct 2016 20:59:43 -0400
1265 +Subject: added new secret key with different passphrase
1266 +
1267 +Adding a new secret key with a different passphrase should allow us to
1268 +differentiate between passing the passphrase explicitly and relying on
1269 +the agent + pinentry.
1270 +---
1271 + t/000_setup.t | 2 +-
1272 + test/new_secret.pgp | 58 ++++++++++++++++++++++++++++++++++++++++++
1273 + test/secret-keys/1.0.test | 4 +++
1274 + test/secret-keys/1.modern.test | 5 ++++
1275 + 4 files changed, 68 insertions(+), 1 deletion(-)
1276 + create mode 100644 test/new_secret.pgp
1277 +
1278 +diff --git a/t/000_setup.t b/t/000_setup.t
1279 +index a8e3042..b183241 100644
1280 +--- a/t/000_setup.t
1281 ++++ b/t/000_setup.t
1282 +@@ -19,7 +19,7 @@ TEST
1283 + copy('test/gpg.conf', 'test/gnupghome/gpg.conf');
1284 + reset_handles();
1285 +
1286 +- my $pid = $gnupg->import_keys(command_args => [ 'test/public_keys.pgp', 'test/secret_keys.pgp' ],
1287 ++ my $pid = $gnupg->import_keys(command_args => [ 'test/public_keys.pgp', 'test/secret_keys.pgp', 'test/new_secret.pgp' ],
1288 + options => [ 'batch'],
1289 + handles => $handles);
1290 + waitpid $pid, 0;
1291 +diff --git a/test/new_secret.pgp b/test/new_secret.pgp
1292 +new file mode 100644
1293 +index 0000000..5feb72c
1294 +--- /dev/null
1295 ++++ b/test/new_secret.pgp
1296 +@@ -0,0 +1,58 @@
1297 ++-----BEGIN PGP PRIVATE KEY BLOCK-----
1298 ++
1299 ++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
1353 ++=ftgB
1354 ++-----END PGP PRIVATE KEY BLOCK-----
1355 +diff --git a/test/secret-keys/1.0.test b/test/secret-keys/1.0.test
1356 +index 129d472..f8239a9 100644
1357 +--- a/test/secret-keys/1.0.test
1358 ++++ b/test/secret-keys/1.0.test
1359 +@@ -5,3 +5,7 @@ uid GnuPG test key (for testing purposes only)
1360 + uid Foo Bar (1)
1361 + ssb 768g/2E854A6B 2000-02-06
1362 +
1363 ++sec 2048R/B6747DDC 2016-10-12
1364 ++uid GnuPG::Interface Test key <test@×××××××.org>
1365 ++ssb 2048R/AE441D0F 2016-10-12
1366 ++
1367 +diff --git a/test/secret-keys/1.modern.test b/test/secret-keys/1.modern.test
1368 +index 3e46407..42b27a1 100644
1369 +--- a/test/secret-keys/1.modern.test
1370 ++++ b/test/secret-keys/1.modern.test
1371 +@@ -6,3 +6,8 @@ uid [ unknown] GnuPG test key (for testing purposes only)
1372 + uid [ unknown] Foo Bar (1)
1373 + ssb elg768 2000-02-06 [E]
1374 +
1375 ++sec rsa2048 2016-10-12 [SC]
1376 ++ 278F850AA702911F1318F0A61B913CE9B6747DDC
1377 ++uid [ unknown] GnuPG::Interface Test key <test@×××××××.org>
1378 ++ssb rsa2048 2016-10-12 [E]
1379 ++
1380
1381 diff --git a/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0016-Test-use-of-gpg-without-explicit-passphrase-agent-pi.patch b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0016-Test-use-of-gpg-without-explicit-passphrase-agent-pi.patch
1382 new file mode 100644
1383 index 00000000000..21e6294efae
1384 --- /dev/null
1385 +++ b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0016-Test-use-of-gpg-without-explicit-passphrase-agent-pi.patch
1386 @@ -0,0 +1,302 @@
1387 +From: Daniel Kahn Gillmor <dkg@×××××××××××××.net>
1388 +Date: Tue, 11 Oct 2016 21:29:22 -0400
1389 +Subject: Test use of gpg without explicit passphrase (agent+pinentry)
1390 +
1391 +The modern GnuPG suite encourages the use of gpg-agent to control
1392 +access to secret key material. In this use case, we avoid setting an
1393 +explicit passphrase in code, and rely on either a correctly-configured
1394 +and primed gpg-agent or a dedicated pinentry program to supply the
1395 +passphrase.
1396 +
1397 +This additional test verifies that the passphrase can be handled by
1398 +the agent. Note that the passphrase for this additional test key is
1399 +*not* the default passphrase, so this test should fail in the event
1400 +that gpg can't use the agent and the pinentry for this task.
1401 +
1402 +Unfortunately, this all assumes that we're using GnuPG "Modern". I've
1403 +noted concerns about writing forward- and backward-compatible bindings
1404 +for GnuPG here:
1405 +https://lists.gnupg.org/pipermail/gnupg-devel/2016-October/031800.html
1406 +---
1407 + README | 41 +++++++++++++++++++++++++++--------------
1408 + lib/GnuPG/Interface.pm | 26 +++++++++++++++++++++++++-
1409 + t/MyTestSpecific.pm | 10 ++++++++--
1410 + t/decrypt.t | 27 +++++++++++++++++++++++++++
1411 + test/encrypted.2.gpg | 12 ++++++++++++
1412 + test/fake-pinentry.pl | 2 +-
1413 + test/plain.2.txt | 1 +
1414 + 7 files changed, 101 insertions(+), 18 deletions(-)
1415 + create mode 100644 test/encrypted.2.gpg
1416 + create mode 100644 test/plain.2.txt
1417 +
1418 +diff --git a/README b/README
1419 +index a05ef9b..be06ef3 100644
1420 +--- a/README
1421 ++++ b/README
1422 +@@ -5,7 +5,7 @@ SYNOPSIS
1423 + # A simple example
1424 + use IO::Handle;
1425 + use GnuPG::Interface;
1426 +-
1427 ++
1428 + # setting up the situation
1429 + my $gnupg = GnuPG::Interface->new();
1430 + $gnupg->options->hash_init( armor => 1,
1431 +@@ -24,7 +24,7 @@ SYNOPSIS
1432 + # Now we'll go about encrypting with the options already set
1433 + my @plaintext = ( 'foobar' );
1434 + my $pid = $gnupg->encrypt( handles => $handles );
1435 +-
1436 ++
1437 + # Now we write to the input of GnuPG
1438 + print $input @plaintext;
1439 + close $input;
1440 +@@ -140,13 +140,26 @@ OBJECT METHODS
1441 + standard error, standard output, or standard error. If the status or
1442 + logger handle is not defined, this channel of communication is never
1443 + established with GnuPG, and so this information is not generated and
1444 +- does not come into play. If the passphrase data member handle of the
1445 +- handles object is not defined, but the the passphrase data member
1446 +- handle of GnuPG::Interface object is, GnuPG::Interface will handle
1447 +- passing this information into GnuPG for the user as a convenience.
1448 +- Note that this will result in GnuPG::Interface storing the
1449 +- passphrase in memory, instead of having it simply 'pass-through' to
1450 +- GnuPG via a handle.
1451 ++ does not come into play.
1452 ++
1453 ++ If the passphrase data member handle of the handles object is not
1454 ++ defined, but the the passphrase data member handle of
1455 ++ GnuPG::Interface object is, GnuPG::Interface will handle passing
1456 ++ this information into GnuPG for the user as a convenience. Note that
1457 ++ this will result in GnuPG::Interface storing the passphrase in
1458 ++ memory, instead of having it simply 'pass-through' to GnuPG via a
1459 ++ handle.
1460 ++
1461 ++ If neither the passphrase data member of the GnuPG::Interface nor
1462 ++ the passphrase data member of the handles object is defined, then
1463 ++ GnuPG::Interface assumes that access and control over the secret key
1464 ++ will be handled by the running gpg-agent process. This represents
1465 ++ the simplest mode of operation with the GnuPG "modern" suite
1466 ++ (version 2.1 and later). It is also the preferred mode for tools
1467 ++ intended to be user-facing, since the user will be prompted directly
1468 ++ by gpg-agent for use of the secret key material. Note that for
1469 ++ programmatic use, this mode requires the gpg-agent and pinentry to
1470 ++ already be correctly configured.
1471 +
1472 + Other Methods
1473 + get_public_keys( @search_strings )
1474 +@@ -241,7 +254,7 @@ EXAMPLES
1475 +
1476 + my $handles = GnuPG::Handles->new( stdin => $input,
1477 + stdout => $output );
1478 +-
1479 ++
1480 + # this sets up the communication
1481 + # Note that the recipients were specified earlier
1482 + # in the 'options' data member of the $gnupg object.
1483 +@@ -315,7 +328,7 @@ EXAMPLES
1484 + # a file written to disk
1485 + # Make sure you "use IO::File" if you use this module!
1486 + my $cipher_file = IO::File->new( 'encrypted.gpg' );
1487 +-
1488 ++
1489 + # this sets up the communication
1490 + my $pid = $gnupg->decrypt( handles => $handles );
1491 +
1492 +@@ -346,7 +359,7 @@ EXAMPLES
1493 + # This time we'll just let GnuPG print to our own output
1494 + # and read from our input, because no input is needed!
1495 + my $handles = GnuPG::Handles->new();
1496 +-
1497 ++
1498 + my @ids = ( 'ftobin', '0xABCD1234ABCD1234ABCD1234ABCD1234ABCD1234' );
1499 +
1500 + # this time we need to specify something for
1501 +@@ -354,7 +367,7 @@ EXAMPLES
1502 + # search ids as arguments
1503 + my $pid = $gnupg->list_public_keys( handles => $handles,
1504 + command_args => [ @ids ] );
1505 +-
1506 ++
1507 + waitpid $pid, 0;
1508 +
1509 + Creating GnuPG::PublicKey Objects
1510 +@@ -372,7 +385,7 @@ EXAMPLES
1511 + command_args => [ qw( test/key.1.asc ) ],
1512 + handles => $handles,
1513 + );
1514 +-
1515 ++
1516 + my @out = <$handles->stdout()>;
1517 + waitpid $pid, 0;
1518 +
1519 +diff --git a/lib/GnuPG/Interface.pm b/lib/GnuPG/Interface.pm
1520 +index 29205f0..5d8b0ec 100644
1521 +--- a/lib/GnuPG/Interface.pm
1522 ++++ b/lib/GnuPG/Interface.pm
1523 +@@ -106,6 +106,14 @@ sub fork_attach_exec( $% ) {
1524 + my ( $self, %args ) = @_;
1525 +
1526 + my $handles = $args{handles} or croak 'no GnuPG::Handles passed';
1527 ++ my $use_loopback_pinentry = 0;
1528 ++
1529 ++ # WARNING: this assumes that we're using the "modern" GnuPG suite
1530 ++ # -- version 2.1.x or later. It's not clear to me how we can
1531 ++ # safely and efficiently avoid this assumption (see
1532 ++ # https://lists.gnupg.org/pipermail/gnupg-devel/2016-October/031800.html)
1533 ++ $use_loopback_pinentry = 1
1534 ++ if ($handles->passphrase());
1535 +
1536 + # deprecation support
1537 + $args{commands} ||= $args{gnupg_commands};
1538 +@@ -293,8 +301,12 @@ sub fork_attach_exec( $% ) {
1539 + $self->options->$option($fileno);
1540 + }
1541 +
1542 ++ my @args = $self->options->get_args();
1543 ++ push @args, '--pinentry-mode', 'loopback'
1544 ++ if $use_loopback_pinentry;
1545 ++
1546 + my @command = (
1547 +- $self->call(), $self->options->get_args(),
1548 ++ $self->call(), @args,
1549 + @commands, @command_args
1550 + );
1551 +
1552 +@@ -1005,6 +1017,7 @@ and standard error will be tied to the running program's standard error,
1553 + standard output, or standard error. If the B<status> or B<logger> handle
1554 + is not defined, this channel of communication is never established with GnuPG,
1555 + and so this information is not generated and does not come into play.
1556 ++
1557 + If the B<passphrase> data member handle of the B<handles> object
1558 + is not defined, but the the B<passphrase> data member handle of GnuPG::Interface
1559 + object is, GnuPG::Interface will handle passing this information into GnuPG
1560 +@@ -1012,6 +1025,17 @@ for the user as a convenience. Note that this will result in
1561 + GnuPG::Interface storing the passphrase in memory, instead of having
1562 + it simply 'pass-through' to GnuPG via a handle.
1563 +
1564 ++If neither the B<passphrase> data member of the GnuPG::Interface nor
1565 ++the B<passphrase> data member of the B<handles> object is defined,
1566 ++then GnuPG::Interface assumes that access and control over the secret
1567 ++key will be handled by the running gpg-agent process. This represents
1568 ++the simplest mode of operation with the GnuPG "modern" suite (version
1569 ++2.1 and later). It is also the preferred mode for tools intended to
1570 ++be user-facing, since the user will be prompted directly by gpg-agent
1571 ++for use of the secret key material. Note that for programmatic use,
1572 ++this mode requires the gpg-agent and pinentry to already be correctly
1573 ++configured.
1574 ++
1575 + =back
1576 +
1577 + =head2 Other Methods
1578 +diff --git a/t/MyTestSpecific.pm b/t/MyTestSpecific.pm
1579 +index c8764cc..e513c25 100644
1580 +--- a/t/MyTestSpecific.pm
1581 ++++ b/t/MyTestSpecific.pm
1582 +@@ -55,9 +55,15 @@ struct( Text => { fn => "\$", fh => "\$", data => "\$" } );
1583 + $texts{plain} = Text->new();
1584 + $texts{plain}->fn( 'test/plain.1.txt' );
1585 +
1586 ++$texts{alt_plain} = Text->new();
1587 ++$texts{alt_plain}->fn( 'test/plain.2.txt' );
1588 ++
1589 + $texts{encrypted} = Text->new();
1590 + $texts{encrypted}->fn( 'test/encrypted.1.gpg' );
1591 +
1592 ++$texts{alt_encrypted} = Text->new();
1593 ++$texts{alt_encrypted}->fn( 'test/encrypted.2.gpg' );
1594 ++
1595 + $texts{signed} = Text->new();
1596 + $texts{signed}->fn( 'test/signed.1.asc' );
1597 +
1598 +@@ -68,7 +74,7 @@ $texts{temp} = Text->new();
1599 + $texts{temp}->fn( 'test/temp' );
1600 +
1601 +
1602 +-foreach my $name ( qw( plain encrypted signed key ) )
1603 ++foreach my $name ( qw( plain alt_plain encrypted alt_encrypted signed key ) )
1604 + {
1605 + my $entry = $texts{$name};
1606 + my $filename = $entry->fn();
1607 +@@ -90,7 +96,7 @@ sub reset_handles
1608 + stderr => $stderr
1609 + );
1610 +
1611 +- foreach my $name ( qw( plain encrypted signed key ) )
1612 ++ foreach my $name ( qw( plain alt_plain encrypted alt_encrypted signed key ) )
1613 + {
1614 + my $entry = $texts{$name};
1615 + my $filename = $entry->fn();
1616 +diff --git a/t/decrypt.t b/t/decrypt.t
1617 +index b2639ed..ee41448 100644
1618 +--- a/t/decrypt.t
1619 ++++ b/t/decrypt.t
1620 +@@ -58,3 +58,30 @@ TEST
1621 + {
1622 + return compare( $texts{plain}->fn(), $texts{temp}->fn() ) == 0;
1623 + };
1624 ++
1625 ++
1626 ++# test without default_passphrase (that is, by using the agent)
1627 ++TEST
1628 ++{
1629 ++ reset_handles();
1630 ++
1631 ++ $handles->stdin( $texts{alt_encrypted}->fh() );
1632 ++ $handles->options( 'stdin' )->{direct} = 1;
1633 ++
1634 ++ $handles->stdout( $texts{temp}->fh() );
1635 ++ $handles->options( 'stdout' )->{direct} = 1;
1636 ++
1637 ++ $gnupg->clear_passphrase();
1638 ++
1639 ++ my $pid = $gnupg->decrypt( handles => $handles );
1640 ++
1641 ++ waitpid $pid, 0;
1642 ++
1643 ++ return $CHILD_ERROR == 0;
1644 ++};
1645 ++
1646 ++
1647 ++TEST
1648 ++{
1649 ++ return compare( $texts{alt_plain}->fn(), $texts{temp}->fn() ) == 0;
1650 ++};
1651 +diff --git a/test/encrypted.2.gpg b/test/encrypted.2.gpg
1652 +new file mode 100644
1653 +index 0000000..105cbb3
1654 +--- /dev/null
1655 ++++ b/test/encrypted.2.gpg
1656 +@@ -0,0 +1,12 @@
1657 ++-----BEGIN PGP MESSAGE-----
1658 ++
1659 ++hQEMAw3NS2KuRB0PAQgAuCMQO6blPRIJZib+kDa51gac+BYPl8caXYTLqIHtiz2/
1660 ++YRVqePJON4lNAqT6qUksIzQHtejFO6tb1SLqgX9Ti+fKAMLrQw9VGOYaJFoRrTJs
1661 +++X33S4GHVVikRTu0dydAsekbfPSc2nRmTFUlSEV3psgAmg9xy8KA6cZroK9Xfcuh
1662 ++xW7KLE0hLP+2NZ7zNmJMdu6LDGzvlQsnm1UeElXK8XdMGf8kA3R+GgeeOnR/oEQc
1663 ++Uep77k/fLc+UV4fp9Dk1OBeg3Ko/irSaefk4mU7F4HmS8jIERHRvXBTiur1Zx8Nx
1664 ++9U3fcQuc+P9+JC89iS4PJPF1Hr0MlezAghZYJrhOrtJIAe5Uaft5KMGRfy0VQnAs
1665 ++MHqGnGtzzVWK6GK83ibgG4tTfPEHHIgNFsJf3rM4cWklUmCS9TeeDJJZfhnRA6+/
1666 ++X82e6OI7QNbO
1667 ++=DlGE
1668 ++-----END PGP MESSAGE-----
1669 +diff --git a/test/fake-pinentry.pl b/test/fake-pinentry.pl
1670 +index 12d3611..40b8b08 100755
1671 +--- a/test/fake-pinentry.pl
1672 ++++ b/test/fake-pinentry.pl
1673 +@@ -21,7 +21,7 @@ while (<STDIN>) {
1674 + chomp;
1675 + next if (/^$/);
1676 + next if (/^#/);
1677 +- print ("D test\n") if (/^getpin/i);
1678 ++ print ("D supercalifragilisticexpialidocious\n") if (/^getpin/i);
1679 + print "OK\n";
1680 + exit if (/^bye/i);
1681 + }
1682 +diff --git a/test/plain.2.txt b/test/plain.2.txt
1683 +new file mode 100644
1684 +index 0000000..da5a1d5
1685 +--- /dev/null
1686 ++++ b/test/plain.2.txt
1687 +@@ -0,0 +1 @@
1688 ++test message
1689
1690 diff --git a/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0017-Kill-any-GnuPG-agent-before-and-after-the-test-suite.patch b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0017-Kill-any-GnuPG-agent-before-and-after-the-test-suite.patch
1691 new file mode 100644
1692 index 00000000000..2f20f145539
1693 --- /dev/null
1694 +++ b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0017-Kill-any-GnuPG-agent-before-and-after-the-test-suite.patch
1695 @@ -0,0 +1,42 @@
1696 +From: Daniel Kahn Gillmor <dkg@×××××××××××××.net>
1697 +Date: Thu, 25 May 2017 16:07:45 -0400
1698 +Subject: Kill any GnuPG agent before and after the test suite.
1699 +
1700 +This helps to ensure that the test suite daemon is started fresh at
1701 +every test suite run. And it also avoids leaving a daemon running
1702 +after the test suite, assuming the test suite manages to reach the
1703 +end.
1704 +
1705 +This is considered a reasonable practice by upstream.
1706 +---
1707 + t/000_setup.t | 3 +++
1708 + t/zzz_cleanup.t | 2 ++
1709 + 2 files changed, 5 insertions(+)
1710 +
1711 +diff --git a/t/000_setup.t b/t/000_setup.t
1712 +index b183241..4dc4329 100644
1713 +--- a/t/000_setup.t
1714 ++++ b/t/000_setup.t
1715 +@@ -17,6 +17,9 @@ TEST
1716 + $agentconf->write("pinentry-program " . getcwd() . "/test/fake-pinentry.pl\n");
1717 + $agentconf->close();
1718 + copy('test/gpg.conf', 'test/gnupghome/gpg.conf');
1719 ++ # reset the state of any long-lived gpg-agent, ignoring errors:
1720 ++ system('gpgconf', '--homedir=test/gnupghome', '--quiet', '--kill', 'gpg-agent');
1721 ++
1722 + reset_handles();
1723 +
1724 + my $pid = $gnupg->import_keys(command_args => [ 'test/public_keys.pgp', 'test/secret_keys.pgp', 'test/new_secret.pgp' ],
1725 +diff --git a/t/zzz_cleanup.t b/t/zzz_cleanup.t
1726 +index 5c03a72..eea3a48 100644
1727 +--- a/t/zzz_cleanup.t
1728 ++++ b/t/zzz_cleanup.t
1729 +@@ -12,6 +12,8 @@ use File::Path qw (remove_tree);
1730 + TEST
1731 + {
1732 + my $err = [];
1733 ++ # kill off any long-lived gpg-agent, ignoring errors:
1734 ++ system('gpgconf', '--homedir=test/gnupghome', '--quiet', '--kill', 'gpg-agent');
1735 + remove_tree('test/gnupghome', {error => \$err});
1736 + return ! @$err;
1737 + };
1738
1739 diff --git a/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0018-Use-a-short-temporary-homedir-during-the-test-suite.patch b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0018-Use-a-short-temporary-homedir-during-the-test-suite.patch
1740 new file mode 100644
1741 index 00000000000..457a5e74d53
1742 --- /dev/null
1743 +++ b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0018-Use-a-short-temporary-homedir-during-the-test-suite.patch
1744 @@ -0,0 +1,110 @@
1745 +From: Daniel Kahn Gillmor <dkg@×××××××××××××.net>
1746 +Date: Fri, 26 May 2017 09:51:40 -0400
1747 +Subject: Use a short temporary homedir during the test suite
1748 +
1749 +This avoids problems with the length of the path to the homedir as
1750 +compared to the size limits of sockaddr_un.sun_path, particularly on
1751 +systems where /run/user/$(id -u) is not present or available (such as
1752 +many minimalist build environments).
1753 +---
1754 + t/000_setup.t | 9 +++++----
1755 + t/MyTestSpecific.pm | 18 +++++++++++++++++-
1756 + t/list_secret_keys.t | 3 ++-
1757 + t/zzz_cleanup.t | 6 ++++--
1758 + 4 files changed, 28 insertions(+), 8 deletions(-)
1759 +
1760 +diff --git a/t/000_setup.t b/t/000_setup.t
1761 +index 4dc4329..82d7005 100644
1762 +--- a/t/000_setup.t
1763 ++++ b/t/000_setup.t
1764 +@@ -12,13 +12,14 @@ use File::Copy;
1765 +
1766 + TEST
1767 + {
1768 +- make_path('test/gnupghome', { mode => 0700 });
1769 +- my $agentconf = IO::File->new( "> test/gnupghome/gpg-agent.conf" );
1770 ++ my $homedir = $gnupg->options->homedir();
1771 ++ make_path($homedir, { mode => 0700 });
1772 ++ my $agentconf = IO::File->new( "> " . $homedir . "/gpg-agent.conf" );
1773 + $agentconf->write("pinentry-program " . getcwd() . "/test/fake-pinentry.pl\n");
1774 + $agentconf->close();
1775 +- copy('test/gpg.conf', 'test/gnupghome/gpg.conf');
1776 ++ copy('test/gpg.conf', $homedir . '/gpg.conf');
1777 + # reset the state of any long-lived gpg-agent, ignoring errors:
1778 +- system('gpgconf', '--homedir=test/gnupghome', '--quiet', '--kill', 'gpg-agent');
1779 ++ system('gpgconf', '--homedir', $homedir, '--quiet', '--kill', 'gpg-agent');
1780 +
1781 + reset_handles();
1782 +
1783 +diff --git a/t/MyTestSpecific.pm b/t/MyTestSpecific.pm
1784 +index e513c25..809d55c 100644
1785 +--- a/t/MyTestSpecific.pm
1786 ++++ b/t/MyTestSpecific.pm
1787 +@@ -22,6 +22,7 @@ use IO::Seekable;
1788 + use File::Compare;
1789 + use Exporter;
1790 + use Class::Struct;
1791 ++use File::Temp qw (tempdir);
1792 +
1793 + use GnuPG::Interface;
1794 + use GnuPG::Handles;
1795 +@@ -40,10 +41,25 @@ use vars qw( @ISA @EXPORT
1796 +
1797 + $gnupg = GnuPG::Interface->new( passphrase => 'test' );
1798 +
1799 ++
1800 ++my $homedir;
1801 ++if (-f "test/gnupghome") {
1802 ++ my $record = IO::File->new( "< test/gnupghome" );
1803 ++ $homedir = <$record>;
1804 ++ $record->close();
1805 ++} else {
1806 ++ $homedir = tempdir( DIR => '/tmp');
1807 ++ my $record = IO::File->new( "> test/gnupghome" );
1808 ++ $record->write($homedir);
1809 ++ $record->close();
1810 ++}
1811 ++
1812 + my @version = split('\.', $gnupg->version());
1813 + $gpg_is_modern = ($version[0] > 2 || ($version[0] == 2 && $version[1] >= 1));
1814 +
1815 +-$gnupg->options->hash_init( homedir => 'test/gnupghome',
1816 ++
1817 ++
1818 ++$gnupg->options->hash_init( homedir => $homedir,
1819 + armor => 1,
1820 + meta_interactive => 0,
1821 + meta_signing_key_id => '0x93AFC4B1B0288A104996B44253AE596EF950DA9C',
1822 +diff --git a/t/list_secret_keys.t b/t/list_secret_keys.t
1823 +index 7040c38..d1e3f30 100644
1824 +--- a/t/list_secret_keys.t
1825 ++++ b/t/list_secret_keys.t
1826 +@@ -23,8 +23,9 @@ TEST
1827 + $outfile = 'test/secret-keys/1.out';
1828 + my $out = IO::File->new( "> $outfile" )
1829 + or die "cannot open $outfile for writing: $ERRNO";
1830 ++ my $modern_pubring_line = $gnupg->options->homedir() . "/pubring.kbx\n";
1831 + while (<$stdout>) {
1832 +- if ($gpg_is_modern && /^\/.*\/test\/gnupghome\/pubring.kbx$/) {
1833 ++ if ($gpg_is_modern && ($_ eq $modern_pubring_line)) {
1834 + $out->print("test/gnupghome/pubring.kbx\n");
1835 + } elsif ($gpg_is_modern && /^--*$/) {
1836 + $out->print("--------------------------\n");
1837 +diff --git a/t/zzz_cleanup.t b/t/zzz_cleanup.t
1838 +index eea3a48..c3ec16f 100644
1839 +--- a/t/zzz_cleanup.t
1840 ++++ b/t/zzz_cleanup.t
1841 +@@ -11,9 +11,11 @@ use File::Path qw (remove_tree);
1842 + # this is actually no test, just cleanup.
1843 + TEST
1844 + {
1845 ++ my $homedir = $gnupg->options->homedir();
1846 + my $err = [];
1847 + # kill off any long-lived gpg-agent, ignoring errors:
1848 +- system('gpgconf', '--homedir=test/gnupghome', '--quiet', '--kill', 'gpg-agent');
1849 +- remove_tree('test/gnupghome', {error => \$err});
1850 ++ system('gpgconf', '--homedir', $homedir, '--quiet', '--kill', 'gpg-agent');
1851 ++ remove_tree($homedir, {error => \$err});
1852 ++ unlink('test/gnupghome');
1853 + return ! @$err;
1854 + };
1855
1856 diff --git a/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0019-Make-things-work-with-gpg1-assuming-plain-gpg-is-mod.patch b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0019-Make-things-work-with-gpg1-assuming-plain-gpg-is-mod.patch
1857 new file mode 100644
1858 index 00000000000..ae6143190de
1859 --- /dev/null
1860 +++ b/dev-perl/GnuPG-Interface/files/GnuPG-Interface-0.520.0-0019-Make-things-work-with-gpg1-assuming-plain-gpg-is-mod.patch
1861 @@ -0,0 +1,51 @@
1862 +From: Daniel Kahn Gillmor <dkg@×××××××××××××.net>
1863 +Date: Fri, 26 May 2017 18:15:24 -0400
1864 +Subject: Make things work with gpg1 (assuming plain 'gpg' is modern)
1865 +
1866 + * avoid sending --pinentry-mode=loopback if gpg is invoked as gpg1
1867 + * fix up t/list_secret_keys to account for the varied output
1868 + * t/decrypt.t still fails two agent-only tests, but presumably folks
1869 + who use gpg1 are not expecting to use the agent.
1870 +---
1871 + lib/GnuPG/Interface.pm | 5 ++++-
1872 + t/list_secret_keys.t | 9 +++++----
1873 + 2 files changed, 9 insertions(+), 5 deletions(-)
1874 +
1875 +diff --git a/lib/GnuPG/Interface.pm b/lib/GnuPG/Interface.pm
1876 +index 5d8b0ec..f80ead5 100644
1877 +--- a/lib/GnuPG/Interface.pm
1878 ++++ b/lib/GnuPG/Interface.pm
1879 +@@ -112,8 +112,11 @@ sub fork_attach_exec( $% ) {
1880 + # -- version 2.1.x or later. It's not clear to me how we can
1881 + # safely and efficiently avoid this assumption (see
1882 + # https://lists.gnupg.org/pipermail/gnupg-devel/2016-October/031800.html)
1883 ++ #
1884 ++ # as a (brittle and incomplete) cleanup, we will avoid trying to
1885 ++ # send pinentry-loopback if the program is invoked as "gpg1"
1886 + $use_loopback_pinentry = 1
1887 +- if ($handles->passphrase());
1888 ++ if ($handles->passphrase() && ! ($self->call =~ m/gpg1$/));
1889 +
1890 + # deprecation support
1891 + $args{commands} ||= $args{gnupg_commands};
1892 +diff --git a/t/list_secret_keys.t b/t/list_secret_keys.t
1893 +index d1e3f30..8e3c911 100644
1894 +--- a/t/list_secret_keys.t
1895 ++++ b/t/list_secret_keys.t
1896 +@@ -23,11 +23,12 @@ TEST
1897 + $outfile = 'test/secret-keys/1.out';
1898 + my $out = IO::File->new( "> $outfile" )
1899 + or die "cannot open $outfile for writing: $ERRNO";
1900 +- my $modern_pubring_line = $gnupg->options->homedir() . "/pubring.kbx\n";
1901 ++ my $seckey_file = $gpg_is_modern ? 'pubring.kbx' : 'secring.gpg';
1902 ++ my $pubring_line = $gnupg->options->homedir() . '/' . $seckey_file . "\n";
1903 + while (<$stdout>) {
1904 +- if ($gpg_is_modern && ($_ eq $modern_pubring_line)) {
1905 +- $out->print("test/gnupghome/pubring.kbx\n");
1906 +- } elsif ($gpg_is_modern && /^--*$/) {
1907 ++ if ($_ eq $pubring_line) {
1908 ++ $out->print('test/gnupghome/'.$seckey_file."\n");
1909 ++ } elsif (/^--*$/) {
1910 + $out->print("--------------------------\n");
1911 + } else {
1912 + $out->print( $_ );