changeset 19096:81163e153778

- Add a hacked-up method of adding certs to the CA pool
author William Ehlhardt <williamehlhardt@gmail.com>
date Sun, 12 Aug 2007 04:03:45 +0000
parents cd70e75f9a83
children d470d42d2cb1
files libpurple/certificate.c
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/certificate.c	Sun Aug 12 03:44:44 2007 +0000
+++ b/libpurple/certificate.c	Sun Aug 12 04:03:45 2007 +0000
@@ -692,6 +692,7 @@
 x509_ca_put_cert(const gchar *id, PurpleCertificate *crt)
 {
 	gboolean ret = FALSE;
+	x509_ca_element *el;
 
 	g_return_val_if_fail(x509_ca_lazy_init(), FALSE);
 	g_return_val_if_fail(crt, FALSE);
@@ -700,6 +701,14 @@
 	/* TODO: Perhaps just check crt->scheme->name instead? */
 	g_return_val_if_fail(crt->scheme == purple_certificate_find_scheme(x509_ca.scheme_name), FALSE);
 
+	/* TODO: This is a quick way of doing this. At some point the change
+	   ought to be flushed to disk somehow. */
+	el = g_new0(x509_ca_element, 1);
+	el->dn = purple_certificate_get_unique_id(crt);
+	el->crt = purple_certificate_copy(crt);
+	x509_ca_certs = g_list_prepend(x509_ca_certs, el);
+	ret = TRUE;
+
 	return ret;
 }