]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Print the SHA256 fingerprint of the certificate in addition to SHA1.
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Tue, 1 Apr 2014 12:29:58 +0000 (14:29 +0200)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Tue, 1 Apr 2014 12:38:06 +0000 (14:38 +0200)
lib/x509/output.c

index cbfcdef820b2fc21b9aec9250406b0d7c1485db8..3ba6c04850c8f9d95a587ace995447aa406b9ea1 100644 (file)
@@ -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);
 }