From: Nikos Mavrogiannopoulos Date: Tue, 1 Apr 2014 12:29:58 +0000 (+0200) Subject: Print the SHA256 fingerprint of the certificate in addition to SHA1. X-Git-Tag: gnutls_3_3_0~76 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=35d26d0f794d4facd1848164fbfa39e97f7caaf1;p=thirdparty%2Fgnutls.git Print the SHA256 fingerprint of the certificate in addition to SHA1. --- 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); }