• Bug#1109884: unblock: sogo/5.12.1-3 (2/2)

    From Jordi Mallach@21:1/5 to All on Fri Jul 25 14:20:01 2025
    [continued from previous message]

    +@@ -498,7 +666,8 @@ static BOOL SOGoOpenIDDebugEnabled = YES;
    + - (NSMutableDictionary *) fetchToken: (NSString * ) code redirect: (NSString *) oldLocation
    + {
    + NSString *location, *form, *content;
    +- WOResponse *response;
    ++ SimpleOpenIdResponse *response;
    ++ // WOResponse *response;
    + NSUInteger status;
    + NSMutableDictionary *result;
    + NSDictionary *headers;
    +@@ -523,7 +692,10 @@ static BOOL SOGoOpenIDDebugEnabled = YES;
    + self->forDomain, @"sogo-user-domain", nil];
    + else
    + headers = [NSDictionary dictionaryWithObject: @"application/x-www-form-urlencoded" forKey: @"content-type"];
    +-
    ++
    ++ if(SOGoOpenIDDebugEnabled)
    ++ NSLog(@"OpenId fetch token, form %@", form);
    ++
    + response = [self _performOpenIdRequest: location
    + method: @"POST"
    + headers: headers
    +@@ -566,7 +738,8 @@ static BOOL SOGoOpenIDDebugEnabled = YES;
    + - (NSMutableDictionary *) refreshToken: (NSString * ) userRefreshToken
    + {
    + NSString *location, *form, *content;
    +- WOResponse *response;
    ++ SimpleOpenIdResponse *response;
    ++ // WOResponse *response;
    + NSUInteger status;
    + NSMutableDictionary *result;
    + NSDictionary *headers;
    +@@ -639,7 +812,8 @@ static BOOL SOGoOpenIDDebugEnabled = YES;
    + - (NSMutableDictionary *) fetchUserInfo
    + {
    + NSString *location, *auth, *content;
    +- WOResponse *response;
    ++ SimpleOpenIdResponse *response;
    ++ // WOResponse *response;
    + NSUInteger status;
    + NSMutableDictionary *result;
    + NSDictionary *profile, *headers;
    +@@ -695,7 +869,7 @@ static BOOL SOGoOpenIDDebugEnabled = YES;
    + }
    + else
    + {
    +- [self logWithFormat: @"Error during fetching the token (status %d), response: %@", status, response];
    ++ [self logWithFormat: @"Error fetching userInfo (status %d), response: %@", status, response];
    + [result setObject: @"http-error" forKey: @"error"];
    + }
    + }
    +diff --git a/SoObjects/SOGo/SOGoSystemDefaults.h b/SoObjects/SOGo/SOGoSystemDefaults.h
    +index 3dce05cf6..fc5729ee3 100644
    +--- a/SoObjects/SOGo/SOGoSystemDefaults.h
    ++++ b/SoObjects/SOGo/SOGoSystemDefaults.h
    +@@ -106,6 +106,7 @@ NSComparisonResult languageSort(id el1, id el2, void *context);
    + - (NSString *) openIdClient;
    + - (NSString *) openIdClientSecret;
    + - (NSString *) openIdEmailParam;
    ++- (NSString *) openIdHttpVersion;
    + - (BOOL) openIdEnableRefreshToken;
    + - (BOOL) openIdLogoutEnabled: (NSString *) _domain;
    + - (int) openIdTokenCheckInterval;
    +diff --git a/SoObjects/SOGo/SOGoSystemDefaults.m b/SoObjects/SOGo/SOGoSystemDefaults.m
    +index b47fbf6d6..a64ff76c9 100644
    +--- a/SoObjects/SOGo/SOGoSystemDefaults.m
    ++++ b/SoObjects/SOGo/SOGoSystemDefaults.m
    +@@ -779,6 +779,15 @@ NSComparisonResult languageSort(id el1, id el2, void *context)
    + return emailParam;
    + }
    +
    ++- (NSString *) openIdHttpVersion
    ++{
    ++ NSString *httpVersion;
    ++ httpVersion = [self stringForKey: @"SOGoOpenIdHttpVersion"];
    ++ if(!httpVersion)
    ++ httpVersion = @"HTTP/1.1";
    ++ return httpVersion;
    ++}
    ++
    + - (BOOL) openIdLogoutEnabled: (NSString *) _domain
    + {
    + if(_domain && [self doesLoginTypeByDomain])
    +commit 42f620e56201e17391532507c02ae370f117c574
    +Author: Hivert Quentin <[email protected]>
    +Date: Thu Jul 24 14:46:45 2025 +0200
    +
    + fix(curl): properly close curl connection
    +
    +diff --git a/SoObjects/SOGo/SOGoOpenIdSession.m b/SoObjects/SOGo/SOGoOpenIdSession.m
    +index fda50d85e..b81b26dea 100644
    +--- a/SoObjects/SOGo/SOGoOpenIdSession.m
    ++++ b/SoObjects/SOGo/SOGoOpenIdSession.m
    +@@ -54,7 +54,6 @@ size_t curl_body_function(void *ptr, size_t size, size_t nmemb, void *buffer)
    + return total;
    + }
    +
    +-
    + @implementation SimpleOpenIdResponse
    +
    + - (id)init {
    +@@ -352,16 +351,19 @@ size_t curl_body_function(void *ptr, size_t size, size_t nmemb, void *buffer)
    + if(SOGoOpenIDDebugEnabled)
    + NSLog(@"OpenId perform request: response is: %@", response);
    +
    ++ curl_easy_cleanup(curl);
    + return [response autorelease];
    + }
    + else if (status == 404)
    + {
    + [self errorWithFormat: @"OpenID endpoint not found (404): %@", endpoint];
    ++ curl_easy_cleanup(curl);
    + return nil;
    + }
    + else
    + {
    + [self errorWithFormat: @"OpenID server internal error during %@: %@", endpoint, response];
    ++ curl_easy_cleanup(curl);
    + return nil;
    + }
    + }
    +@@ -370,7 +372,7 @@ size_t curl_body_function(void *ptr, size_t size, size_t nmemb, void *buffer)
    + [self errorWithFormat: @"CURL error while accessing %@ (%d): %@", endpoint, rc,
    + [NSString stringWithCString: strlen(error) ? error : curl_easy_strerror(rc)]];
    + }
    +- curl_easy_cleanup (curl);
    ++ curl_easy_cleanup(curl);
    + }
    + else
    + {

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)