changeset 20746:27f85efa6505

- Use certificate_pool_retrieve instead of certificate_pool_contains and then retrieve in tls_peers. This makes it something like atomic and eliminates about 10 lines of code in the process
author William Ehlhardt <williamehlhardt@gmail.com>
date Tue, 02 Oct 2007 08:45:17 +0000
parents 61fc6514aafb
children 17e605dd2de1
files libpurple/certificate.c
diffstat 1 files changed, 2 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/certificate.c	Tue Oct 02 08:31:34 2007 +0000
+++ b/libpurple/certificate.c	Tue Oct 02 08:45:17 2007 +0000
@@ -1372,7 +1372,8 @@
 	purple_debug_info("certificate/x509/tls_cached",
 			  "Checking for a CA with DN=%s\n",
 			  ca_id);
-	if ( !purple_certificate_pool_contains(ca, ca_id) ) {
+	ca_crt = purple_certificate_pool_retrieve(ca, ca_id);
+	if ( NULL == ca_crt ) {
 		purple_debug_info("certificate/x509/tls_cached",
 				  "Certificate Authority with DN='%s' not "
 				  "found. I'll prompt the user, I guess.\n",
@@ -1385,16 +1386,7 @@
 		return;
 	}
 
-	ca_crt = purple_certificate_pool_retrieve(ca, ca_id);
 	g_free(ca_id);
-	if (!ca_crt) {
-		purple_debug_error("certificate/x509/tls_cached",
-				   "Certificate authority disappeared out "
-				   "underneath me!\n");
-		purple_certificate_verify_complete(vrq,
-						   PURPLE_CERTIFICATE_INVALID);
-		return;
-	}
 	
 	/* Check the signature */
 	if ( !purple_certificate_signed_by(end_crt, ca_crt) ) {