aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2022-11-15 15:31:46 +0000
committerWerner Koch <[email protected]>2022-11-15 15:32:24 +0000
commit4f43b6fdae0149200eb4f87c86f88b923d6e9543 (patch)
tree4dc89c36ebe150e463ddf1137f59f32541a305cd
parentscd:nks: Fix ECC signing if key not given by keygrip. (diff)
downloadgnupg-4f43b6fdae0149200eb4f87c86f88b923d6e9543.tar.gz
gnupg-4f43b6fdae0149200eb4f87c86f88b923d6e9543.zip
gpgsm: Fix colon outout of ECC encryption certificates
* sm/keylist.c (print_capabilities): Add arg algo and use it to check for ECC capabilities. (list_cert_colon): Call with algo. -- This will mark certificates with only keyAgreement usage correctly in the --with-colons listing. (cherry picked from commit f5c3f13609361dfeb03722161b1fc93f5a33dcae)
-rw-r--r--sm/keylist.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sm/keylist.c b/sm/keylist.c
index 7db5f2c36..19e7a76c8 100644
--- a/sm/keylist.c
+++ b/sm/keylist.c
@@ -247,7 +247,7 @@ print_key_data (ksba_cert_t cert, estream_t fp)
}
static void
-print_capabilities (ksba_cert_t cert, estream_t fp)
+print_capabilities (ksba_cert_t cert, int algo, estream_t fp)
{
gpg_error_t err;
unsigned int use;
@@ -299,7 +299,7 @@ print_capabilities (ksba_cert_t cert, estream_t fp)
/* We need to returned the faked key usage to frontends so that they
* can select the right key. Note that we don't do this for the
* human readable keyUsage. */
- if ((opt.compat_flags & COMPAT_ALLOW_KA_TO_ENCR)
+ if ((algo == GCRY_PK_ECC || (opt.compat_flags & COMPAT_ALLOW_KA_TO_ENCR))
&& (use & KSBA_KEYUSAGE_KEY_AGREEMENT))
is_encr = 1;
@@ -539,7 +539,7 @@ list_cert_colon (ctrl_t ctrl, ksba_cert_t cert, unsigned int validity,
/* Field 11, signature class - not used */
es_putc (':', fp);
/* Field 12, capabilities: */
- print_capabilities (cert, fp);
+ print_capabilities (cert, algo, fp);
es_putc (':', fp);
/* Field 13, not used: */
es_putc (':', fp);