use of org.signal.zkgroup.profiles.ProfileKey in project Signal-Android by WhisperSystems.
the class GroupsV2Operations_decrypt_change_Test method can_decrypt_member_direct_join_field3.
@Test
public void can_decrypt_member_direct_join_field3() {
UUID newMember = UUID.randomUUID();
ProfileKey profileKey = newProfileKey();
GroupCandidate groupCandidate = groupCandidate(newMember, profileKey);
assertDecryption(groupOperations.createGroupJoinDirect(groupCandidate.getProfileKeyCredential().get()).setRevision(10), DecryptedGroupChange.newBuilder().setRevision(10).addNewMembers(DecryptedMember.newBuilder().setRole(Member.Role.DEFAULT).setProfileKey(ByteString.copyFrom(profileKey.serialize())).setJoinedAtRevision(10).setUuid(UuidUtil.toByteString(newMember))));
}
use of org.signal.zkgroup.profiles.ProfileKey in project Signal-Android by WhisperSystems.
the class GroupsV2Operations_decrypt_change_Test method can_decrypt_member_additions_field3.
@Test
public void can_decrypt_member_additions_field3() {
UUID self = UUID.randomUUID();
UUID newMember = UUID.randomUUID();
ProfileKey profileKey = newProfileKey();
GroupCandidate groupCandidate = groupCandidate(newMember, profileKey);
assertDecryption(groupOperations.createModifyGroupMembershipChange(Collections.singleton(groupCandidate), self).setRevision(10), DecryptedGroupChange.newBuilder().setRevision(10).addNewMembers(DecryptedMember.newBuilder().setRole(Member.Role.DEFAULT).setProfileKey(ByteString.copyFrom(profileKey.serialize())).setJoinedAtRevision(10).setUuid(UuidUtil.toByteString(newMember))));
}
use of org.signal.zkgroup.profiles.ProfileKey in project Signal-Android by WhisperSystems.
the class GroupsV2Operations_decrypt_change_Test method can_decrypt_promote_pending_member_field9.
@Test
public void can_decrypt_promote_pending_member_field9() {
UUID newMember = UUID.randomUUID();
ProfileKey profileKey = newProfileKey();
GroupCandidate groupCandidate = groupCandidate(newMember, profileKey);
assertDecryption(groupOperations.createAcceptInviteChange(groupCandidate.getProfileKeyCredential().get()), DecryptedGroupChange.newBuilder().addPromotePendingMembers(DecryptedMember.newBuilder().setUuid(UuidUtil.toByteString(newMember)).setRole(Member.Role.DEFAULT).setProfileKey(ByteString.copyFrom(profileKey.serialize())).setJoinedAtRevision(-1)));
}
use of org.signal.zkgroup.profiles.ProfileKey in project Signal-Android by WhisperSystems.
the class GroupChangeReconstructTest method new_requesting_members_ignores_existing_by_uuid.
@Test
public void new_requesting_members_ignores_existing_by_uuid() {
UUID member1 = UUID.randomUUID();
UUID member2 = UUID.randomUUID();
ProfileKey profileKey2 = newProfileKey();
DecryptedGroup from = DecryptedGroup.newBuilder().addRequestingMembers(requestingMember(member1, newProfileKey())).build();
DecryptedGroup to = DecryptedGroup.newBuilder().addRequestingMembers(requestingMember(member1, newProfileKey())).addRequestingMembers(requestingMember(member2, profileKey2)).build();
DecryptedGroupChange decryptedGroupChange = GroupChangeReconstruct.reconstructGroupChange(from, to);
assertEquals(DecryptedGroupChange.newBuilder().addNewRequestingMembers(requestingMember(member2, profileKey2)).build(), decryptedGroupChange);
}
use of org.signal.zkgroup.profiles.ProfileKey in project Signal-Android by WhisperSystems.
the class GroupChangeReconstructTest method to_member.
@Test
public void to_member() {
UUID uuid = UUID.randomUUID();
ProfileKey profileKey = randomProfileKey();
DecryptedGroup from = DecryptedGroup.newBuilder().addMembers(withProfileKey(admin(uuid), profileKey)).build();
DecryptedGroup to = DecryptedGroup.newBuilder().addMembers(withProfileKey(member(uuid), profileKey)).build();
DecryptedGroupChange decryptedGroupChange = GroupChangeReconstruct.reconstructGroupChange(from, to);
assertEquals(DecryptedGroupChange.newBuilder().addModifyMemberRoles(demoteAdmin(uuid)).build(), decryptedGroupChange);
}
Aggregations