changeset 2199:527ba1c1873e

Display the server SSL fingerprint when we connect
author Mikael Berthe <mikael@lilotux.net>
date Sun, 11 Oct 2015 17:20:29 +0200
parents 1591518a33b9
children fec172dbacc7
files mcabber/mcabber/xmpp.c
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/mcabber/xmpp.c	Sun Oct 11 17:19:15 2015 +0200
+++ b/mcabber/mcabber/xmpp.c	Sun Oct 11 17:20:29 2015 +0200
@@ -741,8 +741,15 @@
 static void connection_auth_cb(LmConnection *connection, gboolean success,
                                gpointer user_data)
 {
+  LmSSL *lssl;
+  if ((lssl = lm_connection_get_ssl(connection)) != NULL) {
+    char fpr[49] = {0};
+    fingerprint_to_hex(lm_ssl_get_fingerprint(lssl), fpr);
+    scr_LogPrint(LPRINT_LOGNORM, "Connection established.\n"
+                 "Remote fingerprint: %s", fpr);
+  }
+
   if (success) {
-
     xmpp_iq_request(NULL, NS_ROSTER);
     xmpp_iq_request(NULL, NS_DISCO_INFO);
     xmpp_request_storage("storage:bookmarks");