summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2014-04-01 14:29:58 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2014-04-01 14:38:06 +0200
commit35d26d0f794d4facd1848164fbfa39e97f7caaf1 (patch)
tree07fc3d41d6b8b425aa8fae6369c8ca27d02faafa /lib
parent40b8f168cc8e306fb15e18bc8e437f34b6b02235 (diff)
downloadgnutls-35d26d0f794d4facd1848164fbfa39e97f7caaf1.tar.gz
Print the SHA256 fingerprint of the certificate in addition to SHA1.
Diffstat (limited to 'lib')
-rw-r--r--lib/x509/output.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/x509/output.c b/lib/x509/output.c
index cbfcdef820..3ba6c04850 100644
--- a/lib/x509/output.c
+++ b/lib/x509/output.c
@@ -1720,10 +1720,8 @@ print_fingerprint(gnutls_buffer_st * str, gnutls_x509_crt_t cert,
return;
}
- if (algo == GNUTLS_DIG_MD5)
- adds(str, _("\tMD5 fingerprint:\n\t\t"));
- else
- adds(str, _("\tSHA-1 fingerprint:\n\t\t"));
+ addf(str, _("\t%s fingerprint:\n\t\t"), gnutls_mac_get_name((gnutls_mac_algorithm_t)algo));
+
_gnutls_buffer_hexprint(str, buffer, size);
adds(str, "\n");
}
@@ -1773,6 +1771,7 @@ print_other(gnutls_buffer_st * str, gnutls_x509_crt_t cert,
{
if (format != GNUTLS_CRT_PRINT_UNSIGNED_FULL) {
print_fingerprint(str, cert, GNUTLS_DIG_SHA1);
+ print_fingerprint(str, cert, GNUTLS_DIG_SHA256);
}
print_keyid(str, cert);
}