From 6dafb039a4d3c138fbcb803640ced0c346734059 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 18 Jan 2013 11:56:18 +0100 Subject: [PATCH] Bump libsoup dependency to 2.40.3 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This removes workarounds for below libsoup bugs and makes trust-prompt for WebDAV based backends work better, by checking also server certificates.  * soup_message_get_https_status() now returns the certificate    and flags for unsuccessful https connections as well as    successful ones. [bug #690176]  * Fixed a deadlock when calling soup_session_abort() on a SoupSessionSync in some cases. [bug #691399] --- configure.ac | 4 ++-- libebackend/e-backend.c | 52 +++------------------------------------- libedataserver/e-source-webdav.c | 40 ++----------------------------- 3 files changed, 7 insertions(+), 89 deletions(-) diff --git a/configure.ac b/configure.ac index 03be1b1..9d36fcc 100644 --- a/configure.ac +++ b/configure.ac @@ -43,8 +43,8 @@ m4_define([gdk_minimum_version], [3.2]) m4_define([gdk_encoded_version], [GDK_VERSION_3_2]) dnl Keep these two definitions in agreement. -m4_define([soup_minimum_version], [2.38.1]) -m4_define([soup_encoded_version], [SOUP_VERSION_2_38]) +m4_define([soup_minimum_version], [2.40.3]) +m4_define([soup_encoded_version], [SOUP_VERSION_2_40]) m4_define([gcr_minimum_version], [3.4]) m4_define([libsecret_minimum_version], [0.5]) diff --git a/libebackend/e-backend.c b/libebackend/e-backend.c index c351bc9..3543a94 100644 --- a/libebackend/e-backend.c +++ b/libebackend/e-backend.c @@ -545,55 +545,9 @@ e_backend_trust_prompt_sync (EBackend *backend, g_return_val_if_fail ( prompter != NULL, E_TRUST_PROMPT_RESPONSE_UNKNOWN); - /* Just a workaround for libsoup bug about not providing connection - * certificate on failed requests. This is fixed in libsoup since - * 2.41.3, but let's have this for now. I wrote it here to avoid - * code duplication, and once the libsoup 2.42.0 will be out all - * this code, together with other SOUP_CHECK_VERSION usages also - * in evolution, will be removed. */ - if (!e_named_parameters_get (parameters, "cert")) { - GList *button_captions = NULL; - const gchar *markup; - gchar *tmp = NULL; - - button_captions = g_list_append ( - button_captions, _("_Reject")); - button_captions = g_list_append ( - button_captions, _("Accept _Temporarily")); - button_captions = g_list_append ( - button_captions, _("_Accept Permanently")); - - markup = e_named_parameters_get (parameters, "markup"); - if (!markup) { - const gchar *host; - gchar *bhost; - - host = e_named_parameters_get (parameters, "host"); - bhost = g_strconcat ("", host, "", NULL); - tmp = g_strdup_printf ( - _("SSL certificate for '%s' is not trusted. " - "Do you wish to accept it?"), bhost); - g_free (bhost); - - markup = tmp; - } - - response = e_user_prompter_prompt_sync ( - prompter, "question", _("Certificate trust..."), - markup, NULL, TRUE, button_captions, cancellable, NULL); - - if (response == 1) - response = 2; - else if (response == 2) - response = 1; - - g_list_free (button_captions); - g_free (tmp); - } else { - response = e_user_prompter_extension_prompt_sync ( - prompter, "ETrustPrompt::trust-prompt", - parameters, NULL, cancellable, error); - } + response = e_user_prompter_extension_prompt_sync ( + prompter, "ETrustPrompt::trust-prompt", + parameters, NULL, cancellable, error); if (response == 0) return E_TRUST_PROMPT_RESPONSE_REJECT; diff --git a/libedataserver/e-source-webdav.c b/libedataserver/e-source-webdav.c index 5413230..1f1f082 100644 --- a/libedataserver/e-source-webdav.c +++ b/libedataserver/e-source-webdav.c @@ -1395,16 +1395,8 @@ e_source_webdav_prepare_ssl_trust_prompt (ESourceWebdav *extension, if (message->status_code != SOUP_STATUS_SSL_FAILED) return E_TRUST_PROMPT_RESPONSE_REJECT; - if (!soup_message_get_https_status (message, &cert, &cert_errors) || !cert) { - /* Before libsoup 2.41.3 the certificate was not set on - * failed requests, thus workaround this and do a simple - * prompt later. */ -#ifdef SOUP_CHECK_VERSION -#if SOUP_CHECK_VERSION(2, 41, 3) + if (!soup_message_get_https_status (message, &cert, &cert_errors) || !cert) return E_TRUST_PROMPT_RESPONSE_REJECT; -#endif -#endif - } soup_uri = soup_message_get_uri (message); @@ -1414,18 +1406,8 @@ e_source_webdav_prepare_ssl_trust_prompt (ESourceWebdav *extension, if (soup_uri_get_host (soup_uri) == NULL) return E_TRUST_PROMPT_RESPONSE_REJECT; -#ifdef SOUP_CHECK_VERSION -#if SOUP_CHECK_VERSION(2, 41, 3) g_return_val_if_fail (cert != NULL, E_TRUST_PROMPT_RESPONSE_REJECT); g_object_get (cert, "certificate", &bytes, NULL); -#else - bytes = g_byte_array_new (); - g_byte_array_append (bytes, (guint8 *) "1", 1); -#endif -#else - bytes = g_byte_array_new (); - g_byte_array_append (bytes, (guint8 *) "1", 1); -#endif if (bytes == NULL) return E_TRUST_PROMPT_RESPONSE_REJECT; @@ -1621,33 +1603,15 @@ e_source_webdav_store_ssl_trust_prompt (ESourceWebdav *extension, if (message->status_code != SOUP_STATUS_SSL_FAILED) return; - if (!soup_message_get_https_status (message, &cert, NULL) || !cert) { - /* before libsoup 2.41.3 the certificate was not set on failed requests, - * thus workaround this and store only simple value - */ - #ifdef SOUP_CHECK_VERSION - #if SOUP_CHECK_VERSION(2, 41, 3) + if (!soup_message_get_https_status (message, &cert, NULL) || !cert) return; - #endif - #endif - } soup_uri = soup_message_get_uri (message); if (!soup_uri || !soup_uri_get_host (soup_uri)) return; - #ifdef SOUP_CHECK_VERSION - #if SOUP_CHECK_VERSION(2, 41, 3) g_return_if_fail (cert != NULL); g_object_get (cert, "certificate", &bytes, NULL); - #else - bytes = g_byte_array_new (); - g_byte_array_append (bytes, (guint8 *) "1", 1); - #endif - #else - bytes = g_byte_array_new (); - g_byte_array_append (bytes, (guint8 *) "1", 1); - #endif if (!bytes) return; -- 2.7.4