diff options
| author | Werner Koch <[email protected]> | 2019-03-18 18:41:07 +0000 |
|---|---|---|
| committer | Werner Koch <[email protected]> | 2019-03-18 18:41:07 +0000 |
| commit | a52d883fdbe6e0de8cb26f9c6aedf01a7f66cbe7 (patch) | |
| tree | e59dfb41b24a12c314dbd1137637366315ac1453 /sm/certreqgen-ui.c | |
| parent | kbx: Add framework for a public key daemon. (diff) | |
| parent | speedo: Fix installer build with NSIS-3 (diff) | |
| download | gnupg-a52d883fdbe6e0de8cb26f9c6aedf01a7f66cbe7.tar.gz gnupg-a52d883fdbe6e0de8cb26f9c6aedf01a7f66cbe7.zip | |
Merge branch 'master' into switch-to-gpgk
--
Diffstat (limited to 'sm/certreqgen-ui.c')
| -rw-r--r-- | sm/certreqgen-ui.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/sm/certreqgen-ui.c b/sm/certreqgen-ui.c index 4f8a1ac9d..70e5739e8 100644 --- a/sm/certreqgen-ui.c +++ b/sm/certreqgen-ui.c @@ -86,7 +86,7 @@ store_mb_lines (membuf_t *mb, membuf_t *lines) } -/* Chech whether we have a key for the key with HEXGRIP. Returns NULL +/* Check whether we have a key for the key with HEXGRIP. Returns NULL if not or a string describing the type of the key (RSA, ELG, DSA, etc..). */ static const char * @@ -244,7 +244,27 @@ gpgsm_gencertreq_tty (ctrl_t ctrl, estream_t output_stream) { tty_printf (_("Available keys:\n")); for (count=1,sl=keypairlist; sl; sl = sl->next, count++) - tty_printf (" (%d) %s\n", count, sl->d); + { + ksba_sexp_t pkey; + gcry_sexp_t s_pkey; + char *algostr = NULL; + const char *keyref; + + keyref = strchr (sl->d, ' '); + if (keyref) + { + keyref++; + if (!gpgsm_agent_readkey (ctrl, 1, keyref, &pkey)) + { + if (!gcry_sexp_new (&s_pkey, pkey, 0, 0)) + algostr = pubkey_algo_string (s_pkey); + gcry_sexp_release (s_pkey); + } + xfree (pkey); + } + tty_printf (" (%d) %s %s\n", count, sl->d, algostr); + xfree (algostr); + } xfree (answer); answer = tty_get (_("Your selection? ")); tty_kill_prompt (); |
