libpurple/certificate.c

branch
soc.2007.certmgr
changeset 19347
ec35ba7ac30a
parent 19346
e0ae1b11effb
child 19348
507a3bf4c4d4
--- a/libpurple/certificate.c	Mon Aug 13 05:42:57 2007 +0000
+++ b/libpurple/certificate.c	Mon Aug 13 05:46:57 2007 +0000
@@ -761,21 +761,23 @@
 static PurpleCertificate *
 x509_ca_get_cert(const gchar *id)
 {
-	PurpleCertificateScheme *x509;
 	PurpleCertificate *crt = NULL;
+	x509_ca_element *el;
 
 	g_return_val_if_fail(x509_ca_lazy_init(), NULL);
 	g_return_val_if_fail(id, NULL);
 
-	/* Is it in the pool? */
-	if ( !x509_ca_cert_in_pool(id) ) {
-		return NULL;
+	/* Search the memory-cached pool */
+	el = x509_ca_locate_cert(x509_ca_certs, id);
+
+	if (el != NULL) {
+		/* Make a copy of the memcached one for the function caller
+		   to play with */
+		crt = purple_certificate_copy(el->crt);
+	} else {
+		crt = NULL;
 	}
 	
-	/* Look up the X.509 scheme */
-	x509 = purple_certificate_find_scheme("x509");
-	g_return_val_if_fail(x509, NULL);
-
 	return crt;
 }
 

mercurial