libpurple/certificate.c

branch
soc.2007.certmgr
changeset 18897
1f94d1ea37c3
parent 18896
70742468a820
child 18898
eb09543c2898
--- a/libpurple/certificate.c	Fri Jul 27 07:01:21 2007 +0000
+++ b/libpurple/certificate.c	Fri Jul 27 07:23:58 2007 +0000
@@ -543,6 +543,37 @@
 	return ret;
 }
 
+static gboolean
+x509_tls_peers_remove_cert(const gchar *id)
+{
+	gboolean ret = FALSE;
+	gchar *keypath;
+
+	g_return_val_if_fail(id, FALSE);
+
+	/* Is the id even in the pool? */
+	if (!x509_tls_peers_cert_in_pool(id)) {
+		purple_debug_warning("certificate/tls_peers",
+				     "Id %s wasn't in the pool\n",
+				     id);
+		return FALSE;
+	}
+
+	/* OK, so work out the keypath and delete the thing */
+	keypath = purple_certificate_pool_mkpath(&x509_tls_peers, id);	
+	if ( unlink(keypath) != 0 ) {
+		purple_debug_error("certificate/tls_peers",
+				   "Unlink of %s failed!\n",
+				   keypath);
+		ret = FALSE;
+	} else {
+		ret = TRUE;
+	}
+
+	g_free(keypath);
+	return ret;
+}
+
 static GList *
 x509_tls_peers_get_idlist(void)
 {

mercurial