Mercurial > pidgin
changeset 19208:7b81934f4c85
- Implement x509_ca_delete_cert
author | William Ehlhardt <williamehlhardt@gmail.com> |
---|---|
date | Mon, 13 Aug 2007 05:55:02 +0000 |
parents | 8926e15873ca |
children | a6ab0ea47d0f |
files | libpurple/certificate.c |
diffstat | 1 files changed, 9 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- 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 *