git/0002-t-lib-gpg-reload-gpg-components-after-updating-trust.patch
Todd Zullinger a7d2f7e53e fix gpgsm issues with gnupg-2.3
The output of gpgsm changed slightly in gnupg-2.3, causing the git tests
for x509 signatures to be skipped.  Update the tests to use the
machine-parseable --with-colons output.

It also appears that we need to reload the gpg-agent in order to pick up
the changes the test library makes to the trustlist.txt file.  It might
be better to store that file with the other gpg files in the test suite
rather than generating it.

While we're at it, reload all the gpg components rather than just
gpg-agent.  Adjust the earlier gpgconf kill to use the 'all' keyword as
well.

Next up, gpgsm removed a debug line from it's output which exposes a
problem in git's gpg-interface code.  The git code presumes that the
'[GNUPG:] SIG_CREATED' line will follow a newline.  That is no longer
true.  The debug line was removed from GnuPG in a6d2f3133 (sm: Replace
some debug message by log_error or log_info, 2020-04-21).

Finally, a minor bug in gpgsm causes the error message returned when a
certificate is not found to differ from previous versions¹.  Extend the
grep pattern in the test suite to catch both error messages.

¹ https://lists.gnupg.org/pipermail/gnupg-devel/2021-November/034991.html
2021-11-25 05:52:09 -05:00

32 lines
1.2 KiB
Diff

From 93299b9b221da01d4055528f7c760d04ee83b82b Mon Sep 17 00:00:00 2001
From: Todd Zullinger <tmz@pobox.com>
Date: Thu, 25 Nov 2021 08:07:32 -0500
Subject: [PATCH] t/lib-gpg: reload gpg components after updating trustlist
With gpgsm from gnupg-2.3, the changes to the trustlist.txt do not
appear to be picked up without refreshing the gpg-agent. Use the 'all'
keyword to reload all of the gpg components. The scdaemon is started as
a child of gpg-agent, for example.
We used to have a --kill at this spot, but I removed it in 2e285e7803
(t/lib-gpg: drop redundant killing of gpg-agent, 2019-02-07). It seems
like it might be necessary (again) for 2.3.
Signed-off-by: Todd Zullinger <tmz@pobox.com>
---
t/lib-gpg.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/t/lib-gpg.sh b/t/lib-gpg.sh
index cbbf74e725..d675698a2d 100644
--- a/t/lib-gpg.sh
+++ b/t/lib-gpg.sh
@@ -75,6 +75,7 @@ test_lazy_prereq GPGSM '
gpgsm --homedir "${GNUPGHOME}" -K --with-colons |
awk -F ":" "/^fpr:/ {printf \"%s S relax\\n\", \$10}" \
>"${GNUPGHOME}/trustlist.txt" &&
+ (gpgconf --reload all || : ) &&
echo hello | gpgsm --homedir "${GNUPGHOME}" >/dev/null \
-u committer@example.com -o /dev/null --sign -