mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-02 14:16:53 +00:00
Ensure multi-recipient messages are addressed to ACI service IDs
This commit is contained in:
1 parent
e4ffc932a9
commit
6fa6c3c81c
2 files changed
+18
-23
No files matched your search
+7
@@ -717,6 +717,13 @@ public class MessageController {
|
||||
final @NotNull CombinedUnidentifiedSenderAccessKeys accessKeys,
|
||||
final Collection<MultiRecipientDeliveryData> destinations) {
|
||||
final int keyLength = UnidentifiedAccessUtil.UNIDENTIFIED_ACCESS_KEY_LENGTH;
|
||||
|
||||
if (destinations.stream()
|
||||
.anyMatch(destination -> IdentityType.PNI.equals(destination.serviceIdentifier.identityType()))) {
|
||||
throw new WebApplicationException("Multi-recipient messages must be addressed to ACI service IDs",
|
||||
Status.UNAUTHORIZED);
|
||||
}
|
||||
|
||||
final byte[] combinedUnidentifiedAccessKeys = destinations.stream()
|
||||
.map(MultiRecipientDeliveryData::account)
|
||||
.filter(Predicate.not(Account::isUnrestrictedUnidentifiedAccess))
|
||||
|
||||
Reference in new issue
Block a user