changeset 19203:6034b8db9dc1

- Add a function to search the x509_ca internal structures for an id
author William Ehlhardt <williamehlhardt@gmail.com>
date Mon, 13 Aug 2007 05:40:33 +0000
parents c0949e081f43
children 2847b6c84d6c
files libpurple/certificate.c
diffstat 1 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/certificate.c	Mon Aug 13 05:35:06 2007 +0000
+++ b/libpurple/certificate.c	Mon Aug 13 05:40:33 2007 +0000
@@ -727,6 +727,22 @@
 	x509_ca_initialized = FALSE;
 }
 
+/** Look up a ca_element by dn */
+static x509_ca_element *
+x509_ca_locate_crt(GList *lst, const gchar *dn)
+{
+	GList *cur;
+
+	for (cur = lst; cur; cur = cur->next) {
+		x509_ca_element *el = cur->data;
+		/* TODO: Unsafe? */
+		if ( !strcmp(dn, el->dn) ) {
+			return el;
+		}
+	}
+	return NULL;
+}
+
 static gboolean
 x509_ca_cert_in_pool(const gchar *id)
 {