diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2020-11-02 03:32:27 +0100 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2020-11-02 03:32:27 +0100 |
commit | 90c3d623ce37695a1eb29c0a7276b23490d14603 (patch) | |
tree | d36b3da4c3431c4bdfb2620c84cee29b82571e67 /g10/key-check.c | |
parent | gpg: Fix check_signature2 for opaque MPI. (diff) | |
download | gnupg2-90c3d623ce37695a1eb29c0a7276b23490d14603.tar.xz gnupg2-90c3d623ce37695a1eb29c0a7276b23490d14603.zip |
gpg: Fix debug output for key_check_all_keysigs with opaque MPI.
* g10/key-check.c (key_check_all_keysigs): Handle opaque MPI.
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to '')
-rw-r--r-- | g10/key-check.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/g10/key-check.c b/g10/key-check.c index 45f384ba7..b370cc11b 100644 --- a/g10/key-check.c +++ b/g10/key-check.c @@ -587,9 +587,19 @@ key_check_all_keysigs (ctrl_t ctrl, int mode, kbnode_t kb, char buffer[1024]; size_t len; char *printable; - gcry_mpi_print (GCRYMPI_FMT_USG, - buffer, sizeof (buffer), &len, - sig->data[i]); + if (gcry_mpi_get_flag (sig->data[i], GCRYMPI_FLAG_OPAQUE)) + { + const byte *sigdata; + unsigned int nbits; + + sigdata = gcry_mpi_get_opaque (sig->data[i], &nbits); + len = (nbits+7)/8; + memcpy (buffer, sigdata, len); + } + else + gcry_mpi_print (GCRYMPI_FMT_USG, + buffer, sizeof (buffer), &len, + sig->data[i]); printable = bin2hex (buffer, len, NULL); log_debug (" %d: %s\n", i, printable); xfree (printable); |