changeset 18947:3c6bf77bf7c4

- Add purple_certificate_verify_destroy and associated machinery
author William Ehlhardt <williamehlhardt@gmail.com>
date Sat, 23 Jun 2007 20:34:07 +0000
parents 617447a71ab7
children 22838745420a
files libpurple/certificate.c libpurple/certificate.h
diffstat 2 files changed, 34 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/certificate.c	Sat Jun 23 19:47:58 2007 +0000
+++ b/libpurple/certificate.c	Sat Jun 23 20:34:07 2007 +0000
@@ -74,6 +74,23 @@
 }
 
 void
+purple_certificate_verify_destroy (PurpleCertificateVerificationRequest *vrq)
+{
+	PurpleCertificateVerifier *vr;
+
+	if (NULL == vrq) return;
+
+	/* TODO: Should I make it easier on the Verifier programmer and
+	   clean up some of vrq's internals here? */
+	
+	/* Fetch the Verifier responsible... */
+	vr = vrq->verifier;
+	/* ...and order it to KILL */
+	(vr->destroy_request)(vrq);
+}
+
+
+void
 purple_certificate_destroy (PurpleCertificate *crt)
 {
 	PurpleCertificateScheme *scheme;
--- a/libpurple/certificate.h	Sat Jun 23 19:47:58 2007 +0000
+++ b/libpurple/certificate.h	Sat Jun 23 20:34:07 2007 +0000
@@ -49,13 +49,11 @@
 
 /**
  * Callback function for the results of a verification check
- * @param vrq      Request structure operated on
  * @param st       Status code
  * @param userdata User-defined data
  */
 typedef void (*PurpleCertificateVerifiedCallback)
-		(PurpleCertificateVerificationRequest *vrq,
-		 PurpleCertificateVerificationStatus,
+		(PurpleCertificateVerificationStatus,
 		 gpointer userdata);
 							  
 /** A certificate instance
@@ -189,6 +187,13 @@
 	 * @param vrq      Request to process
 	 */
 	void (* start_verification)(PurpleCertificateVerificationRequest *vrq);
+
+	/**
+	 * Destroy a completed Request under this Verifier
+	 *
+	 * @param vrq       Request to destroy
+	 */
+	void (* destroy_request)(PurpleCertificateVerificationRequest *vrq);
 };
 
 /** Structure for a single certificate request
@@ -263,6 +268,15 @@
 			   gpointer cb_data);
 
 /**
+ * Disposes of a VerificationRequest once it is complete
+ *
+ * @param vrq           Request to destroy. Will be free()'d.
+ *                      The certificate chain involved will also be destroyed.
+ */
+void
+purple_certificate_verify_destroy (PurpleCertificateVerificationRequest *vrq);
+
+/**
  * Destroys and free()'s a Certificate
  *
  * @param crt        Instance to destroy. May be NULL.