From 0b2425c2983504d01d3d89139bd479784c145c26 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: May 18 2022 12:14:59 +0000 Subject: import evolution-data-server-3.28.5-5.el7_9.1 --- diff --git a/SOURCES/evolution-data-server-3.28.5-google-oauth2.patch b/SOURCES/evolution-data-server-3.28.5-google-oauth2.patch new file mode 100644 index 0000000..71ab3a7 --- /dev/null +++ b/SOURCES/evolution-data-server-3.28.5-google-oauth2.patch @@ -0,0 +1,101 @@ +diff -up evolution-data-server-3.28.5/src/libedataserver/e-oauth2-service-google.c.google-oauth2 evolution-data-server-3.28.5/src/libedataserver/e-oauth2-service-google.c +--- evolution-data-server-3.28.5/src/libedataserver/e-oauth2-service-google.c.google-oauth2 2018-07-30 15:17:06.000000000 +0200 ++++ evolution-data-server-3.28.5/src/libedataserver/e-oauth2-service-google.c 2022-05-04 18:57:08.059385307 +0200 +@@ -24,6 +24,7 @@ + #include "e-oauth2-service-google.h" + + /* https://developers.google.com/identity/protocols/OAuth2InstalledApp */ ++/* https://developers.google.com/identity/protocols/oauth2/native-app */ + + /* Forward Declarations */ + static void e_oauth2_service_google_oauth2_service_init (EOAuth2ServiceInterface *iface); +@@ -74,14 +75,60 @@ static const gchar * + eos_google_get_authentication_uri (EOAuth2Service *service, + ESource *source) + { +- return "https://accounts.google.com/o/oauth2/auth"; ++ return "https://accounts.google.com/o/oauth2/v2/auth"; + } + + static const gchar * + eos_google_get_refresh_uri (EOAuth2Service *service, + ESource *source) + { +- return "https://www.googleapis.com/oauth2/v3/token"; ++ return "https://oauth2.googleapis.com/token"; ++} ++ ++static const gchar * ++eos_google_get_redirect_uri (EOAuth2Service *service, ++ ESource *source) ++{ ++ G_LOCK_DEFINE_STATIC (redirect_uri); ++ const gchar *key_name = "oauth2-google-redirect-uri"; ++ gchar *value; ++ ++ G_LOCK (redirect_uri); ++ ++ value = g_object_get_data (G_OBJECT (service), key_name); ++ if (!value) { ++ const gchar *client_id = eos_google_get_client_id (service, source); ++ ++ if (client_id) { ++ GPtrArray *array; ++ gchar **strv; ++ gchar *joinstr; ++ guint ii; ++ ++ strv = g_strsplit (client_id, ".", -1); ++ array = g_ptr_array_new (); ++ ++ for (ii = 0; strv[ii]; ii++) { ++ g_ptr_array_insert (array, 0, strv[ii]); ++ } ++ ++ g_ptr_array_add (array, NULL); ++ ++ joinstr = g_strjoinv (".", (gchar **) array->pdata); ++ /* Use reverse-DNS of the client ID with the below path */ ++ value = g_strconcat (joinstr, ":/oauth2redirect", NULL); ++ ++ g_ptr_array_free (array, TRUE); ++ g_strfreev (strv); ++ g_free (joinstr); ++ ++ g_object_set_data_full (G_OBJECT (service), key_name, value, g_free); ++ } ++ } ++ ++ G_UNLOCK (redirect_uri); ++ ++ return value; + } + + static void +@@ -143,13 +190,13 @@ eos_google_extract_authorization_code (E + + params = soup_form_decode (query); + if (params) { +- const gchar *response; ++ const gchar *code; + +- response = g_hash_table_lookup (params, "response"); +- if (response && g_ascii_strncasecmp (response, "code=", 5) == 0) { +- *out_authorization_code = g_strdup (response + 5); ++ code = g_hash_table_lookup (params, "code"); ++ if (code && *code) { ++ *out_authorization_code = g_strdup (code); + known = TRUE; +- } else if (response && g_ascii_strncasecmp (response, "error", 5) == 0) { ++ } else if (g_hash_table_lookup (params, "error")) { + known = TRUE; + } + +@@ -177,6 +224,7 @@ e_oauth2_service_google_oauth2_service_i + iface->get_client_secret = eos_google_get_client_secret; + iface->get_authentication_uri = eos_google_get_authentication_uri; + iface->get_refresh_uri = eos_google_get_refresh_uri; ++ iface->get_redirect_uri = eos_google_get_redirect_uri; + iface->prepare_authentication_uri_query = eos_google_prepare_authentication_uri_query; + iface->extract_authorization_code = eos_google_extract_authorization_code; + } diff --git a/SPECS/evolution-data-server.spec b/SPECS/evolution-data-server.spec index 8efa880..a7477b4 100644 --- a/SPECS/evolution-data-server.spec +++ b/SPECS/evolution-data-server.spec @@ -32,7 +32,7 @@ Name: evolution-data-server Version: 3.28.5 -Release: 5%{?dist} +Release: 5%{?dist}.1 Group: System Environment/Libraries Summary: Backend data server for Evolution License: LGPLv2+ @@ -64,6 +64,9 @@ Patch05: evolution-data-server-3.28.5-cve-2019-3890.patch # RH bug #1772103 Patch06: evolution-data-server-3.28.5-delay-new-module-load.patch +# RH bug #2081786 +Patch07: evolution-data-server-3.28.5-google-oauth2.patch + ### Dependencies ### Requires: dconf @@ -188,6 +191,7 @@ the functionality of the installed %{name} package. %patch04 -p1 -b .test-cal-client-get-revision %patch05 -p1 -b .cve-2019-3890 %patch06 -p1 -b .delay-new-module-load +%patch07 -p1 -b .google-oauth2 %build @@ -449,6 +453,9 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &>/dev/null || : %{_datadir}/installed-tests %changelog +* Thu May 05 2022 Milan Crha - 3.28.5-5.1 +- Resolves: #2081786 (Backport patch for Google OAuth2 change) + * Tue Apr 21 2020 Milan Crha - 3.28.5-5 - Resolves: #1772103 (EDBusServer: Delay new module load)