comparison libpurple/certificate.c @ 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
comparison
equal deleted inserted replaced
19207:8926e15873ca 19208:7b81934f4c85
802 } 802 }
803 803
804 static gboolean 804 static gboolean
805 x509_ca_delete_cert(const gchar *id) 805 x509_ca_delete_cert(const gchar *id)
806 { 806 {
807 gboolean ret = FALSE; 807 x509_ca_element *el;
808 808
809 g_return_val_if_fail(x509_ca_lazy_init(), FALSE); 809 g_return_val_if_fail(x509_ca_lazy_init(), FALSE);
810 g_return_val_if_fail(id, FALSE); 810 g_return_val_if_fail(id, FALSE);
811 811
812 /* Is the id even in the pool? */ 812 /* Is the id even in the pool? */
813 if (!x509_ca_cert_in_pool(id)) { 813 el = x509_ca_locate_cert(x509_ca_certs, id);
814 if ( el == NULL ) {
814 purple_debug_warning("certificate/x509/ca", 815 purple_debug_warning("certificate/x509/ca",
815 "Id %s wasn't in the pool\n", 816 "Id %s wasn't in the pool\n",
816 id); 817 id);
817 return FALSE; 818 return FALSE;
818 } 819 }
819 820
820 return ret; 821 /* Unlink it from the memory cache and destroy it */
822 x509_ca_certs = g_list_remove(x509_ca_certs, el);
823 x509_ca_element_free(el);
824
825 return TRUE;
821 } 826 }
822 827
823 static GList * 828 static GList *
824 x509_ca_get_idlist(void) 829 x509_ca_get_idlist(void)
825 { 830 {