From 4bcda5c8076cb2b4baf2632956494d6bb5667815 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Nov 01 2013 11:42:47 +0000 Subject: Fix GNOME #707747 --- diff --git a/SASL-fix-facebook-mechanism.patch b/SASL-fix-facebook-mechanism.patch new file mode 100644 index 0000000..38df532 --- /dev/null +++ b/SASL-fix-facebook-mechanism.patch @@ -0,0 +1,73 @@ +From 761a83d9e7408d0e47e8c279052b93f8d9edb511 Mon Sep 17 00:00:00 2001 +From: Xavier Claessens +Date: Thu, 31 Oct 2013 13:39:21 -0400 +Subject: [PATCH] SASL: fix facebook mechanism + +libsoup was escaping '_' and '.' in the challenge response but the +facebook server is not expecting that. + +https://bugzilla.gnome.org/show_bug.cgi?id=707747 +--- + libempathy/empathy-sasl-mechanisms.c | 33 +++++++++++++++++---------------- + 1 file changed, 17 insertions(+), 16 deletions(-) + +diff --git a/libempathy/empathy-sasl-mechanisms.c b/libempathy/empathy-sasl-mechanisms.c +index ffb3aa4..05a2de9 100644 +--- a/libempathy/empathy-sasl-mechanisms.c ++++ b/libempathy/empathy-sasl-mechanisms.c +@@ -156,8 +156,7 @@ facebook_new_challenge_cb (TpChannel *channel, + GSimpleAsyncResult *result = user_data; + FacebookData *data; + GHashTable *h; +- GHashTable *params; +- gchar *response; ++ GString *response_string; + GArray *response_array; + + DEBUG ("new challenge: %s", challenge->data); +@@ -166,27 +165,29 @@ facebook_new_challenge_cb (TpChannel *channel, + + h = soup_form_decode (challenge->data); + +- /* See https://developers.facebook.com/docs/chat/#platauth */ +- params = g_hash_table_new (g_str_hash, g_str_equal); +- g_hash_table_insert (params, "method", g_hash_table_lookup (h, "method")); +- g_hash_table_insert (params, "nonce", g_hash_table_lookup (h, "nonce")); +- g_hash_table_insert (params, "access_token", data->access_token); +- g_hash_table_insert (params, "api_key", data->client_id); +- g_hash_table_insert (params, "call_id", "0"); +- g_hash_table_insert (params, "v", "1.0"); +- +- response = soup_form_encode_hash (params); +- DEBUG ("Response: %s", response); ++ /* See https://developers.facebook.com/docs/chat/#platauth. ++ * We don't use soup_form_encode() here because it would escape parameters ++ * and facebook server is not expecting that and would reject the response. */ ++ response_string = g_string_new ("v=1.0&call_id=0"); ++ g_string_append (response_string, "&access_token="); ++ g_string_append_uri_escaped (response_string, data->access_token, NULL, TRUE); ++ g_string_append (response_string, "&api_key="); ++ g_string_append_uri_escaped (response_string, data->client_id, NULL, TRUE); ++ g_string_append (response_string, "&method="); ++ g_string_append_uri_escaped (response_string, g_hash_table_lookup (h, "method"), NULL, TRUE); ++ g_string_append (response_string, "&nonce="); ++ g_string_append_uri_escaped (response_string, g_hash_table_lookup (h, "nonce"), NULL, TRUE); ++ ++ DEBUG ("Response: %s", response_string->str); + + response_array = g_array_new (FALSE, FALSE, sizeof (gchar)); +- g_array_append_vals (response_array, response, strlen (response)); ++ g_array_append_vals (response_array, response_string->str, response_string->len); + + tp_cli_channel_interface_sasl_authentication_call_respond (data->channel, -1, + response_array, generic_cb, g_object_ref (result), g_object_unref, NULL); + + g_hash_table_unref (h); +- g_hash_table_unref (params); +- g_free (response); ++ g_string_free (response_string, TRUE); + g_array_unref (response_array); + } + +-- +1.8.3.2 \ No newline at end of file diff --git a/empathy.spec b/empathy.spec index d67bbed..23d7282 100644 --- a/empathy.spec +++ b/empathy.spec @@ -17,7 +17,7 @@ Name: empathy Version: 3.8.4 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Instant Messaging Client for GNOME License: GPLv2+ @@ -26,6 +26,9 @@ URL: http://live.gnome.org/Empathy Source0: http://download.gnome.org/sources/%{name}/3.8/%{name}-%{version}.tar.xz Source1: %{name}-README.ConnectionManagers +# https://bugzilla.gnome.org/show_bug.cgi?id=707747 +Patch0: SASL-fix-facebook-mechanism.patch + BuildRequires: enchant-devel >= %{enchant_version} BuildRequires: iso-codes-devel BuildRequires: desktop-file-utils @@ -86,6 +89,8 @@ It is built on top of the Telepathy framework. # force this to be regenerated rm data/empathy.desktop +%patch0 -p1 + %build ## GCC complains about some unused functions, so we forcibly show those as @@ -195,6 +200,9 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : %{_datadir}/adium/message-styles/PlanetGNOME.AdiumMessageStyle/Contents/Resources/main.css %changelog +* Fri Nov 1 2013 Debarshi Ray - 3.8.4-2 +- Fix GNOME #707747 + * Mon Sep 9 2013 Brian Pepple - 3.8.4-1 - Update to 3.8.4. - Drop patches. Fixed upstream.