# HG changeset patch # User William Ehlhardt # Date 1182273616 0 # Node ID e6271671eb243cef4618b39c5e3a0f264cd5cb5c # Parent 33690062e8b399062cbf4c87aca0ea1542824b1f - Expose some more functions in the x509 CertificateScheme. Doesn't compile :( diff -r 33690062e8b3 -r e6271671eb24 libpurple/certificate.h --- a/libpurple/certificate.h Tue Jun 19 16:07:33 2007 +0000 +++ b/libpurple/certificate.h Tue Jun 19 17:20:16 2007 +0000 @@ -68,6 +68,30 @@ */ gchar * name; + /** User-friendly name for this type + * ex: N_("X.509 Certificates") + */ + gchar * fullname; + + /** Imports a certificate from a file + * + * @param filename File to import the certificate from + * @return Pointer to the newly allocated Certificate struct + * or NULL on failure. + */ + Certificate * (* import_certificate)(gchar * filename); + + /** Destroys and frees a Certificate structure + * + * Destroys a Certificate's internal data structures and calls + * free(crt) + * + * @param crt Certificate instance to be destroyed. It WILL NOT be + * destroyed if it is not of the correct + * CertificateScheme. Can be NULL + */ + void (* destroy_certificate)(Certificate * crt); + /* TODO: Fill out this structure */ }; diff -r 33690062e8b3 -r e6271671eb24 libpurple/plugins/ssl/ssl-gnutls.c --- a/libpurple/plugins/ssl/ssl-gnutls.c Tue Jun 19 16:07:33 2007 +0000 +++ b/libpurple/plugins/ssl/ssl-gnutls.c Tue Jun 19 17:20:16 2007 +0000 @@ -344,7 +344,10 @@ /* X.509 certificate operations provided by this plugin */ /* TODO: Flesh this out! */ static CertificateScheme x509_gnutls = { - "x509" /* Scheme name */ + "x509", /* Scheme name */ + N_("X.509 Certificates"), /* User-visible scheme name */ + x509_import_from_file, /* Certificate import function */ + x509_destroy_certificate /* Destroy cert */ }; /** Transforms a gnutls_datum_t containing an X.509 certificate into a Certificate instance under the x509_gnutls scheme