- Implement x509_ca_delete_cert soc.2007.certmgr

Mon, 13 Aug 2007 05:55:02 +0000

author
William Ehlhardt <williamehlhardt@gmail.com>
date
Mon, 13 Aug 2007 05:55:02 +0000
branch
soc.2007.certmgr
changeset 19349
747af1d98998
parent 19348
507a3bf4c4d4
child 19350
847740e5ca57

- Implement x509_ca_delete_cert

libpurple/certificate.c file | annotate | diff | comparison | revisions
--- a/libpurple/certificate.c	Mon Aug 13 05:52:21 2007 +0000
+++ b/libpurple/certificate.c	Mon Aug 13 05:55:02 2007 +0000
@@ -804,20 +804,25 @@
 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 *

mercurial