" Hostname:"
(nsm-certificate-part (plist-get cert :subject) "CN" t) "\n")
(when (and (plist-get cert :public-key-algorithm)
- (plist-get cert :signature-algorithm))
+ (plist-get cert :signature-algorithm)
+ (or (plist-get cert :public-key-id-sha256)
+ (plist-get cert :public-key-id)))
(insert
" Public key:" (plist-get cert :public-key-algorithm)
- ", signature: " (plist-get cert :signature-algorithm) "\n"))
+ ", signature: " (plist-get cert :signature-algorithm) "\n"
+ " Public key ID:" (or (plist-get cert :public-key-id-sha256)
+ (plist-get cert :public-key-id)) "\n"))
(when (and (plist-get status :key-exchange)
(plist-get status :cipher)
(plist-get status :mac)
# define HAVE_GNUTLS_ETM_STATUS
# endif
+# if GNUTLS_VERSION_NUMBER >= 0x030401
+# define HAVE_GNUTLS_KEYID_USE_SHA256
+# endif
+
# if GNUTLS_VERSION_NUMBER < 0x030600
# define HAVE_GNUTLS_COMPRESSION_GET
# endif
xfree (buf);
}
+#ifdef HAVE_GNUTLS_KEYID_USE_SHA256
+ /* Public key ID, SHA-256 version. */
+ buf_size = 0;
+ err = gnutls_x509_crt_get_key_id (cert, GNUTLS_KEYID_USE_SHA256, NULL, &buf_size);
+ check_memory_full (err);
+ if (err == GNUTLS_E_SHORT_MEMORY_BUFFER)
+ {
+ void *buf = xmalloc (buf_size);
+ err = gnutls_x509_crt_get_key_id (cert, GNUTLS_KEYID_USE_SHA256, buf, &buf_size);
+ check_memory_full (err);
+ if (err >= GNUTLS_E_SUCCESS)
+ res = nconc2 (res, list2 (intern (":public-key-id-sha256"),
+ gnutls_hex_string (buf, buf_size, "sha256:")));
+ xfree (buf);
+ }
+#endif
+
/* Certificate fingerprint. */
buf_size = 0;
err = gnutls_x509_crt_get_fingerprint (cert, GNUTLS_DIG_SHA1,