diff options
author | James Booth <boothj5@gmail.com> | 2015-11-10 01:20:40 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2015-11-10 01:20:40 +0000 |
commit | 9302188a32fe2065927555a2a1d5438b8f128e1a (patch) | |
tree | 75927adeffd7c29d2580ce0089dc3140ff2ab8db /src/command | |
parent | bee27f47736d5d16500bb83e7ae9b5cd80cd4b26 (diff) | |
download | profani-tty-9302188a32fe2065927555a2a1d5438b8f128e1a.tar.gz |
Show current TLS certificate
Diffstat (limited to 'src/command')
-rw-r--r-- | src/command/commands.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/src/command/commands.c b/src/command/commands.c index d48fbe6d..2c3ee1fa 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -207,24 +207,7 @@ cmd_tls(ProfWin *window, const char *const command, gchar **args) } while (curr) { TLSCertificate *cert = curr->data; - if (cert->fingerprint) { - cons_show("Fingerprint : %s", cert->fingerprint); - } - if (cert->domain) { - cons_show("Domain : %s", cert->domain); - } - if (cert->organisation) { - cons_show("Organisation : %s", cert->organisation); - } - if (cert->email) { - cons_show("Email : %s", cert->email); - } - if (cert->notbefore) { - cons_show("Start : %s", cert->notbefore); - } - if (cert->notafter) { - cons_show("End : %s", cert->notafter); - } + cons_show_tlscert(cert); cons_show(""); curr = g_list_next(curr); } @@ -264,9 +247,11 @@ cmd_tls(ProfWin *window, const char *const command, gchar **args) cons_show("No TLS connection established"); return TRUE; } - char *cert = jabber_get_tls_peer_cert(); + TLSCertificate *cert = jabber_get_tls_peer_cert(); if (cert) { - cons_show("TLS certificate fingerprint: %s", cert); + cons_show_tlscert(cert); + cons_show(""); + tlscerts_free(cert); } else { cons_show("Error getting TLS fingerprint."); } |