aboutsummaryrefslogtreecommitdiffstats
path: root/sm/certreqgen-ui.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2019-07-12 11:57:00 +0000
committerWerner Koch <[email protected]>2019-07-12 11:57:00 +0000
commita5118b19c182b558635a6a11ef55b6b8a18c04e9 (patch)
tree16f59401d004b086e1a00c7dad8e4a7523af2fae /sm/certreqgen-ui.c
parentMerge branch 'master' into switch-to-gpgk (diff)
parentscd: Remove useless GNUPG_SCD_MAIN_HEADER macro. (diff)
downloadgnupg-a5118b19c182b558635a6a11ef55b6b8a18c04e9.tar.gz
gnupg-a5118b19c182b558635a6a11ef55b6b8a18c04e9.zip
Merge branch 'master' into switch-to-gpgk
Diffstat (limited to 'sm/certreqgen-ui.c')
-rw-r--r--sm/certreqgen-ui.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/sm/certreqgen-ui.c b/sm/certreqgen-ui.c
index 70e5739e8..ae9ec35d0 100644
--- a/sm/certreqgen-ui.c
+++ b/sm/certreqgen-ui.c
@@ -249,6 +249,7 @@ gpgsm_gencertreq_tty (ctrl_t ctrl, estream_t output_stream)
gcry_sexp_t s_pkey;
char *algostr = NULL;
const char *keyref;
+ int any = 0;
keyref = strchr (sl->d, ' ');
if (keyref)
@@ -257,12 +258,33 @@ gpgsm_gencertreq_tty (ctrl_t ctrl, estream_t output_stream)
if (!gpgsm_agent_readkey (ctrl, 1, keyref, &pkey))
{
if (!gcry_sexp_new (&s_pkey, pkey, 0, 0))
- algostr = pubkey_algo_string (s_pkey);
+ algostr = pubkey_algo_string (s_pkey, NULL);
gcry_sexp_release (s_pkey);
}
xfree (pkey);
}
- tty_printf (" (%d) %s %s\n", count, sl->d, algostr);
+ tty_printf (" (%d) %s %s", count, sl->d, algostr);
+ if ((sl->flags & GCRY_PK_USAGE_CERT))
+ {
+ tty_printf ("%scert", any?",":" (");
+ any = 1;
+ }
+ if ((sl->flags & GCRY_PK_USAGE_SIGN))
+ {
+ tty_printf ("%ssign", any?",":" (");
+ any = 1;
+ }
+ if ((sl->flags & GCRY_PK_USAGE_AUTH))
+ {
+ tty_printf ("%sauth", any?",":" (");
+ any = 1;
+ }
+ if ((sl->flags & GCRY_PK_USAGE_ENCR))
+ {
+ tty_printf ("%sencr", any?",":" (");
+ any = 1;
+ }
+ tty_printf ("%s\n", any?")":"");
xfree (algostr);
}
xfree (answer);