summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Ehlhardt <williamehlhardt@gmail.com>2007-08-13 05:55:02 +0000
committerWilliam Ehlhardt <williamehlhardt@gmail.com>2007-08-13 05:55:02 +0000
commita526e9a3da0cdcf8afc0e09a3389673821308cd8 (patch)
tree0454c29e6ae168820df903069a5d6409ee6c2cf5
parent443086714fba47739a25c6c729910aa0f47ade9e (diff)
downloadpidgin-a526e9a3da0cdcf8afc0e09a3389673821308cd8.tar.gz
- Implement x509_ca_delete_cert
-rw-r--r--libpurple/certificate.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/libpurple/certificate.c b/libpurple/certificate.c
index d080182628..0a7f7c5526 100644
--- a/libpurple/certificate.c
+++ b/libpurple/certificate.c
@@ -804,20 +804,25 @@ x509_ca_put_cert(const gchar *id, PurpleCertificate *crt)
static gboolean
x509_ca_delete_cert(const gchar *id)
{
- gboolean ret = FALSE;
-
+ x509_ca_element *el;
+
g_return_val_if_fail(x509_ca_lazy_init(), FALSE);
g_return_val_if_fail(id, FALSE);
/* Is the id even in the pool? */
- if (!x509_ca_cert_in_pool(id)) {
+ el = x509_ca_locate_cert(x509_ca_certs, id);
+ if ( el == NULL ) {
purple_debug_warning("certificate/x509/ca",
"Id %s wasn't in the pool\n",
id);
return FALSE;
}
- return ret;
+ /* Unlink it from the memory cache and destroy it */
+ x509_ca_certs = g_list_remove(x509_ca_certs, el);
+ x509_ca_element_free(el);
+
+ return TRUE;
}
static GList *