summaryrefslogtreecommitdiffstats
path: root/g10/mainproc.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2019-04-03 09:04:49 +0200
committerWerner Koch <wk@gnupg.org>2019-04-03 09:04:49 +0200
commit2d3392c147a24e49ee4658d4a50fafd68599fba3 (patch)
tree304d6e5aa033a2cef5c0c554a1f3c9793378a8cf /g10/mainproc.c
parentgpg: Allow direct key generation from card with --full-gen-key. (diff)
downloadgnupg2-2d3392c147a24e49ee4658d4a50fafd68599fba3.tar.xz
gnupg2-2d3392c147a24e49ee4658d4a50fafd68599fba3.zip
gpg: Print modern style key info for non-decryptable keys.
* g10/mainproc.c (print_pkenc_list): Simplify. -- This changes the output from # ------------------------ >8 ------------------------ gpg: encrypted with 2048-bit RSA key, ID D20073D46DF6C97D, created 2019-04-02 "Test with PIV card" to gpg: encrypted with rsa2048 key, ID D20073D46DF6C97D, created 2019-04-02 "Test with PIV card" Signed-off-by: Werner Koch <wk@gnupg.org> # ------------------------ 8< ------------------------
Diffstat (limited to 'g10/mainproc.c')
-rw-r--r--g10/mainproc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/g10/mainproc.c b/g10/mainproc.c
index 7acf67b1e..d99ac4386 100644
--- a/g10/mainproc.c
+++ b/g10/mainproc.c
@@ -506,19 +506,18 @@ print_pkenc_list (ctrl_t ctrl, struct pubkey_enc_list *list)
for (; list; list = list->next)
{
PKT_public_key *pk;
- const char *algstr;
+ char pkstrbuf[PUBKEY_STRING_SIZE];
+ char *p;
- algstr = openpgp_pk_algo_name (list->pubkey_algo);
pk = xmalloc_clear (sizeof *pk);
- if (!algstr)
- algstr = "[?]";
pk->pubkey_algo = list->pubkey_algo;
if (!get_pubkey (ctrl, pk, list->keyid))
{
- char *p;
- log_info (_("encrypted with %u-bit %s key, ID %s, created %s\n"),
- nbits_from_pk (pk), algstr, keystr_from_pk(pk),
+ pubkey_string (pk, pkstrbuf, sizeof pkstrbuf);
+
+ log_info (_("encrypted with %s key, ID %s, created %s\n"),
+ pkstrbuf, keystr_from_pk (pk),
strtimestamp (pk->timestamp));
p = get_user_id_native (ctrl, list->keyid);
log_printf (_(" \"%s\"\n"), p);
@@ -526,7 +525,8 @@ print_pkenc_list (ctrl_t ctrl, struct pubkey_enc_list *list)
}
else
log_info (_("encrypted with %s key, ID %s\n"),
- algstr, keystr(list->keyid));
+ openpgp_pk_algo_name (list->pubkey_algo),
+ keystr(list->keyid));
free_public_key (pk);
}