Retrieve and save new fingerprints from libstrophe.

This also reads the certificate SHA256 and pubkey fingerprint from
libstrophe, but doesn't store it persistently yet.

Related-to: https://github.com/profanity-im/profanity/issues/2068
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
This commit is contained in:
Steffen Jaeckel
2025-11-04 17:41:05 +01:00
parent 4dcaa839fa
commit 0acea8d0d2
5 changed files with 47 additions and 8 deletions

View File

@@ -90,6 +90,13 @@ cons_show(const char* const msg, ...)
va_end(arg);
}
#define cons_show_if_set(fmt, elmnt) \
do { \
if (elmnt) { \
cons_show(fmt, elmnt); \
} \
} while (0)
void
cons_show_padded(int pad, const char* const msg, ...)
{
@@ -260,7 +267,9 @@ cons_show_tlscert(const TLSCertificate* cert)
cons_show(" Start : %s", cert->notbefore);
cons_show(" End : %s", cert->notafter);
cons_show(" Fingerprint : %s", cert->fingerprint_sha1);
cons_show_if_set(" Fingerprint SHA1 : %s", cert->fingerprint_sha1);
cons_show_if_set(" Fingerprint SHA256 : %s", cert->fingerprint_sha256);
cons_show_if_set(" Pubkey Fingerprint : %s", cert->pubkey_fingerprint);
}
void