diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2022-09-16 07:44:53 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2022-09-16 07:44:53 +0900 |
commit | 718f86f0bf9d85457ac011bacf6bc5bbcea9f4a6 (patch) | |
tree | ce9b93ae1e3012ca5b451e55e1bd069a81a9e807 /common | |
parent | c5ff1325db87c374d0a7b3785ff1e1342a0be2ba (diff) | |
download | gpg2-718f86f0bf9d85457ac011bacf6bc5bbcea9f4a6.tar.gz gpg2-718f86f0bf9d85457ac011bacf6bc5bbcea9f4a6.tar.bz2 gpg2-718f86f0bf9d85457ac011bacf6bc5bbcea9f4a6.zip |
Imported Upstream version 2.2.29upstream/2.2.29
Diffstat (limited to 'common')
-rw-r--r-- | common/t-sexputil.c | 38 | ||||
-rw-r--r-- | common/ttyio.c | 22 |
2 files changed, 45 insertions, 15 deletions
diff --git a/common/t-sexputil.c b/common/t-sexputil.c index a1a9d89..8da9760 100644 --- a/common/t-sexputil.c +++ b/common/t-sexputil.c @@ -460,17 +460,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); diff --git a/common/ttyio.c b/common/ttyio.c index c385700..c310817 100644 --- a/common/ttyio.c +++ b/common/ttyio.c @@ -236,10 +236,24 @@ w32_write_console (const char *string) n = wcslen (wstring); if (!WriteConsoleW (con.out, wstring, n, &nwritten, NULL)) - log_fatal ("WriteConsole failed: %s", w32_strerror (-1)); - if (n != nwritten) - log_fatal ("WriteConsole failed: %lu != %lu\n", - (unsigned long)n, (unsigned long)nwritten); + { + static int shown; + if (!shown) + { + shown = 1; + log_info ("WriteConsole failed: %s", w32_strerror (-1)); + log_info ("Please configure a suitable font for the console\n"); + } + n = strlen (string); + if (!WriteConsoleA (con.out, string, n , &nwritten, NULL)) + log_fatal ("WriteConsole fallback failed: %s", w32_strerror (-1)); + } + else + { + if (n != nwritten) + log_fatal ("WriteConsole failed: %lu != %lu\n", + (unsigned long)n, (unsigned long)nwritten); + } last_prompt_len += n; xfree (wstring); } |