mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 16:57:50 +00:00
Check prekey identity on mismatched devices too.
This commit is contained in:
parent
6b5753337c
commit
d8e1df9233
@ -189,7 +189,7 @@ public class PushTransport extends BaseTransport {
|
||||
private void handleMismatchedDevices(PushServiceSocket socket, long threadId,
|
||||
Recipient recipient,
|
||||
MismatchedDevices mismatchedDevices)
|
||||
throws InvalidNumberException, IOException
|
||||
throws InvalidNumberException, IOException, UntrustedIdentityException
|
||||
{
|
||||
try {
|
||||
String e164number = Util.canonicalizeNumber(context, recipient.getNumber());
|
||||
@ -205,7 +205,11 @@ public class PushTransport extends BaseTransport {
|
||||
PreKeyEntity preKey = socket.getPreKey(address);
|
||||
KeyExchangeProcessorV2 processor = new KeyExchangeProcessorV2(context, masterSecret, address);
|
||||
|
||||
if (processor.isTrusted(preKey)) {
|
||||
processor.processKeyExchangeMessage(preKey, threadId);
|
||||
} else {
|
||||
throw new UntrustedIdentityException("Untrusted identity key!", e164number, preKey.getIdentityKey());
|
||||
}
|
||||
}
|
||||
} catch (InvalidKeyException e) {
|
||||
throw new IOException(e);
|
||||
|
Loading…
x
Reference in New Issue
Block a user