]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
x509/output: print key PIN on oneline output
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Wed, 22 Feb 2017 10:11:06 +0000 (11:11 +0100)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Thu, 23 Feb 2017 09:24:44 +0000 (10:24 +0100)
That is, instead of the public key ID. The key PIN due to HPKP
is now more widely used than hex-based key IDs.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
lib/x509/output.c

index 2eca0b99cf5a83ded80340bd506ab9a5516bb609..99644cc168486113c0cc893b99c135e65d3d0b19 100644 (file)
@@ -1847,12 +1847,12 @@ static void print_oneline(gnutls_buffer_st * str, gnutls_x509_crt_t cert)
                err = gnutls_x509_crt_get_key_id(cert, GNUTLS_KEYID_USE_SHA256,
                                                 buffer, &size);
                if (err < 0) {
-                       addf(str, "key ID error (%s)",
+                       addf(str, "key PIN error (%s)",
                             gnutls_strerror(err));
                } else {
-                       addf(str, "key-ID `sha256:");
-                       _gnutls_buffer_hexprint(str, buffer, size);
-                       adds(str, "'");
+                       addf(str, "pin-sha256=\"");
+                       _gnutls_buffer_base64print(str, buffer, size);
+                       adds(str, "\"");
                }
        }