Clear sender key shared state on archive and prekey message receive.

We need to clear the sender key shared state whenever a registrationId
changes. We don't have good hooks for that on Android, so instead we're
just going to reset on every archive and prekey receive. It's a little
overzealous, but given these are rare events anyway, it shouldn't be a
big deal.
This commit is contained in:
Greyson Parrelli
2022-02-09 12:12:41 -05:00
parent 597cf3f576
commit 0558d5f0b3
4 changed files with 18 additions and 11 deletions

View File

@@ -19,6 +19,7 @@ import org.whispersystems.signalservice.api.SignalServiceAccountDataStore;
import org.whispersystems.signalservice.api.push.DistributionId;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.UUID;
@@ -139,6 +140,7 @@ public class SignalServiceAccountDataStoreImpl implements SignalServiceAccountDa
@Override
public void archiveSession(SignalProtocolAddress address) {
sessionStore.archiveSession(address);
senderKeyStore.clearSenderKeySharedWith(Collections.singleton(address));
}
@Override