diff libpurple/plugins/ssl/ssl-gnutls.c @ 19013:5157ebe90b93

- Add activation/expiration time retrievers to GnuTLS plugin
author William Ehlhardt <williamehlhardt@gmail.com>
date Thu, 12 Jul 2007 02:59:13 +0000
parents 7fd9bd55f8d0
children e6558bae2bc6
line wrap: on
line diff
--- a/libpurple/plugins/ssl/ssl-gnutls.c	Thu Jul 12 01:10:04 2007 +0000
+++ b/libpurple/plugins/ssl/ssl-gnutls.c	Thu Jul 12 02:59:13 2007 +0000
@@ -729,6 +729,34 @@
 	}
 }
 
+static time_t
+x509_activation (PurpleCertificate *crt)
+{
+	gnutls_x509_crt_t crt_dat;
+
+	g_assert(crt);
+	g_assert(crt->scheme == &x509_gnutls);
+
+	crt_dat = *( (gnutls_x509_crt_t *) crt->data );
+
+	/* TODO: Errorcheck this? */
+	return gnutls_x509_crt_get_activation_time(crt_dat);
+}
+
+static time_t
+x509_expiration (PurpleCertificate *crt)
+{
+	gnutls_x509_crt_t crt_dat;
+
+	g_assert(crt);
+	g_assert(crt->scheme == &x509_gnutls);
+
+	crt_dat = *( (gnutls_x509_crt_t *) crt->data );
+
+	/* TODO: Errorcheck this? */
+	return gnutls_x509_crt_get_expiration_time(crt_dat);
+}
+
 /* X.509 certificate operations provided by this plugin */
 /* TODO: Flesh this out! */
 static PurpleCertificateScheme x509_gnutls = {
@@ -742,8 +770,8 @@
 	NULL,                            /* Issuer Unique ID */
 	x509_common_name,                /* Subject name */
 	x509_check_name,                 /* Check subject name */
-	NULL,                            /* Activation time */
-	NULL                             /* Expiration time */
+	x509_activation,                 /* Activation time */
+	x509_expiration                  /* Expiration time */
 };
 
 static PurpleSslOps ssl_ops =