gpgme/gpgme-1.11-fix-tests.patch

47 lines
1.5 KiB
Diff

From 3d8e5c07511938a0b30b4626530822338abd9ec0 Mon Sep 17 00:00:00 2001
From: Werner Koch <wk@gnupg.org>
Date: Thu, 19 Apr 2018 10:29:30 +0200
Subject: [PATCH] tests: Fix t-verify test for GnuPG < 2.2.7.
* tests/gpg/t-verify.c (check_result): Tweak for gnupg < 2.2.7.
--
The not yet releases 2.2.7-beta may print a full fingerprint in the
ERRSIG status. This is compliant with the dscription but the new
t-verify test case did not took in account that older GnuPG versions
print only a keyid.
Fixes-commit: b99502274ae5efdf6df0d967900ec3d1e64373d7
GnUPG-bug-id: 3920
Signed-off-by: Werner Koch <wk@gnupg.org>
---
tests/gpg/t-verify.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/tests/gpg/t-verify.c b/tests/gpg/t-verify.c
index 7c23406f..fa0164ac 100644
--- a/tests/gpg/t-verify.c
+++ b/tests/gpg/t-verify.c
@@ -126,9 +126,15 @@ check_result (gpgme_verify_result_t result, int no_of_sigs, int skip_sigs,
}
if (strcmp (sig->fpr, fpr))
{
- fprintf (stderr, "%s:%i:sig-%d: Unexpected fingerprint: %s\n",
- PGM, __LINE__, skip_sigs, sig->fpr);
- exit (1);
+ if (strlen (sig->fpr) == 16 && strlen (fpr) == 40
+ && !strncmp (sig->fpr, fpr + 24, 16))
+ ; /* okay because gnupg < 2.2.6 only shows the keyid. */
+ else
+ {
+ fprintf (stderr, "%s:%i:sig-%d: Unexpected fingerprint: %s\n",
+ PGM, __LINE__, skip_sigs, sig->fpr);
+ exit (1);
+ }
}
if (gpgme_err_code (sig->status) != status)
{
--
2.16.3