pidgin: 64235fd9: Add a function for retrieving the raw DE...

qulogic at pidgin.im qulogic at pidgin.im
Thu Dec 22 21:25:47 EST 2011


----------------------------------------------------------------------
Revision: 64235fd9a228e343ce46d7f492ad8128df7a638e
Parent:   4f3ec1377120e2f648e125052df608a754552663
Author:   qulogic at pidgin.im
Date:     12/22/11 20:09:13
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/64235fd9a228e343ce46d7f492ad8128df7a638e

Changelog: 

Add a function for retrieving the raw DER representation of a
certification.

Changes against parent 4f3ec1377120e2f648e125052df608a754552663

  patched  libpurple/certificate.c
  patched  libpurple/certificate.h

-------------- next part --------------
============================================================
--- libpurple/certificate.c	acff7a354ab68c4259e96da14cee1a57abc3593d
+++ libpurple/certificate.c	084505c8e55c07db86a7d6ac74b929759762434a
@@ -499,6 +499,24 @@ purple_certificate_get_times(PurpleCerti
 	return (scheme->get_times)(crt, activation, expiration);
 }
 
+GByteArray *
+purple_certificate_get_der_data(PurpleCertificate *crt)
+{
+	PurpleCertificateScheme *scheme;
+	GByteArray *data;
+
+	g_return_val_if_fail(crt, NULL);
+	g_return_val_if_fail(crt->scheme, NULL);
+
+	scheme = crt->scheme;
+
+	g_return_val_if_fail(scheme->get_der_data, NULL);
+
+	data = (scheme->get_der_data)(crt);
+
+	return data;
+}
+
 gchar *
 purple_certificate_pool_mkpath(PurpleCertificatePool *pool, const gchar *id)
 {
============================================================
--- libpurple/certificate.h	dbabc811a5eebadde1308f263fbdaa6855920c58
+++ libpurple/certificate.h	5d633be617de911eac5f7758f1c36c88aa4e835e
@@ -257,9 +257,17 @@ struct _PurpleCertificateScheme
 	 */
 	GSList * (* import_certificates)(const gchar * filename);
 
+	/**
+	 * Retrieves the certificate data in DER form
+	 *
+	 * @param crt   Certificate instance
+	 * @return Binary DER representation of certificate - must be freed using
+	 *         g_byte_array_free()
+	 */
+	GByteArray * (* get_der_data)(PurpleCertificate *crt);
+
 	void (*_purple_reserved1)(void);
 	void (*_purple_reserved2)(void);
-	void (*_purple_reserved3)(void);
 };
 
 /** A set of operations used to provide logic for verifying a Certificate's
@@ -561,6 +569,17 @@ purple_certificate_get_times(PurpleCerti
 gboolean
 purple_certificate_get_times(PurpleCertificate *crt, time_t *activation, time_t *expiration);
 
+/**
+ * Retrieves the certificate data in DER form.
+ *
+ * @param crt Certificate instance
+ *
+ * @return Binary DER representation of the certificate - must be freed using
+ *         g_byte_array_free().
+ */
+GByteArray *
+purple_certificate_get_der_data(PurpleCertificate *crt);
+
 /*@}*/
 
 /*****************************************************************************/


More information about the Commits mailing list