# HG changeset patch # User William Ehlhardt # Date 1184209153 0 # Node ID 5157ebe90b93130e9622a11df5f79a907628100f # Parent b1090cbfc2867211d3be1665dca7e317f1fc46d3 - Add activation/expiration time retrievers to GnuTLS plugin diff -r b1090cbfc286 -r 5157ebe90b93 libpurple/plugins/ssl/ssl-gnutls.c --- 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 =