Update libsignal-service

This commit is contained in:
AsamK 2024-12-15 21:13:59 +01:00
parent f2df600d38
commit 9d92a3e06b
3 changed files with 9 additions and 6 deletions

View file

@ -10,7 +10,7 @@ slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }
slf4j-jul = { module = "org.slf4j:jul-to-slf4j", version.ref = "slf4j" } slf4j-jul = { module = "org.slf4j:jul-to-slf4j", version.ref = "slf4j" }
logback = "ch.qos.logback:logback-classic:1.5.12" logback = "ch.qos.logback:logback-classic:1.5.12"
signalservice = "com.github.turasa:signal-service-java:2.15.3_unofficial_112" signalservice = "com.github.turasa:signal-service-java:2.15.3_unofficial_113"
sqlite = "org.xerial:sqlite-jdbc:3.47.0.0" sqlite = "org.xerial:sqlite-jdbc:3.47.0.0"
hikari = "com.zaxxer:HikariCP:6.2.1" hikari = "com.zaxxer:HikariCP:6.2.1"
junit-jupiter = "org.junit.jupiter:junit-jupiter:5.11.3" junit-jupiter = "org.junit.jupiter:junit-jupiter:5.11.3"

View file

@ -28,6 +28,7 @@ import org.signal.storageservice.protos.groups.local.DecryptedMember;
import org.signal.storageservice.protos.groups.local.DecryptedPendingMember; import org.signal.storageservice.protos.groups.local.DecryptedPendingMember;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.whispersystems.signalservice.api.groupsv2.DecryptChangeVerificationMode;
import org.whispersystems.signalservice.api.groupsv2.DecryptedGroupResponse; import org.whispersystems.signalservice.api.groupsv2.DecryptedGroupResponse;
import org.whispersystems.signalservice.api.groupsv2.DecryptedGroupUtil; import org.whispersystems.signalservice.api.groupsv2.DecryptedGroupUtil;
import org.whispersystems.signalservice.api.groupsv2.GroupCandidate; import org.whispersystems.signalservice.api.groupsv2.GroupCandidate;
@ -652,11 +653,13 @@ class GroupV2Helper {
DecryptedGroupChange getDecryptedGroupChange(byte[] signedGroupChange, GroupMasterKey groupMasterKey) { DecryptedGroupChange getDecryptedGroupChange(byte[] signedGroupChange, GroupMasterKey groupMasterKey) {
if (signedGroupChange != null) { if (signedGroupChange != null) {
var groupOperations = dependencies.getGroupsV2Operations() final var groupSecretParams = GroupSecretParams.deriveFromMasterKey(groupMasterKey);
.forGroup(GroupSecretParams.deriveFromMasterKey(groupMasterKey)); final var groupOperations = dependencies.getGroupsV2Operations().forGroup(groupSecretParams);
final var groupId = groupSecretParams.getPublicParams().getGroupIdentifier();
try { try {
return groupOperations.decryptChange(GroupChange.ADAPTER.decode(signedGroupChange), true).orElse(null); return groupOperations.decryptChange(GroupChange.ADAPTER.decode(signedGroupChange),
DecryptChangeVerificationMode.verify(groupId)).orElse(null);
} catch (VerificationFailedException | InvalidGroupStateException | IOException e) { } catch (VerificationFailedException | InvalidGroupStateException | IOException e) {
return null; return null;
} }

View file

@ -49,7 +49,7 @@ abstract class DefaultStorageRecordProcessor<E extends SignalRecord<?>> implemen
final var local = getMatching(remote); final var local = getMatching(remote);
if (local.isEmpty()) { if (local.isEmpty()) {
debug(remote.getId(), remote, "No matching local record. Inserting."); debug(remote.getId(), remote, "[Local Insert] No matching local record. Inserting.");
insertLocal(remote); insertLocal(remote);
return; return;
} }
@ -70,7 +70,7 @@ abstract class DefaultStorageRecordProcessor<E extends SignalRecord<?>> implemen
if (!merged.equals(local.get())) { if (!merged.equals(local.get())) {
final var update = new StorageRecordUpdate<>(local.get(), merged); final var update = new StorageRecordUpdate<>(local.get(), merged);
debug(remote.getId(), remote, "[Local Update] " + update); debug(remote.getId(), remote, "[Local Update] " + local.get().describeDiff(merged));
updateLocal(update); updateLocal(update);
} }
} }