Mercurial > pidgin
comparison libpurple/certificate.c @ 19047:3af5d9ed9ad3
- Write remove_cert function for tls_peers Pool
author | William Ehlhardt <williamehlhardt@gmail.com> |
---|---|
date | Fri, 27 Jul 2007 07:23:58 +0000 |
parents | 8599a27ad69c |
children | fd0b4b2f6cf0 |
comparison
equal
deleted
inserted
replaced
19046:8599a27ad69c | 19047:3af5d9ed9ad3 |
---|---|
541 | 541 |
542 g_free(keypath); | 542 g_free(keypath); |
543 return ret; | 543 return ret; |
544 } | 544 } |
545 | 545 |
546 static gboolean | |
547 x509_tls_peers_remove_cert(const gchar *id) | |
548 { | |
549 gboolean ret = FALSE; | |
550 gchar *keypath; | |
551 | |
552 g_return_val_if_fail(id, FALSE); | |
553 | |
554 /* Is the id even in the pool? */ | |
555 if (!x509_tls_peers_cert_in_pool(id)) { | |
556 purple_debug_warning("certificate/tls_peers", | |
557 "Id %s wasn't in the pool\n", | |
558 id); | |
559 return FALSE; | |
560 } | |
561 | |
562 /* OK, so work out the keypath and delete the thing */ | |
563 keypath = purple_certificate_pool_mkpath(&x509_tls_peers, id); | |
564 if ( unlink(keypath) != 0 ) { | |
565 purple_debug_error("certificate/tls_peers", | |
566 "Unlink of %s failed!\n", | |
567 keypath); | |
568 ret = FALSE; | |
569 } else { | |
570 ret = TRUE; | |
571 } | |
572 | |
573 g_free(keypath); | |
574 return ret; | |
575 } | |
576 | |
546 static GList * | 577 static GList * |
547 x509_tls_peers_get_idlist(void) | 578 x509_tls_peers_get_idlist(void) |
548 { | 579 { |
549 GList *idlist = NULL; | 580 GList *idlist = NULL; |
550 GDir *dir; | 581 GDir *dir; |