# HG changeset patch # User William Ehlhardt # Date 1184316179 0 # Node ID e179e7e6ded72a034c1af5ac1a79112515648ded # Parent d6f902265076f6ebbe5f67339579d437dc63cddd - Add GnuTLS X.509 cert copy operator diff -r d6f902265076 -r e179e7e6ded7 libpurple/plugins/ssl/ssl-gnutls.c --- a/libpurple/plugins/ssl/ssl-gnutls.c Fri Jul 13 08:38:21 2007 +0000 +++ b/libpurple/plugins/ssl/ssl-gnutls.c Fri Jul 13 08:42:59 2007 +0000 @@ -581,6 +581,23 @@ return success; } +static PurpleCertificate * +x509_copy_certificate(PurpleCertificate *crt) +{ + x509_crtdata_t *crtdat; + PurpleCertificate *newcrt; + + g_return_val_if_fail(crt, NULL); + g_return_val_if_fail(crt->scheme == &x509_gnutls, NULL); + + crtdat = (x509_crtdata_t *) crt->data; + + newcrt = g_new0(PurpleCertificate, 1); + newcrt->scheme = &x509_gnutls; + newcrt->data = x509_crtdata_addref(crtdat); + + return newcrt; +} /** Frees a Certificate * * Destroys a Certificate's internal data structures and frees the pointer @@ -799,7 +816,7 @@ N_("X.509 Certificates"), /* User-visible scheme name */ x509_import_from_file, /* Certificate import function */ x509_export_certificate, /* Certificate export function */ - NULL, /* Copy */ + x509_copy_certificate, /* Copy */ x509_destroy_certificate, /* Destroy cert */ x509_sha1sum, /* SHA1 fingerprint */ NULL, /* Unique ID */