--- a/libpurple/plugins/ssl/ssl-nss.c Fri Jun 27 01:07:11 2014 +0530 +++ b/libpurple/plugins/ssl/ssl-nss.c Wed Jul 09 11:42:34 2014 +0530 @@ -946,68 +946,6 @@ return data; } -static gchar * -x509_display_string(PurpleCertificate *crt) -{ - gchar *sha_asc; - GByteArray *sha_bin; - gchar *cn; - gint64 activation, expiration; - gchar *activ_str, *expir_str; - gchar *text; -#if GLIB_CHECK_VERSION(2,26,0) - GDateTime *act_dt, *exp_dt; -#endif - - /* Pull out the SHA1 checksum */ - sha_bin = x509_sha1sum(crt); - sha_asc = purple_base16_encode_chunked(sha_bin->data, sha_bin->len); - - /* Get the cert Common Name */ - /* TODO: Will break on CA certs */ - cn = x509_common_name(crt); - - /* Get the certificate times */ - /* TODO: Check the times against localtime */ - /* TODO: errorcheck? */ - if (!x509_times(crt, &activation, &expiration)) { - purple_debug_error("certificate", - "Failed to get certificate times!\n"); - activation = expiration = 0; - } -#if GLIB_CHECK_VERSION(2,26,0) - act_dt = g_date_time_new_from_unix_local(activation); - activ_str = g_date_time_format(act_dt, "%c"); - g_date_time_unref(act_dt); - - exp_dt = g_date_time_new_from_unix_local(expiration); - expir_str = g_date_time_format(exp_dt, "%c"); - g_date_time_unref(exp_dt); -#else - activ_str = g_strdup(ctime(&activation)); - expir_str = g_strdup(ctime(&expiration)); -#endif - - /* Make messages */ - text = g_strdup_printf(_("Common name: %s\n\n" - "Fingerprint (SHA1): %s\n\n" - "Activation date: %s\n" - "Expiration date: %s\n"), - cn ? cn : "(null)", - sha_asc ? sha_asc : "(null)", - activ_str ? activ_str : "(null)", - expir_str ? expir_str : "(null)"); - - /* Cleanup */ - g_free(cn); - g_free(sha_asc); - g_free(activ_str); - g_free(expir_str); - g_byte_array_free(sha_bin, TRUE); - - return text; -} - static PurpleCertificateScheme x509_nss = { "x509", /* Scheme name */ N_("X.509 Certificates"), /* User-visible scheme name */ @@ -1024,7 +962,6 @@ x509_times, /* Activation/Expiration time */ x509_importcerts_from_file, /* Multiple certificate import function */ x509_get_der_data, /* Binary DER data */ - x509_display_string, /* Display representation */ NULL };