diff options
author | Werner Koch <[email protected]> | 2021-06-22 10:29:59 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2021-06-22 10:30:46 +0000 |
commit | 5df658233a3a0c05fac0b4d4889f033ea0d0e034 (patch) | |
tree | a2d3e8e0c7a65978168d45340b9cd1e020d44028 /common/t-sexputil.c | |
parent | w32: Add fallback in case the Windows console can't cope with Unicode. (diff) | |
download | gnupg-5df658233a3a0c05fac0b4d4889f033ea0d0e034.tar.gz gnupg-5df658233a3a0c05fac0b4d4889f033ea0d0e034.zip |
tests: Cope with broken Libgcrypt versions
* common/t-sexputil.c (test_ecc_uncompress): Ignore unknwon curve
errors.
--
For unknown reasons some versions of Fedora or RHEL provide a patched
version of Libgcrypt with Brainpool support removed. We better ignore
this error because it is a regression in 2.2.28 although that older
versions could not used Brainpool keys.
GnuPG-bug-id: 5502
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'common/t-sexputil.c')
-rw-r--r-- | common/t-sexputil.c | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/common/t-sexputil.c b/common/t-sexputil.c index d75090c5b..d6cf33510 100644 --- a/common/t-sexputil.c +++ b/common/t-sexputil.c @@ -461,17 +461,33 @@ test_ecc_uncompress (void) if (bbuf) { err = uncompress_ecc_q_in_canon_sexp (bbuf, bbuflen, &rbuf, &rbuflen); - if (err) - fail2 (idx,err); - if (!rbuf) - fail (idx); /* Not converted despite a need for it. */ - - /* log_printcanon (" orig:", abuf, abuflen); */ - /* log_printcanon (" comp:", bbuf, bbuflen); */ - /* log_printcanon ("uncomp:", rbuf, rbuflen); */ - - if (rbuflen != abuflen || memcmp (rbuf, abuf, abuflen)) - fail (idx); + if (gpg_err_code (err) == GPG_ERR_UNKNOWN_CURVE) + { + static int shown; + fprintf (stderr, "%s:%d: test %d failed: %s - ignored\n", + __FILE__,__LINE__, idx, gpg_strerror (err)); + if (!shown) + { + shown = 1; + fprintf (stderr, "This is likely due to a patched" + " version of Libgcrypt with removed support" + " for Brainpool curves\n"); + } + } + else + { + if (err) + fail2 (idx,err); + if (!rbuf) + fail (idx); /* Not converted despite a need for it. */ + + /* log_printcanon (" orig:", abuf, abuflen); */ + /* log_printcanon (" comp:", bbuf, bbuflen); */ + /* log_printcanon ("uncomp:", rbuf, rbuflen); */ + + if (rbuflen != abuflen || memcmp (rbuf, abuf, abuflen)) + fail (idx); + } } xfree (abuf); |