Update to libsignal-client 0.10.0, which includes zkgroup.
This commit is contained in:
parent
f0ab919ca5
commit
7ccc7ec856
19 changed files with 23 additions and 153 deletions
|
@ -465,7 +465,6 @@ dependencies {
|
|||
implementation project(':image-editor')
|
||||
implementation project(':donations')
|
||||
|
||||
implementation libs.signal.zkgroup.android
|
||||
implementation libs.signal.client.android
|
||||
implementation libs.google.protobuf.javalite
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ import org.signal.storageservice.protos.groups.local.DecryptedGroupChange;
|
|||
import org.signal.storageservice.protos.groups.local.DecryptedMember;
|
||||
import org.signal.storageservice.protos.groups.local.DecryptedPendingMember;
|
||||
import org.signal.zkgroup.groups.GroupMasterKey;
|
||||
import org.signal.zkgroup.util.UUIDUtil;
|
||||
import org.thoughtcrime.securesms.database.model.databaseprotos.DecryptedGroupV2Context;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId;
|
||||
|
|
|
@ -15,7 +15,6 @@ import org.signal.storageservice.protos.groups.local.DecryptedGroup;
|
|||
import org.signal.storageservice.protos.groups.local.DecryptedPendingMember;
|
||||
import org.signal.zkgroup.InvalidInputException;
|
||||
import org.signal.zkgroup.groups.UuidCiphertext;
|
||||
import org.signal.zkgroup.util.UUIDUtil;
|
||||
import org.thoughtcrime.securesms.database.DatabaseFactory;
|
||||
import org.thoughtcrime.securesms.database.GroupDatabase;
|
||||
import org.thoughtcrime.securesms.groups.GroupChangeException;
|
||||
|
|
|
@ -17,7 +17,7 @@ import static org.junit.Assert.assertNull;
|
|||
import static org.junit.Assert.assertSame;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.thoughtcrime.securesms.testutil.SecureRandomTestUtil.mockRandom;
|
||||
import static org.thoughtcrime.securesms.testutil.ZkGroupLibraryUtil.assumeZkGroupSupportedOnOS;
|
||||
import static org.whispersystems.signalservice.test.LibSignalLibraryUtil.assumeLibSignalSupportedOnOS;
|
||||
|
||||
public final class GroupIdTest {
|
||||
|
||||
|
@ -54,7 +54,7 @@ public final class GroupIdTest {
|
|||
|
||||
@Test
|
||||
public void can_create_for_gv2_from_GroupMasterKey() throws IOException, InvalidInputException {
|
||||
assumeZkGroupSupportedOnOS();
|
||||
assumeLibSignalSupportedOnOS();
|
||||
|
||||
GroupId.V2 groupId = GroupId.v2(new GroupMasterKey(Hex.fromStringCondensed("0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef")));
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@ import java.util.Arrays;
|
|||
import java.util.Collection;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.thoughtcrime.securesms.testutil.ZkGroupLibraryUtil.assumeZkGroupSupportedOnOS;
|
||||
import static org.whispersystems.signalservice.test.LibSignalLibraryUtil.assumeLibSignalSupportedOnOS;
|
||||
|
||||
@RunWith(Parameterized.class)
|
||||
|
@ -20,7 +19,6 @@ public final class GroupId_v1_v2_migration_derivation_Test {
|
|||
@Before
|
||||
public void ensureNativeSupported() {
|
||||
assumeLibSignalSupportedOnOS();
|
||||
assumeZkGroupSupportedOnOS();
|
||||
}
|
||||
|
||||
@Parameterized.Parameter(0)
|
||||
|
|
|
@ -1,45 +0,0 @@
|
|||
package org.thoughtcrime.securesms.testutil;
|
||||
|
||||
import org.signal.zkgroup.internal.Native;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.fail;
|
||||
import static org.junit.Assume.assumeNoException;
|
||||
|
||||
public final class ZkGroupLibraryUtil {
|
||||
|
||||
private ZkGroupLibraryUtil() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempts to initialize the ZkGroup Native class, which will load the native binaries.
|
||||
* <p>
|
||||
* If that fails to link, then on Unix, it will fail as we rely on that for CI.
|
||||
* <p>
|
||||
* If that fails to link, and it's not Unix, it will skip the test via assumption violation.
|
||||
* <p>
|
||||
* If using inside a PowerMocked test, the assumption violation can be fatal, use:
|
||||
* {@code @PowerMockRunnerDelegate(JUnit4.class)}
|
||||
*/
|
||||
public static void assumeZkGroupSupportedOnOS() {
|
||||
try {
|
||||
Class.forName(Native.class.getName());
|
||||
} catch (ClassNotFoundException e) {
|
||||
fail();
|
||||
} catch (UnsatisfiedLinkError | NoClassDefFoundError e) {
|
||||
String osName = System.getProperty("os.name");
|
||||
|
||||
if (isUnix(osName)) {
|
||||
fail("Not able to link native ZkGroup on a key OS: " + osName);
|
||||
} else {
|
||||
assumeNoException("Not able to link native ZkGroup on this operating system: " + osName, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isUnix(String osName) {
|
||||
assertNotNull(osName);
|
||||
osName = osName.toLowerCase();
|
||||
return osName.contains("nix") || osName.contains("nux") || osName.contains("aix");
|
||||
}
|
||||
}
|
|
@ -591,23 +591,17 @@ dependencyVerification {
|
|||
['org.signal:ringrtc-android:2.14.0',
|
||||
'73294d1f0da543ab031a0a3458e1dbd5053652211181b9abfaa49f0a3b51d5c5'],
|
||||
|
||||
['org.signal:zkgroup-android:0.8.2',
|
||||
'3883a9c8101e40d35fd749a1908eda43ee9036e63d98944f57bec62384e05889'],
|
||||
|
||||
['org.signal:zkgroup-java:0.8.2',
|
||||
'eaae035a974e0179052d9b90fb4dc4d5b8bd2fdb0b20ed36824f2bdf9fb6dd36'],
|
||||
|
||||
['org.slf4j:slf4j-api:1.7.24',
|
||||
'baf3c7fe15fefeaf9e5b000d94547379dc48370f22a8797e239c127e7d7756ec'],
|
||||
|
||||
['org.threeten:threetenbp:1.3.6',
|
||||
'f4c23ffaaed717c3b99c003e0ee02d6d66377fd47d866fec7d971bd8644fc1a7'],
|
||||
|
||||
['org.whispersystems:signal-client-android:0.9.7',
|
||||
'7b40d05255b318331afe9ac100f6cf1a30e2e813ebca313c5ae5d0a9821b4a3b'],
|
||||
['org.whispersystems:signal-client-android:0.10.0',
|
||||
'6fa02c957a03ef99a58b91d465e67dd3fbd16679008d40f066b3eeaefd85b6fb'],
|
||||
|
||||
['org.whispersystems:signal-client-java:0.9.7',
|
||||
'b9c141324db38e940e910c71d3c8474679a9f6f46c4d4f3116ec63a1e1368ffc'],
|
||||
['org.whispersystems:signal-client-java:0.10.0',
|
||||
'e32606dfab66f9c4a1356da988ae51f55e52a30669621da94ae4032d7e5c5528'],
|
||||
|
||||
['pl.tajchert:waitingdots:0.1.0',
|
||||
'2835d49e0787dbcb606c5a60021ced66578503b1e9fddcd7a5ef0cd5f095ba2c'],
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
dependencyResolutionManagement {
|
||||
versionCatalogs {
|
||||
libs {
|
||||
version('signal-client', '0.9.7')
|
||||
version('zkgroup', '0.8.2')
|
||||
version('signal-client', '0.10.0')
|
||||
version('exoplayer', '2.15.0')
|
||||
version('androidx-camera', '1.0.0-beta11')
|
||||
version('androidx-lifecycle', '2.3.1')
|
||||
|
@ -72,8 +71,6 @@ dependencyResolutionManagement {
|
|||
// 1st Party
|
||||
alias('signal-client-java').to('org.whispersystems', 'signal-client-java').versionRef('signal-client')
|
||||
alias('signal-client-android').to('org.whispersystems', 'signal-client-android').versionRef('signal-client')
|
||||
alias('signal-zkgroup-java').to('org.signal', 'zkgroup-java').versionRef('zkgroup')
|
||||
alias('signal-zkgroup-android').to('org.signal', 'zkgroup-android').versionRef('zkgroup')
|
||||
alias('signal-aesgcmprovider').to('org.signal:aesgcmprovider:0.0.3')
|
||||
alias('signal-argon2').to('org.signal:argon2:13.1')
|
||||
alias('signal-ringrtc').to('org.signal:ringrtc-android:2.14.0')
|
||||
|
|
|
@ -93,7 +93,7 @@ dependencyVerification {
|
|||
['org.jetbrains:annotations:13.0',
|
||||
'ace2a10dc8e2d5fd34925ecac03e4988b2c0f851650c94b8cef49ba1bd111478'],
|
||||
|
||||
['org.whispersystems:signal-client-java:0.9.7',
|
||||
'b9c141324db38e940e910c71d3c8474679a9f6f46c4d4f3116ec63a1e1368ffc'],
|
||||
['org.whispersystems:signal-client-java:0.10.0',
|
||||
'e32606dfab66f9c4a1356da988ae51f55e52a30669621da94ae4032d7e5c5528'],
|
||||
]
|
||||
}
|
||||
|
|
|
@ -43,8 +43,6 @@ dependencies {
|
|||
|
||||
api libs.rxjava3.rxjava
|
||||
|
||||
api libs.signal.zkgroup.java
|
||||
|
||||
testImplementation testLibs.junit.junit
|
||||
testImplementation testLibs.assertj.core
|
||||
testImplementation testLibs.conscrypt.openjdk.uber
|
||||
|
|
|
@ -36,7 +36,6 @@ import org.signal.zkgroup.profiles.ClientZkProfileOperations;
|
|||
import org.signal.zkgroup.profiles.ProfileKey;
|
||||
import org.signal.zkgroup.profiles.ProfileKeyCredential;
|
||||
import org.signal.zkgroup.profiles.ProfileKeyCredentialPresentation;
|
||||
import org.signal.zkgroup.util.UUIDUtil;
|
||||
import org.whispersystems.libsignal.logging.Log;
|
||||
import org.whispersystems.libsignal.util.guava.Optional;
|
||||
import org.whispersystems.signalservice.api.util.UuidUtil;
|
||||
|
@ -649,7 +648,7 @@ public final class GroupsV2Operations {
|
|||
return DecryptedPendingMember.newBuilder()
|
||||
.setUuid(UuidUtil.toByteString(uuid))
|
||||
.setUuidCipherText(userIdCipherText)
|
||||
.setAddedByUuid(ByteString.copyFrom(UUIDUtil.serialize(addedBy)))
|
||||
.setAddedByUuid(UuidUtil.toByteString(addedBy))
|
||||
.setRole(role)
|
||||
.setTimestamp(member.getTimestamp())
|
||||
.build();
|
||||
|
@ -698,7 +697,7 @@ public final class GroupsV2Operations {
|
|||
}
|
||||
|
||||
private ByteString decryptUuidToByteString(ByteString userId) throws InvalidGroupStateException, VerificationFailedException {
|
||||
return ByteString.copyFrom(UUIDUtil.serialize(decryptUuid(userId)));
|
||||
return UuidUtil.toByteString(decryptUuid(userId));
|
||||
}
|
||||
|
||||
ByteString encryptUuid(UUID uuid) {
|
||||
|
|
|
@ -7,7 +7,6 @@ import org.signal.storageservice.protos.groups.local.DecryptedGroupChange;
|
|||
import org.signal.storageservice.protos.groups.local.DecryptedMember;
|
||||
import org.signal.storageservice.protos.groups.local.DecryptedPendingMember;
|
||||
import org.signal.storageservice.protos.groups.local.DecryptedPendingMemberRemoval;
|
||||
import org.signal.zkgroup.util.UUIDUtil;
|
||||
import org.whispersystems.signalservice.api.util.UuidUtil;
|
||||
import org.whispersystems.signalservice.internal.util.Util;
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ import org.signal.zkgroup.profiles.ProfileKeyCredentialResponse;
|
|||
import org.whispersystems.libsignal.util.guava.Optional;
|
||||
import org.whispersystems.signalservice.api.util.UuidUtil;
|
||||
import org.whispersystems.signalservice.internal.util.Util;
|
||||
import org.whispersystems.signalservice.testutil.ZkGroupLibraryUtil;
|
||||
import org.whispersystems.signalservice.testutil.LibSignalLibraryUtil;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.UUID;
|
||||
|
@ -52,7 +52,7 @@ public final class GroupsV2Operations_decrypt_change_Test {
|
|||
|
||||
@Before
|
||||
public void setup() throws InvalidInputException {
|
||||
ZkGroupLibraryUtil.assumeZkGroupSupportedOnOS();
|
||||
LibSignalLibraryUtil.assumeLibSignalSupportedOnOS();
|
||||
|
||||
server = new TestZkGroupServer();
|
||||
groupSecretParams = GroupSecretParams.deriveFromMasterKey(new GroupMasterKey(Util.getSecretBytes(32)));
|
||||
|
@ -142,7 +142,7 @@ public final class GroupsV2Operations_decrypt_change_Test {
|
|||
|
||||
@Test(expected = InvalidGroupStateException.class)
|
||||
public void cannot_decrypt_member_additions_with_bad_cipher_text_field3() throws InvalidProtocolBufferException, VerificationFailedException, InvalidGroupStateException {
|
||||
byte[] randomPresentation = Util.getSecretBytes(ProfileKeyCredentialPresentation.SIZE);
|
||||
byte[] randomPresentation = Util.getSecretBytes(5);
|
||||
GroupChange.Actions.Builder actions = GroupChange.Actions.newBuilder();
|
||||
|
||||
actions.addAddMembers(GroupChange.Actions.AddMemberAction.newBuilder()
|
||||
|
@ -165,7 +165,7 @@ public final class GroupsV2Operations_decrypt_change_Test {
|
|||
|
||||
@Test(expected = InvalidGroupStateException.class)
|
||||
public void cannot_decrypt_member_removals_with_bad_cipher_text_field4() throws InvalidProtocolBufferException, VerificationFailedException, InvalidGroupStateException {
|
||||
byte[] randomPresentation = Util.getSecretBytes(UuidCiphertext.SIZE);
|
||||
byte[] randomPresentation = Util.getSecretBytes(5);
|
||||
GroupChange.Actions.Builder actions = GroupChange.Actions.newBuilder();
|
||||
|
||||
actions.addDeleteMembers(GroupChange.Actions.DeleteMemberAction.newBuilder()
|
||||
|
|
|
@ -9,7 +9,7 @@ import org.signal.zkgroup.InvalidInputException;
|
|||
import org.signal.zkgroup.groups.GroupMasterKey;
|
||||
import org.signal.zkgroup.groups.GroupSecretParams;
|
||||
import org.whispersystems.signalservice.internal.util.Util;
|
||||
import org.whispersystems.signalservice.testutil.ZkGroupLibraryUtil;
|
||||
import org.whispersystems.signalservice.testutil.LibSignalLibraryUtil;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
|
@ -22,7 +22,7 @@ public final class GroupsV2Operations_decrypt_groupJoinInfo_Test {
|
|||
|
||||
@Before
|
||||
public void setup() throws InvalidInputException {
|
||||
ZkGroupLibraryUtil.assumeZkGroupSupportedOnOS();
|
||||
LibSignalLibraryUtil.assumeLibSignalSupportedOnOS();
|
||||
|
||||
TestZkGroupServer server = new TestZkGroupServer();
|
||||
ClientZkOperations clientZkOperations = new ClientZkOperations(server.getServerPublicParams());
|
||||
|
|
|
@ -39,7 +39,7 @@ import org.signal.zkgroup.profiles.ProfileKeyCredentialResponse;
|
|||
import org.whispersystems.libsignal.util.guava.Optional;
|
||||
import org.whispersystems.signalservice.api.util.UuidUtil;
|
||||
import org.whispersystems.signalservice.internal.util.Util;
|
||||
import org.whispersystems.signalservice.testutil.ZkGroupLibraryUtil;
|
||||
import org.whispersystems.signalservice.testutil.LibSignalLibraryUtil;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.UUID;
|
||||
|
@ -56,7 +56,7 @@ public final class GroupsV2Operations_decrypt_group_Test {
|
|||
|
||||
@Before
|
||||
public void setup() throws InvalidInputException {
|
||||
ZkGroupLibraryUtil.assumeZkGroupSupportedOnOS();
|
||||
LibSignalLibraryUtil.assumeLibSignalSupportedOnOS();
|
||||
|
||||
TestZkGroupServer server = new TestZkGroupServer();
|
||||
ClientZkOperations clientZkOperations = new ClientZkOperations(server.getServerPublicParams());
|
||||
|
|
|
@ -9,7 +9,7 @@ import org.signal.zkgroup.profiles.ProfileKeyCredentialPresentation;
|
|||
import org.signal.zkgroup.profiles.ProfileKeyCredentialRequest;
|
||||
import org.signal.zkgroup.profiles.ProfileKeyCredentialResponse;
|
||||
import org.signal.zkgroup.profiles.ServerZkProfileOperations;
|
||||
import org.whispersystems.signalservice.testutil.ZkGroupLibraryUtil;
|
||||
import org.whispersystems.signalservice.testutil.LibSignalLibraryUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
@ -22,7 +22,7 @@ final class TestZkGroupServer {
|
|||
private final ServerZkProfileOperations serverZkProfileOperations;
|
||||
|
||||
TestZkGroupServer() {
|
||||
ZkGroupLibraryUtil.assumeZkGroupSupportedOnOS();
|
||||
LibSignalLibraryUtil.assumeLibSignalSupportedOnOS();
|
||||
|
||||
ServerSecretParams serverSecretParams = ServerSecretParams.generate();
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ package org.whispersystems.signalservice.api.util;
|
|||
import com.google.protobuf.ByteString;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.signal.zkgroup.util.UUIDUtil;
|
||||
import org.whispersystems.libsignal.util.Hex;
|
||||
|
||||
import java.io.IOException;
|
||||
|
@ -50,24 +49,6 @@ public final class UuidUtilTest {
|
|||
assertEquals("b83dfb0b-67f1-41aa-992e-030c167cd011", uuid.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void byte_array_compatibility_with_zk_group_uuid_util() {
|
||||
UUID uuid = UUID.fromString("67dfd496-ea02-4720-b13d-83a462168b1d");
|
||||
|
||||
UUID result = UUIDUtil.deserialize(UuidUtil.toByteArray(uuid));
|
||||
|
||||
assertEquals(uuid, result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void byte_string_compatibility_with_zk_group_uuid_util() {
|
||||
UUID uuid = UUID.fromString("67dfd496-ea02-4720-b13d-83a462168b1d");
|
||||
|
||||
UUID result = UuidUtil.fromByteString(ByteString.copyFrom(UUIDUtil.serialize(uuid)));
|
||||
|
||||
assertEquals(uuid, result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void byte_string_round_trip() {
|
||||
UUID uuid = UUID.fromString("67dfd496-ea02-4720-b13d-83a462168b1d");
|
||||
|
|
|
@ -1,45 +0,0 @@
|
|||
package org.whispersystems.signalservice.testutil;
|
||||
|
||||
import org.signal.zkgroup.internal.Native;
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.fail;
|
||||
import static org.junit.Assume.assumeNoException;
|
||||
|
||||
public final class ZkGroupLibraryUtil {
|
||||
|
||||
private ZkGroupLibraryUtil() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempts to initialize the ZkGroup Native class, which will load the native binaries.
|
||||
* <p>
|
||||
* If that fails to link, then on Unix, it will fail as we rely on that for CI.
|
||||
* <p>
|
||||
* If that fails to link, and it's not Unix, it will skip the test via assumption violation.
|
||||
* <p>
|
||||
* If using inside a PowerMocked test, the assumption violation can be fatal, use:
|
||||
* {@code @PowerMockRunnerDelegate(JUnit4.class)}
|
||||
*/
|
||||
public static void assumeZkGroupSupportedOnOS() {
|
||||
try {
|
||||
Class.forName(Native.class.getName());
|
||||
} catch (ClassNotFoundException e) {
|
||||
fail();
|
||||
} catch (UnsatisfiedLinkError | NoClassDefFoundError e) {
|
||||
String osName = System.getProperty("os.name");
|
||||
|
||||
if (isUnix(osName)) {
|
||||
fail("Not able to link native ZkGroup on a key OS: " + osName);
|
||||
} else {
|
||||
assumeNoException("Not able to link native ZkGroup on this operating system: " + osName, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isUnix(String osName) {
|
||||
assertNotNull(osName);
|
||||
osName = osName.toLowerCase();
|
||||
return osName.contains("nix") || osName.contains("nux") || osName.contains("aix");
|
||||
}
|
||||
}
|
|
@ -39,13 +39,10 @@ dependencyVerification {
|
|||
['org.reactivestreams:reactive-streams:1.0.3',
|
||||
'1dee0481072d19c929b623e155e14d2f6085dc011529a0a0dbefc84cf571d865'],
|
||||
|
||||
['org.signal:zkgroup-java:0.8.2',
|
||||
'eaae035a974e0179052d9b90fb4dc4d5b8bd2fdb0b20ed36824f2bdf9fb6dd36'],
|
||||
|
||||
['org.threeten:threetenbp:1.3.6',
|
||||
'f4c23ffaaed717c3b99c003e0ee02d6d66377fd47d866fec7d971bd8644fc1a7'],
|
||||
|
||||
['org.whispersystems:signal-client-java:0.9.7',
|
||||
'b9c141324db38e940e910c71d3c8474679a9f6f46c4d4f3116ec63a1e1368ffc'],
|
||||
['org.whispersystems:signal-client-java:0.10.0',
|
||||
'e32606dfab66f9c4a1356da988ae51f55e52a30669621da94ae4032d7e5c5528'],
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue