summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2017-02-22 11:11:06 +0100
committerNikos Mavrogiannopoulos <nmav@redhat.com>2017-02-23 10:24:44 +0100
commitbf0806e2ec2dff63a1ad8e394b1fe2f0ebc3b7a8 (patch)
tree0afc5a6d1ab7fb3827400f930999e8f3d80567ec
parentec60a3daa051603b0be5e1ba7a8484fb5fe7f42a (diff)
downloadgnutls-bf0806e2ec2dff63a1ad8e394b1fe2f0ebc3b7a8.tar.gz
x509/output: print key PIN on oneline output
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>
-rw-r--r--lib/x509/output.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/x509/output.c b/lib/x509/output.c
index 2eca0b99cf..99644cc168 100644
--- a/lib/x509/output.c
+++ b/lib/x509/output.c
@@ -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, "\"");
}
}