diff options
author | Werner Koch <wk@gnupg.org> | 2020-08-04 11:03:49 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2020-08-04 11:11:22 +0200 |
commit | e7d70923901eeb6a2c26445aee9db7e78f6f7f3a (patch) | |
tree | 82f2e3a16c5bb34f6923814f629975541f5041bb /sm | |
parent | w32: Fix cast from intptr_t of _get_osfhandle. (diff) | |
download | gnupg2-e7d70923901eeb6a2c26445aee9db7e78f6f7f3a.tar.xz gnupg2-e7d70923901eeb6a2c26445aee9db7e78f6f7f3a.zip |
sm: Also show the SHA-256 fingerprint.
* sm/keylist.c (list_cert_colon): Emit a new "fp2" record.
(list_cert_raw): Print the SHA2 fingerprint.
(list_cert_std): Ditto.
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'sm')
-rw-r--r-- | sm/keylist.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sm/keylist.c b/sm/keylist.c index 1a47be084..fdfee6772 100644 --- a/sm/keylist.c +++ b/sm/keylist.c @@ -599,6 +599,10 @@ list_cert_colon (ctrl_t ctrl, ksba_cert_t cert, unsigned int validity, es_putc ('\n', fp); xfree (fpr); fpr = NULL; chain_id = NULL; xfree (chain_id_buffer); chain_id_buffer = NULL; + /* SHA256 FPR record */ + fpr = gpgsm_get_fingerprint_hexstring (cert, GCRY_MD_SHA256); + es_fprintf (fp, "fp2:::::::::%s::::\n", fpr); + xfree (fpr); fpr = NULL; /* Always print the keygrip. */ if ( (p = gpgsm_get_keygrip_hexstring (cert))) @@ -814,6 +818,10 @@ list_cert_raw (ctrl_t ctrl, KEYDB_HANDLE hd, es_putc ('\n', fp); } + dn = gpgsm_get_fingerprint_string (cert, GCRY_MD_SHA256); + es_fprintf (fp, " sha2_fpr: %s\n", dn?dn:"error"); + xfree (dn); + dn = gpgsm_get_fingerprint_string (cert, 0); es_fprintf (fp, " sha1_fpr: %s\n", dn?dn:"error"); xfree (dn); @@ -1330,7 +1338,11 @@ list_cert_std (ctrl_t ctrl, ksba_cert_t cert, estream_t fp, int have_secret, } dn = gpgsm_get_fingerprint_string (cert, 0); - es_fprintf (fp, " fingerprint: %s\n", dn?dn:"error"); + es_fprintf (fp, " sha1 fpr: %s\n", dn?dn:"error"); + xfree (dn); + + dn = gpgsm_get_fingerprint_string (cert, GCRY_MD_SHA256); + es_fprintf (fp, " sha2 fpr: %s\n", dn?dn:"error"); xfree (dn); if (opt.with_keygrip) |