[Commits] [SCM] claws branch, oauth2, updated. 3.17.8-41-g545344390

miras at claws-mail.org miras at claws-mail.org
Mon Mar 15 13:52:09 CET 2021


The branch, oauth2 has been updated
       via  5453443909278fb12ef2e46c0743fb97724aa36e (commit)
      from  e5d76fdd9f271d1b234036669a286348866c75f0 (commit)

Summary of changes:
 src/oauth2.c | 33 ++++++++++++++++++++-------------
 1 file changed, 20 insertions(+), 13 deletions(-)


- Log -----------------------------------------------------------------
commit 5453443909278fb12ef2e46c0743fb97724aa36e
Author: Michael Rasmussen <mir at datanom.net>
Date:   Mon Mar 15 13:52:03 2021 +0100

    Refactor last commit to apply all SSL settings before ssl_init
    
    Signed-off-by: Michael Rasmussen <mir at datanom.net>

diff --git a/src/oauth2.c b/src/oauth2.c
index f348e006a..a70eb4538 100644
--- a/src/oauth2.c
+++ b/src/oauth2.c
@@ -240,16 +240,20 @@ int oauth2_obtain_tokens (Oauth2Service provider, OAUTH2Data *OAUTH2Data, const
         }
 
 	sock = sock_connect(OAUTH2info[i][OA2_BASE_URL], 443);
-	if(sock == NULL || ssl_init_socket(sock) == FALSE){
-	  log_message(LOG_PROTOCOL, "OAUTH2 SSL connecion error\n");
-      g_free(token);
-	  return (1);
-	}
-
-	sock->ssl_cert_auto_accept = TRUE;
+	if (sock == NULL) {
+                log_message(LOG_PROTOCOL, "OAUTH2 connecion error\n");
+                g_free(token);
+                return (1);
+        }
+        sock->ssl_cert_auto_accept = TRUE;
 	sock_set_nonblocking_mode(sock, FALSE);
 	sock_set_io_timeout(10);
 	sock->gnutls_priority = "NORMAL:!VERS-SSL3.0:!VERS-TLS1.0:!VERS-TLS1.1";
+        if (ssl_init_socket(sock) == FALSE) {
+                log_message(LOG_PROTOCOL, "OAUTH2 SSL connecion error\n");
+                g_free(token);
+                return (1);
+        }
 
 	refresh_token = g_malloc(OAUTH2BUFSIZE+1);	
 	access_token = g_malloc(OAUTH2BUFSIZE+1);
@@ -351,15 +355,18 @@ gint oauth2_use_refresh_token (Oauth2Service provider, OAUTH2Data *OAUTH2Data)
 	  return (1);
 
 	sock = sock_connect(OAUTH2info[i][OA2_BASE_URL], 443);
-	if(sock == NULL || ssl_init_socket(sock) == FALSE){
-	  log_message(LOG_PROTOCOL, "OAUTH2 SSL connecion error\n");
-	  return (1);
-	}
-
-	sock->ssl_cert_auto_accept = TRUE;
+	if (sock == NULL) {
+                log_message(LOG_PROTOCOL, "OAUTH2 connecion error\n");
+                return (1);
+        }
+        sock->ssl_cert_auto_accept = TRUE;
 	sock_set_nonblocking_mode(sock, FALSE);
 	sock_set_io_timeout(10);
 	sock->gnutls_priority = "NORMAL:!VERS-SSL3.0:!VERS-TLS1.0:!VERS-TLS1.1";
+        if (ssl_init_socket(sock) == FALSE) {
+                log_message(LOG_PROTOCOL, "OAUTH2 SSL connecion error\n");
+                return (1);
+        }
 
 	access_token = g_malloc(OAUTH2BUFSIZE+1);
 	request = g_malloc(OAUTH2BUFSIZE+1);

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list