about summary refs log tree commit diff stats
path: root/src/ui
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-11-22 19:53:41 +0000
committerJames Booth <boothj5@gmail.com>2015-11-22 19:53:41 +0000
commitbf1e7efe230c899535ea2dedae8255c0a09b6cc3 (patch)
treec73dde9f235226da0dcf6ef56017381dbece628b /src/ui
parent216493ef07662e8f53f7c0de2391a43ef9bd3a8a (diff)
downloadprofani-tty-bf1e7efe230c899535ea2dedae8255c0a09b6cc3.tar.gz
Show summary of trusted certificates, add /tls cert <fingerprint>
fixes #676
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/console.c12
-rw-r--r--src/ui/ui.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/src/ui/console.c b/src/ui/console.c
index 54cd8d53..6aa706c5 100644
--- a/src/ui/console.c
+++ b/src/ui/console.c
@@ -189,6 +189,18 @@ cons_show_error(const char *const msg, ...)
 }
 
 void
+cons_show_tlscert_summary(TLSCertificate *cert)
+{
+    if (!cert) {
+        return;
+    }
+
+    cons_show("Subject     : %s", cert->subject_commonname);
+    cons_show("Issuer      : %s", cert->issuer_commonname);
+    cons_show("Fingerprint : %s", cert->fingerprint);
+}
+
+void
 cons_show_tlscert(TLSCertificate *cert)
 {
     if (!cert) {
diff --git a/src/ui/ui.h b/src/ui/ui.h
index da4b54a8..032a1161 100644
--- a/src/ui/ui.h
+++ b/src/ui/ui.h
@@ -293,6 +293,7 @@ void cons_show_contact_online(PContact contact, Resource *resource, GDateTime *l
 void cons_show_contact_offline(PContact contact, char *resource, char *status);
 void cons_theme_colours(void);
 void cons_show_tlscert(TLSCertificate *cert);
+void cons_show_tlscert_summary(TLSCertificate *cert);
 
 // title bar
 void title_bar_set_presence(contact_presence_t presence);