# HG changeset patch # User William Ehlhardt # Date 1184209207 0 # Node ID bc4d0ebeabd3499e1f49cea4c81c1e737b4f1b1f # Parent 5157ebe90b93130e9622a11df5f79a907628100f - Add expiration/activation time display to tls_cached verifier diff -r 5157ebe90b93 -r bc4d0ebeabd3 libpurple/certificate.c --- a/libpurple/certificate.c Thu Jul 12 02:59:13 2007 +0000 +++ b/libpurple/certificate.c Thu Jul 12 03:00:07 2007 +0000 @@ -524,6 +524,9 @@ GByteArray *sha_bin; gchar *cn; const gchar *cn_match; + time_t activation, expiration; + /* Length of these buffers is dictated by 'man ctime_r' */ + gchar activ_str[26], expir_str[26]; gchar *primary, *secondary; PurpleCertificate *crt = (PurpleCertificate *) vrq->cert_chain->data; @@ -542,10 +545,17 @@ } else { cn_match = _("(DOES NOT MATCH)"); } + + /* Get the certificate times */ + /* TODO: Check the times against localtime */ + /* TODO: errorcheck? */ + g_assert(purple_certificate_get_times(crt, &activation, &expiration)); + ctime_r(&activation, activ_str); + ctime_r(&expiration, expir_str); /* Make messages */ primary = g_strdup_printf(_("%s has presented the following certificate:"), vrq->subject_name); - secondary = g_strdup_printf(_("Common name: %s %s\nFingerprint (SHA1): %s"), cn, cn_match, sha_asc); + secondary = g_strdup_printf(_("Common name: %s %s\n\nFingerprint (SHA1): %s\n\nActivation date: %s\nExpiration date: %s\n"), cn, cn_match, sha_asc, activ_str, expir_str); /* Make a semi-pretty display */ purple_request_accept_cancel(