# HG changeset patch # User William Ehlhardt # Date 1182630847 0 # Node ID 3c6bf77bf7c4ca7c3911578609ecebf114bff826 # Parent 617447a71ab7d93b8de21946c67db080ae829333 - Add purple_certificate_verify_destroy and associated machinery diff -r 617447a71ab7 -r 3c6bf77bf7c4 libpurple/certificate.c --- 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; diff -r 617447a71ab7 -r 3c6bf77bf7c4 libpurple/certificate.h --- 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.