[Pkg-gnupg-commit] [gnupg2] 131/132: bugfixes from upstream
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Wed May 17 03:07:55 UTC 2017
This is an automated email from the git hooks/post-receive script.
dkg pushed a commit to branch experimental
in repository gnupg2.
commit 193cece0c19b61637fe2463ecab5657cf24937bd
Author: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
Date: Tue May 16 22:41:44 2017 -0400
bugfixes from upstream
---
...gure-the-environments-to-use-scdaemon-fro.patch | 67 +++++++++++++++++
...uppress-error-for-card-availability-check.patch | 84 ++++++++++++++++++++++
debian/patches/0015-g10-Fix-gpgcompose.c.patch | 28 ++++++++
debian/patches/series | 3 +
4 files changed, 182 insertions(+)
diff --git a/debian/patches/0013-tests-Configure-the-environments-to-use-scdaemon-fro.patch b/debian/patches/0013-tests-Configure-the-environments-to-use-scdaemon-fro.patch
new file mode 100644
index 0000000..e00d751
--- /dev/null
+++ b/debian/patches/0013-tests-Configure-the-environments-to-use-scdaemon-fro.patch
@@ -0,0 +1,67 @@
+From: Justus Winter <justus at g10code.com>
+Date: Tue, 16 May 2017 16:07:25 +0200
+Subject: tests: Configure the environments to use scdaemon from build tree.
+
+* tests/gpgme/gpgme-defs.scm: Use the scdaemon from the build tree
+when writing a 'gpg-agent.conf'.
+* tests/gpgsm/gpgsm-defs.scm: Likewise.
+* tests/openpgp/defs.scm: Likewise.
+--
+
+As of 97a2394ecafaa6f58e4a1f70ecfd04408dc15606 gpg may query the
+scdaemon for a signing key to use. To make sure that the agent calls
+the right scdaemon, we provide the path explicitly in the
+'gpg-agent.conf' that is used in the tests, similar to what we do for
+the agent itself and the pinentry.
+
+GnuPG-bug-id: 3165
+Signed-off-by: Justus Winter <justus at g10code.com>
+(cherry picked from commit 386a7bbb245dd3ab7c4156a554adbe75d82bdf49)
+---
+ tests/gpgme/gpgme-defs.scm | 4 +++-
+ tests/gpgsm/gpgsm-defs.scm | 4 +++-
+ tests/openpgp/defs.scm | 1 +
+ 3 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/tests/gpgme/gpgme-defs.scm b/tests/gpgme/gpgme-defs.scm
+index e24db25..0de589f 100644
+--- a/tests/gpgme/gpgme-defs.scm
++++ b/tests/gpgme/gpgme-defs.scm
+@@ -66,7 +66,9 @@
+ (string-append "agent-program " (tool 'gpg-agent) "|--debug-quick-random\n"))
+ (create-file
+ "gpg-agent.conf"
+- (string-append "pinentry-program " (tool 'pinentry)))
++ (string-append "pinentry-program " (tool 'pinentry))
++ (string-append "scdaemon-program " (tool 'scdaemon))
++ )
+
+ (start-agent)
+
+diff --git a/tests/gpgsm/gpgsm-defs.scm b/tests/gpgsm/gpgsm-defs.scm
+index 711922a..d99d7da 100644
+--- a/tests/gpgsm/gpgsm-defs.scm
++++ b/tests/gpgsm/gpgsm-defs.scm
+@@ -66,7 +66,9 @@
+ "disable-crl-checks"
+ "faked-system-time 1008241200")
+ (create-file "gpg-agent.conf"
+- (string-append "pinentry-program " (tool 'pinentry)))
++ (string-append "pinentry-program " (tool 'pinentry))
++ (string-append "scdaemon-program " (tool 'scdaemon))
++ )
+ (start-agent)
+ (create-file
+ "trustlist.txt"
+diff --git a/tests/openpgp/defs.scm b/tests/openpgp/defs.scm
+index 1531dc1..0cd45ad 100644
+--- a/tests/openpgp/defs.scm
++++ b/tests/openpgp/defs.scm
+@@ -349,6 +349,7 @@
+ "no-grab"
+ "enable-ssh-support"
+ (string-append "pinentry-program " (tool 'pinentry))
++ (string-append "scdaemon-program " (tool 'scdaemon))
+ ))
+
+ ;; Initialize the test environment, install appropriate configuration
diff --git a/debian/patches/0014-g10-Suppress-error-for-card-availability-check.patch b/debian/patches/0014-g10-Suppress-error-for-card-availability-check.patch
new file mode 100644
index 0000000..2d35546
--- /dev/null
+++ b/debian/patches/0014-g10-Suppress-error-for-card-availability-check.patch
@@ -0,0 +1,84 @@
+From: NIIBE Yutaka <gniibe at fsij.org>
+Date: Wed, 17 May 2017 09:46:06 +0900
+Subject: g10: Suppress error for card availability check.
+
+* g10/call-agent.c (start_agent): Add semantics for card; Suppress
+error for card check.
+(warn_version_mismatch): Ignore an error for scdaemon.
+(agent_scd_serialno): Call start_agent with
+FLAG_FOR_CARD_SUPPRESS_ERRORS.
+
+--
+
+GnuPG-bug-id: 3165
+Fixes-commit: 97a2394ecafaa6f58e4a1f70ecfd04408dc15606
+Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>
+(cherry picked from commit a8dd96826f8484c0ae93c954035b95c2a75c80f2)
+---
+ g10/call-agent.c | 15 +++++++++------
+ 1 file changed, 9 insertions(+), 6 deletions(-)
+
+diff --git a/g10/call-agent.c b/g10/call-agent.c
+index be8c33d..4698a25 100644
+--- a/g10/call-agent.c
++++ b/g10/call-agent.c
+@@ -184,7 +184,8 @@ default_inq_cb (void *opaque, const char *line)
+
+
+ /* Print a warning if the server's version number is less than our
+- version number. Returns an error code on a connection problem. */
++ version number. Returns an error code on a connection problem.
++ Ignore an error for scdaemon (MODE==2). */
+ static gpg_error_t
+ warn_version_mismatch (assuan_context_t ctx, const char *servername, int mode)
+ {
+@@ -193,7 +194,7 @@ warn_version_mismatch (assuan_context_t ctx, const char *servername, int mode)
+ const char *myversion = strusage (13);
+
+ err = get_assuan_server_version (ctx, mode, &serverversion);
+- if (err)
++ if (err && mode != 2)
+ log_error (_("error getting version from '%s': %s\n"),
+ servername, gpg_strerror (err));
+ else if (compare_version_strings (serverversion, myversion) < 0)
+@@ -217,10 +218,12 @@ warn_version_mismatch (assuan_context_t ctx, const char *servername, int mode)
+ }
+
+
++#define FLAG_FOR_CARD_SUPPRESS_ERRORS 2
++
+ /* Try to connect to the agent via socket or fork it off and work by
+ pipes. Handle the server's initial greeting */
+ static int
+-start_agent (ctrl_t ctrl, int for_card)
++start_agent (ctrl_t ctrl, int flag_for_card)
+ {
+ int rc;
+
+@@ -280,7 +283,7 @@ start_agent (ctrl_t ctrl, int for_card)
+ }
+ }
+
+- if (!rc && for_card && !did_early_card_test)
++ if (!rc && flag_for_card && !did_early_card_test)
+ {
+ /* Request the serial number of the card for an early test. */
+ struct agent_card_info_s info;
+@@ -292,7 +295,7 @@ start_agent (ctrl_t ctrl, int for_card)
+ rc = assuan_transact (agent_ctx, "SCD SERIALNO openpgp",
+ NULL, NULL, NULL, NULL,
+ learn_status_cb, &info);
+- if (rc)
++ if (rc && !(flag_for_card & FLAG_FOR_CARD_SUPPRESS_ERRORS))
+ {
+ switch (gpg_err_code (rc))
+ {
+@@ -1023,7 +1026,7 @@ agent_scd_serialno (char **r_serialno, const char *demand)
+ char *serialno = NULL;
+ char line[ASSUAN_LINELENGTH];
+
+- err = start_agent (NULL, 1);
++ err = start_agent (NULL, 1 | FLAG_FOR_CARD_SUPPRESS_ERRORS);
+ if (err)
+ return err;
+
diff --git a/debian/patches/0015-g10-Fix-gpgcompose.c.patch b/debian/patches/0015-g10-Fix-gpgcompose.c.patch
new file mode 100644
index 0000000..733e640
--- /dev/null
+++ b/debian/patches/0015-g10-Fix-gpgcompose.c.patch
@@ -0,0 +1,28 @@
+From: NIIBE Yutaka <gniibe at fsij.org>
+Date: Wed, 17 May 2017 10:14:43 +0900
+Subject: g10: Fix gpgcompose.c.
+
+* g10/gpgcompose.c (show_help): Check return value.
+
+--
+
+Fixes-commit: 00b7767bc6fe309aa20375c859ebf708cfc7b9ea
+Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>
+(cherry picked from commit ae95a7f5335e605fcd71fbe4a18ed384c88d590a)
+---
+ g10/gpgcompose.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/g10/gpgcompose.c b/g10/gpgcompose.c
+index 4a2cb81..e541cfe 100644
+--- a/g10/gpgcompose.c
++++ b/g10/gpgcompose.c
+@@ -306,7 +306,7 @@ show_help (struct option options[])
+ if (! option)
+ space = 72;
+ formatted = format_text (tmp, space, space + 4);
+- if (!format_text)
++ if (!formatted)
+ abort ();
+
+ if (tmp != help)
diff --git a/debian/patches/series b/debian/patches/series
index ea6811b..45fcf59 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -10,3 +10,6 @@ gpg-agent-idling/0009-agent-Allow-threads-to-interrupt-main-select-loop-wi.patch
gpg-agent-idling/0010-agent-Avoid-tight-timer-tick-when-possible.patch
gpg-agent-idling/0011-agent-Avoid-scheduled-checks-on-socket-when-inotify-.patch
skip-missing-signing-keys/0013-g10-Skip-signing-keys-where-no-secret-key-is-availab.patch
+0013-tests-Configure-the-environments-to-use-scdaemon-fro.patch
+0014-g10-Suppress-error-for-card-availability-check.patch
+0015-g10-Fix-gpgcompose.c.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git
More information about the Pkg-gnupg-commit
mailing list