[Commits] [SCM] claws branch, master, updated. 4.1.0-80-g8287ec1b2

miras at claws-mail.org miras at claws-mail.org
Tue Oct 18 09:15:43 UTC 2022


The branch, master has been updated
       via  8287ec1b254dd5b645858a0f7780080465f208f8 (commit)
       via  15c3f52d7f10144a379babe784d7517204e38a13 (commit)
      from  538bd91600ee21dd0f4b52cfd744d03160ec3865 (commit)

Summary of changes:
 src/oauth2.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)


- Log -----------------------------------------------------------------
commit 8287ec1b254dd5b645858a0f7780080465f208f8
Author: Michael Rasmussen <mir at datanom.net>
Date:   Mon Oct 17 23:37:50 2022 +0200

    Use define for gnutls-priority instead of hard coded string
    
    Signed-off-by: Michael Rasmussen <mir at datanom.net>

diff --git a/src/oauth2.c b/src/oauth2.c
index e772499db..c3065d82c 100644
--- a/src/oauth2.c
+++ b/src/oauth2.c
@@ -43,6 +43,7 @@
 #include "common/passcrypt.h"
 #include "prefs_common.h"
 
+#define GNUTLS_PRIORITY "NORMAL:!VERS-SSL3.0:!VERS-TLS1.0:!VERS-TLS1.1"
 //Yahoo requires token requests to send POST header Authorization: Basic
 //where the password is Base64 encoding of client_id:client_secret
 
@@ -255,7 +256,7 @@ int oauth2_obtain_tokens (Oauth2Service provider, OAUTH2Data *OAUTH2Data, const
 	gint timeout_secs = prefs_common_get_prefs()->io_timeout_secs;
 	debug_print("Socket timeout: %i sec(s)\n", timeout_secs);
 	sock_set_io_timeout(timeout_secs);
-	sock->gnutls_priority = "NORMAL:!VERS-SSL3.0:!VERS-TLS1.0:!VERS-TLS1.1";
+	sock->gnutls_priority = GNUTLS_PRIORITY;
         if (ssl_init_socket(sock) == FALSE) {
                 log_message(LOG_PROTOCOL, _("OAuth2 TLS connection error\n"));
                 g_free(token);
@@ -397,7 +398,7 @@ gint oauth2_use_refresh_token (Oauth2Service provider, OAUTH2Data *OAUTH2Data)
 	gint timeout_secs = prefs_common_get_prefs()->io_timeout_secs;
 	debug_print("Socket timeout: %i sec(s)\n", timeout_secs);
 	sock_set_io_timeout(timeout_secs);
-	sock->gnutls_priority = "NORMAL:!VERS-SSL3.0:!VERS-TLS1.0:!VERS-TLS1.1";
+	sock->gnutls_priority = GNUTLS_PRIORITY;
         if (ssl_init_socket(sock) == FALSE) {
                 log_message(LOG_PROTOCOL, _("OAuth2 TLS connection error\n"));
                 return (1);

commit 15c3f52d7f10144a379babe784d7517204e38a13
Author: Michael Rasmussen <mir at datanom.net>
Date:   Mon Oct 17 23:27:55 2022 +0200

    Handle non-ascii characters in server response. Fixes bug #4636
    
    Signed-off-by: Michael Rasmussen <mir at datanom.net>

diff --git a/src/oauth2.c b/src/oauth2.c
index 34a180771..e772499db 100644
--- a/src/oauth2.c
+++ b/src/oauth2.c
@@ -147,7 +147,7 @@ static gint oauth2_filter_access (gchar *json, gchar *access_token, gint *expiry
        GMatchInfo *matchInfo;
        GRegex *regex;
        
-       regex = g_regex_new ("\"access_token\": ?\"(.*?)\",?", 0, 0, NULL);
+       regex = g_regex_new ("\"access_token\": ?\"(.*?)\",?", G_REGEX_RAW, 0, NULL);
        g_regex_match (regex, json, 0, &matchInfo);
        if (g_match_info_matches (matchInfo)) 
 	 g_stpcpy (access_token,g_match_info_fetch (matchInfo, 1));
@@ -158,7 +158,7 @@ static gint oauth2_filter_access (gchar *json, gchar *access_token, gint *expiry
        
        g_match_info_free (matchInfo);
        
-       regex = g_regex_new ("\"expires_in\": ?([0-9]*),?", 0, 0, NULL);
+       regex = g_regex_new ("\"expires_in\": ?([0-9]*),?", G_REGEX_RAW, 0, NULL);
        g_regex_match (regex, json, 0, &matchInfo);
        if (g_match_info_matches (matchInfo)){
 	 // Reduce available token life to avoid attempting connections with (near) expired tokens
@@ -178,7 +178,7 @@ static gint oauth2_filter_refresh (gchar *json, gchar *refresh_token)
        GMatchInfo *matchInfo;
        GRegex *regex;
        
-       regex = g_regex_new ("\"refresh_token\": ?\"(.*?)\",?", 0, 0, NULL);
+       regex = g_regex_new ("\"refresh_token\": ?\"(.*?)\",?", G_REGEX_RAW, 0, NULL);
        g_regex_match (regex, json, 0, &matchInfo);
        if (g_match_info_matches (matchInfo)) 
 	 g_stpcpy (refresh_token,g_match_info_fetch (matchInfo, 1));

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list