# HG changeset patch # User William Ehlhardt # Date 1185521038 0 # Node ID 3af5d9ed9ad36c26cd83349ab58a7637d2c79d0f # Parent 8599a27ad69c7691b7e8fb65ab73ca8ed66f8e57 - Write remove_cert function for tls_peers Pool diff -r 8599a27ad69c -r 3af5d9ed9ad3 libpurple/certificate.c --- 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) {