From 6bcbfee89ab0fbb1c71556658bb6a2e0e44cf79c Mon Sep 17 00:00:00 2001 From: Hivert Quentin Date: Mon, 16 Jun 2025 18:08:09 +0200 Subject: [PATCH] pwd fix --- SoObjects/SOGo/SOGoSession.m | 12 +++++------- SoObjects/SOGo/SOGoWebAuthenticator.m | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/SoObjects/SOGo/SOGoSession.m b/SoObjects/SOGo/SOGoSession.m index 55eaf8d86..8f07b4910 100644 --- a/SoObjects/SOGo/SOGoSession.m +++ b/SoObjects/SOGo/SOGoSession.m @@ -164,8 +164,6 @@ data = [theKey dataByDecodingBase64]; klen = [data length]; - // if (klen < [theValue length]) - // [self errorWithFormat: @"Value to be secured is too big (%i > %i) -- secured value will be corrupted", [theValue length], klen, [theKey length]]; //value longer than the key, concatenate the key with itself until long enough if (klen < [theValue length]) @@ -173,7 +171,7 @@ NSMutableData *concatenatedData = [NSMutableData data]; int j; int nbDuplication = [theValue length]/klen; - for(j=0; j>nbDuplication; j++) + for(j=0; j <= nbDuplication; j++) [concatenatedData appendData:data]; data = [NSData dataWithData: concatenatedData]; @@ -227,12 +225,12 @@ { NSMutableData *concatenatedData = [NSMutableData data]; int j; - int nbDuplication = [theValue length]/klen; - for(j=0; j>nbDuplication; j++) - [concatenatedData appendData:data]; + int nbDuplication = [dataValue length]/klen; + for(j=0; j <= nbDuplication; j++) + [concatenatedData appendData:dataKey]; dataKey = [NSData dataWithData: concatenatedData]; - klen = [data length]; + klen = [dataKey length]; } key = (char *)[dataKey bytes]; diff --git a/SoObjects/SOGo/SOGoWebAuthenticator.m b/SoObjects/SOGo/SOGoWebAuthenticator.m index 38f376d14..84929f8d0 100644 --- a/SoObjects/SOGo/SOGoWebAuthenticator.m +++ b/SoObjects/SOGo/SOGoWebAuthenticator.m @@ -53,7 +53,7 @@ about the same. The length is prior to bas64 encoding, so we must calculate a 33-36% increase. */ -#define COOKIE_USERKEY_LEN 2048 +#define COOKIE_USERKEY_LEN 2096 @implementation SOGoWebAuthenticator