request: Remove now unused certificate request type

Wed, 30 May 2018 16:16:52 -0500

author
Mike Ruprecht <cmaiku@gmail.com>
date
Wed, 30 May 2018 16:16:52 -0500
changeset 39315
aad7494ce877
parent 39314
520f77e2ec45
child 39316
d03982696ad0

request: Remove now unused certificate request type

glib-networking >= 2.57.1 uses system certificates by default.
Servers *should* have a proper certificate, and people with
self-signed ones *should* be able to add them to their system.
Being that exceptions to this are extreme edge cases, it *should*
be fine to just use the system certificate store and not worry
about trying to manage certificate trust ourselves. If it turns
out this is needed, we can always add support later, potentially
via a plugin. To that end, this patch drops libpurple's now unused
certificate request type.

libpurple/request.c file | annotate | diff | comparison | revisions
libpurple/request.h file | annotate | diff | comparison | revisions
--- a/libpurple/request.c	Wed May 30 16:15:25 2018 -0500
+++ b/libpurple/request.c	Wed May 30 16:16:52 2018 -0500
@@ -125,11 +125,6 @@
 
 		struct
 		{
-			GTlsCertificate *cert;
-		} certificate;
-
-		struct
-		{
 			PurpleRequestDatasheet *sheet;
 		} datasheet;
 	} u;
@@ -1954,31 +1949,6 @@
 }
 
 PurpleRequestField *
-purple_request_field_certificate_new(const char *id, const char *text, GTlsCertificate *cert)
-{
-	PurpleRequestField *field;
-
-	g_return_val_if_fail(id   != NULL, NULL);
-	g_return_val_if_fail(text != NULL, NULL);
-	g_return_val_if_fail(cert != NULL, NULL);
-
-	field = purple_request_field_new(id, text, PURPLE_REQUEST_FIELD_CERTIFICATE);
-
-	field->u.certificate.cert = cert;
-
-	return field;
-}
-
-GTlsCertificate *
-purple_request_field_certificate_get_value(const PurpleRequestField *field)
-{
-	g_return_val_if_fail(field != NULL, NULL);
-	g_return_val_if_fail(field->type == PURPLE_REQUEST_FIELD_CERTIFICATE, NULL);
-
-	return field->u.certificate.cert;
-}
-
-PurpleRequestField *
 purple_request_field_datasheet_new(const char *id,
 	const gchar *text, PurpleRequestDatasheet *sheet)
 {
@@ -2472,29 +2442,6 @@
 	return NULL;
 }
 
-void *
-purple_request_certificate(void *handle, const char *title,
-                                  const char *primary, const char *secondary,
-                                  GTlsCertificate *cert,
-                                  const char *ok_text, GCallback ok_cb,
-                                  const char *cancel_text, GCallback cancel_cb,
-                                  void *user_data)
-{
-	PurpleRequestFields *fields;
-	PurpleRequestFieldGroup *group;
-	PurpleRequestField *field;
-
-	fields = purple_request_fields_new();
-	group = purple_request_field_group_new(NULL);
-	purple_request_fields_add_group(fields, group);
-	field = purple_request_field_certificate_new("certificate", "Certificate", cert);
-	purple_request_field_group_add_field(group, field);
-
-	return purple_request_fields(handle, title, primary, secondary, fields,
-	                             ok_text, ok_cb, cancel_text, cancel_cb,
-	                             NULL, user_data);
-}
-
 gboolean
 purple_request_is_valid_ui_handle(void *ui_handle, PurpleRequestType *type)
 {
--- a/libpurple/request.h	Wed May 30 16:15:25 2018 -0500
+++ b/libpurple/request.h	Wed May 30 16:16:52 2018 -0500
@@ -29,7 +29,6 @@
  */
 
 #include <stdlib.h>
-#include <gio/gio.h>
 #include <glib-object.h>
 #include <glib.h>
 
@@ -112,7 +111,6 @@
 	PURPLE_REQUEST_FIELD_LABEL,
 	PURPLE_REQUEST_FIELD_IMAGE,
 	PURPLE_REQUEST_FIELD_ACCOUNT,
-	PURPLE_REQUEST_FIELD_CERTIFICATE,
 	PURPLE_REQUEST_FIELD_DATASHEET
 
 } PurpleRequestFieldType;
@@ -1776,35 +1774,6 @@
 		const PurpleRequestField *field);
 
 /**************************************************************************/
-/* Certificate Field API                                                  */
-/**************************************************************************/
-
-/**
- * purple_request_field_certificate_new:
- * @id:   The field ID.
- * @text: The label of the field.
- * @cert: The certificate of the field.
- *
- * Creates a certificate field.
- *
- * Returns: The new field.
- */
-PurpleRequestField *purple_request_field_certificate_new(const char *id,
-														 const char *text,
-														 GTlsCertificate *cert);
-
-/**
- * purple_request_field_certificate_get_value:
- * @field: The field.
- *
- * Returns the certificate in a certificate field.
- *
- * Returns: The certificate.
- */
-GTlsCertificate *purple_request_field_certificate_get_value(
-		const PurpleRequestField *field);
-
-/**************************************************************************/
 /* Datasheet Field API                                                    */
 /**************************************************************************/
 
@@ -2240,39 +2209,6 @@
 	GCallback ok_cb, GCallback cancel_cb,
 	PurpleRequestCommonParameters *cpar, void *user_data);
 
-/**
- * purple_request_certificate:
- * @handle:        The plugin or connection handle.  For some things this
- *                 is <emphasis>extremely</emphasis> important.  See the comments on
- *                 purple_request_input().
- * @title:         The title of the message, or %NULL if it should have
- *                 no title.
- * @primary:       The main point of the message, or %NULL if you're
- *                 feeling enigmatic.
- * @secondary:     Secondary information, or %NULL if there is none.
- * @cert:          The #GTlsCertificate associated with this request.
- * @ok_text:       The text for the <literal>OK</literal> button, which may not
- *                 be %NULL.
- * @ok_cb:         The callback for the <literal>OK</literal> button, which may
- *                 not be %NULL.
- * @cancel_text:   The text for the <literal>Cancel</literal> button, which may
- *                 not be %NULL.
- * @cancel_cb:     The callback for the <literal>Cancel</literal> button, which
- *                 may be %NULL.
- * @user_data:     The data to pass to the callback.
- *
- * Prompts the user for action over a certificate.
- *
- * This is often represented as a dialog with a button for each action.
- *
- * Returns: A UI-specific handle.
- */
-void *purple_request_certificate(void *handle, const char *title,
-	const char *primary, const char *secondary, GTlsCertificate *cert,
-	const char *ok_text, GCallback ok_cb,
-	const char *cancel_text, GCallback cancel_cb,
-	void *user_data);
-
 /**************************************************************************/
 /* UI Registration Functions                                              */
 /**************************************************************************/

mercurial