Package: libgnupg-interface-perl / 0.52-9

Metadata

Package Version Patches format
libgnupg-interface-perl 0.52-9 3.0 (quilt)

Patch series

view the series file
Patch File delta Description
0001 fix spelling error settting should be setting.patch | (download)

README | 2 1 + 1 - 0 !
lib/GnuPG/Interface.pm | 2 1 + 1 - 0 !
2 files changed, 2 insertions(+), 2 deletions(-)

 fix spelling error ("settting" should be "setting")


0002 Generalize the test suite.patch | (download)

t/000_setup.t | 28 28 + 0 - 0 !
t/MyTestSpecific.pm | 2 1 + 1 - 0 !
t/zzz_cleanup.t | 17 17 + 0 - 0 !
test/fake-pinentry.pl | 28 28 + 0 - 0 !
test/secret-keys/1.0.test | 4 2 + 2 - 0 !
5 files changed, 76 insertions(+), 3 deletions(-)

 generalize the test suite

The test suite currently assumes it knows something about the internal
state of GnuPG's homedir.

It's safer and less brittle to rely explicitly on the public interface
that GnuPG has committed to, such as --import-keys and --list-keys,
rather than assuming that certain files are in certain places in the
GnuPG homedir.

It's also better to create a fresh homedir and allow GnuPG to populate
it during the test suite, cleaning it up at the end, rather than hope
that GnuPG will leave a pre-existing homedir untouched.

With this change, many more of the tests pass when /usr/bin/gpg is
provided by GnuPG 2.1.

0003 subkey validity of an key when we have established n.patch | (download)

t/get_public_keys.t | 2 1 + 1 - 0 !
t/get_secret_keys.t | 2 1 + 1 - 0 !
2 files changed, 2 insertions(+), 2 deletions(-)

 subkey validity of an key when we have established no trust anchors

This apparently isn't tested by deep comparisons, though, so it was
never caught.

0004 ensure that test covers all signatures.patch | (download)

t/get_public_keys.t | 12 11 + 1 - 0 !
1 file changed, 11 insertions(+), 1 deletion(-)

 ensure that test covers all signatures

The earlier test wasn't reporting on one of the known self-sigs for
the test key for some reason.

This change ensures that all known signatures are present.

0005 add gpg_is_modern to test suite.patch | (download)

t/MyTestSpecific.pm | 7 5 + 2 - 0 !
1 file changed, 5 insertions(+), 2 deletions(-)

 add $gpg_is_modern to test suite

MyTestSpecific.pm now produces a new variable indicating whether it
the version of GnuPG we run against is from the "Modern" line of GnuPG
development (2.1 or later).  This will be useful when comparing output
that we can't expect from earlier versions.

0006 Modern GnuPG 2.1 reports more detail about secret ke.patch | (download)

t/get_secret_keys.t | 66 54 + 12 - 0 !
1 file changed, 54 insertions(+), 12 deletions(-)

 modern gnupg (2.1) reports more detail about secret keys

the GnuPG "modern" suite (version 2.1 or later) reports more detail
about secret keys than previous versions did.  In particular, it
reports stored ownertrust, public key data, and designated revokers
for secret keys.  Older versions only reported those attributes for
public keys.

This patch adjusts the test suite to ensure that our handmade key
matches the produced key when /usr/bin/gpg is supplied by the modern
suite.

0007 test suite match plaintext output across versions of.patch | (download)

t/list_secret_keys.t | 15 13 + 2 - 0 !
test/secret-keys/1.modern.test | 8 8 + 0 - 0 !
2 files changed, 21 insertions(+), 2 deletions(-)

 test suite: match plaintext output across versions of gnupg

The human-readable version of --list-keys is *not* expected to be
static over time or as the user's environment changes (e.g. LANG or
LC_MESSAGES), so expecting it to be machine-parseable is probably a
mistake.

That said, some users might want to pull textual information about
specific keys to display directly to the user, so it's not a terrible
idea to have it in the test suite.

Modern GnuPG (2.1 or later) changes the default structure of the
human-readable output in a few significant ways:

 * it writes the path to the keyring as an absolute path, even if
   $GNUPGHOME is set to a non-absolute path.

 * it shows the calculated user id validity by default (see
   show-uid-validity in gpg's --list-options).  (note that this is a
   translated string, so that "unknown" (in the default C locale)
   becomes "inconnue" when LANG or LC_MESSAGES is set to fr_CH.UTF-8,
   for example.

0008 fix test_default_key_passphrase when passphrase come.patch | (download)

lib/GnuPG/Interface.pm | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 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.

0009 clean up trailing whitespace.patch | (download)

lib/GnuPG/Fingerprint.pm | 2 1 + 1 - 0 !
lib/GnuPG/Handles.pm | 2 1 + 1 - 0 !
lib/GnuPG/Interface.pm | 16 8 + 8 - 0 !
3 files changed, 10 insertions(+), 10 deletions(-)

 clean up trailing whitespace


0010 fix capitalization of GnuPG.patch | (download)

README | 2 1 + 1 - 0 !
lib/GnuPG/Interface.pm | 2 1 + 1 - 0 !
2 files changed, 2 insertions(+), 2 deletions(-)

 fix capitalization of gnupg


0011 ommand_args should be command_args.patch | (download)

t/list_public_keys.t | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 ommand_args should be command_args


0012 use fingerprints as inputs during tests to demonstra.patch | (download)

README | 6 3 + 3 - 0 !
lib/GnuPG/Interface.pm | 6 3 + 3 - 0 !
lib/GnuPG/Options.pm | 2 1 + 1 - 0 !
t/MyTestSpecific.pm | 2 1 + 1 - 0 !
t/encrypt.t | 6 3 + 3 - 0 !
t/export_keys.t | 4 2 + 2 - 0 !
t/get_public_keys.t | 2 1 + 1 - 0 !
t/get_secret_keys.t | 2 1 + 1 - 0 !
t/list_public_keys.t | 4 2 + 2 - 0 !
t/list_secret_keys.t | 4 2 + 2 - 0 !
t/list_sigs.t | 4 2 + 2 - 0 !
t/sign_and_encrypt.t | 2 1 + 1 - 0 !
12 files changed, 22 insertions(+), 22 deletions(-)

 use fingerprints as inputs during tests to demonstrate explicit usage


0013 move key files to generic names.patch | (download)

t/000_setup.t | 2 1 + 1 - 0 !
1 file changed, 1 insertion(+), 1 deletion(-)

 move key files to generic names


0014 fix spelling s convience convenience.patch | (download)

README | 4 2 + 2 - 0 !
lib/GnuPG/Interface.pm | 4 2 + 2 - 0 !
2 files changed, 4 insertions(+), 4 deletions(-)

 fix spelling: s/convience/convenience/


0015 added new secret key with different passphrase.patch | (download)

t/000_setup.t | 2 1 + 1 - 0 !
test/new_secret.pgp | 58 58 + 0 - 0 !
test/secret-keys/1.0.test | 4 4 + 0 - 0 !
test/secret-keys/1.modern.test | 5 5 + 0 - 0 !
4 files changed, 68 insertions(+), 1 deletion(-)

 added new secret key with different passphrase

0016 Test use of gpg without explicit passphrase agent pi.patch | (download)

README | 41 27 + 14 - 0 !
lib/GnuPG/Interface.pm | 26 25 + 1 - 0 !
t/MyTestSpecific.pm | 10 8 + 2 - 0 !
t/decrypt.t | 27 27 + 0 - 0 !
test/encrypted.2.gpg | 12 12 + 0 - 0 !
test/fake-pinentry.pl | 2 1 + 1 - 0 !
test/plain.2.txt | 1 1 + 0 - 0 !
7 files changed, 101 insertions(+), 18 deletions(-)

 test use of gpg without explicit passphrase (agent+pinentry)

The modern GnuPG suite encourages the use of gpg-agent to control
access to secret key material.  In this use case, we avoid setting an
explicit passphrase in code, and rely on either a correctly-configured
and primed gpg-agent or a dedicated pinentry program to supply the
passphrase.

This additional test verifies that the passphrase can be handled by
the agent.  Note that the passphrase for this additional test key is
*not* the default passphrase, so this test should fail in the event
that gpg can't use the agent and the pinentry for this task.

Unfortunately, this all assumes that we're using GnuPG "Modern".  I've
noted concerns about writing forward- and backward-compatible bindings
for GnuPG here:
https://lists.gnupg.org/pipermail/gnupg-devel/2016-October/031800.html

0017 Kill any GnuPG agent before and after the test suite.patch | (download)

t/000_setup.t | 3 3 + 0 - 0 !
t/zzz_cleanup.t | 2 2 + 0 - 0 !
2 files changed, 5 insertions(+)

 kill any gnupg agent before and after the test suite.

This helps to ensure that the test suite daemon is started fresh at
every test suite run.  And it also avoids leaving a daemon running
after the test suite, assuming the test suite manages to reach the
end.

This is considered a reasonable practice by upstream.

0018 Use a short temporary homedir during the test suite.patch | (download)

t/000_setup.t | 9 5 + 4 - 0 !
t/MyTestSpecific.pm | 18 17 + 1 - 0 !
t/list_secret_keys.t | 3 2 + 1 - 0 !
t/zzz_cleanup.t | 6 4 + 2 - 0 !
4 files changed, 28 insertions(+), 8 deletions(-)

 use a short temporary homedir during the test suite

This avoids problems with the length of the path to the homedir as
compared to the size limits of sockaddr_un.sun_path, particularly on
systems where /run/user/$(id -u) is not present or available (such as
many minimalist build environments).

0019 Make things work with gpg1 assuming plain gpg is mod.patch | (download)

lib/GnuPG/Interface.pm | 5 4 + 1 - 0 !
t/list_secret_keys.t | 9 5 + 4 - 0 !
2 files changed, 9 insertions(+), 5 deletions(-)

 make things work with gpg1 (assuming plain 'gpg' is modern)

 * avoid sending --pinentry-mode=loopback if gpg is invoked as gpg1
 * fix up t/list_secret_keys to account for the varied output
 * t/decrypt.t still fails two agent-only tests, but presumably folks
   who use gpg1 are not expecting to use the agent.